MellonPass backend server (GraphQL, docker, and database)
Make sure you have the following installed on your machine:
-
Cloning the repository:
git clone git@github.com:mellonpass/server.git
-
Build service images:
docker compose build -
Starting required services:
docker compose up
- GraphQL server is accessible via
http://localhost:8000/graphql. - Django admin is accessible via
http://localhost:8000/admin.- See
docker-compose.ymlfile for a test admin user and test user credentials.
- See
To access Django shell session:
docker exec -it mellonpass_server poetry run python manage.py shell_plus
To run the tests:
docker exec -it mellonpass_server poetry run pytest .
or via tox:
# To run all tests.
tox
# To run specific tests.
tox -- mp/apps/authx/tests/test_services.py
# Use -x to stop at first error and --ff to run tests first that failed last time.
tox -- -x --ff mp/apps/authx/tests
To format the codebase:
docker exec -it mellonpass_server poetry run ./scripts/dev/autoformat .
Note: We use ruff to format code.
To get into the container:
docker exec -it mellonpass_server bash
Then you can run all bash commands inside the container.
Install pre-commit hooks configuration:
pre-commit install
To contribute, follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feat/your-feature). - Make your changes.
- Commit your changes. See conventional-commits for composing commit messages.
- Push to the branch (
git push origin feat/your-feature). - Open a pull request.
This project is licensed under the GPL v3 License. See the LICENSE file for details.