- Python 3.10: Base programming language for development
- PostgreSQL: Application relational databases for development, staging, and production environments
- Django Framework: Development framework used for the application
- Django Rest Framework: Provides API development tools for easy API development
- Celery: A simple, flexible, and reliable distributed system to process vast amounts of tasks
- Redis: A NoSQL database that serves as Cache, Celery Broker, and Result Backend
- SendGrid: An Email Service Provider for sending emails
- Docker Engine and Docker Compose: Containerization of the application and services orchestration
-
Clone the Repository
-
Create a
.envfile with the variables in the.env.examplefile:cp .env.example .env
- You will also need to create an account with SendGrid and get an API Key.
- Add the API Key to the
.envfile.
-
Run the build process
make build
- This command downloads all Docker images and third-party packages required for the app.
- Note: The first build may take several minutes.
-
Start the application
make up
- This will start the following services:
- PostgreSQL Server → http://localhost:5435
- Django Development Server → http://localhost:8000
- Redis Server → http://localhost:6379
- This will start the following services:
-
Stop the application
make down
-
Run tests
make test -
Other commands
- Check the
Makefilefor additional commands.
- Check the
Ensure that all required services are running before exploring the project.
To maintain a clean and consistent development workflow, all contributions must follow these guidelines:
- Every change must be linked to a JIRA ticket.
- The ticket ID consists of the project key and ticket number, e.g.,
MD12,MES34,WIDGET19,MES5.
- Branch names must follow this structure:
{change-type}/{author-initials}-{JIRA-ticket}- Change Types:
feature,hotfix,bugfix,chore - Examples:
feature/TA-MD12hotfix/SA-MES5bugfix/JD-WIDGET19chore/JP-MES34
- Change Types:
- Commit messages must follow this format:
MYB-{ticket_id} | Commit message- Examples:
MYB-MD12 | Refactored old implementationMYB-MES5 | Reverted migrations folderMYB-WIDGET19 | Fixed withdrawal rate limit issue
- Examples:
- Every PR must include the following:
- Title: Follows the commit format, e.g.,
MYB-MD12 | Refactored old implementation - Description: A detailed explanation of the changes.
- JIRA Ticket Link
- Screenshots (if applicable)
- Steps to test the changes to help with faster review.
- Title: Follows the commit format, e.g.,
- CI/CD is set up to automatically deploy changes.
- Changes merged to
stagingautomatically deploy to the staging environment. - Changes merged to
mainautomatically deploy to production. - Workflow:
- Always branch out from
stagingto make changes. - Raise a PR to
staging. - Once merged, monitor the deployment and test the changes.
- After verification, raise a second PR to
mainfor production deployment.
- Always branch out from
Deployment Links:
We use pre-commit to automate code formatting and linting before commits.
- Install pre-commit:
pip install pre-commit
- Install the hooks:
pre-commit install
- Runs isort to organize imports and enforce ordering.
- Runs black for automatic code formatting.
- The available hooks are listed in
.pre-commit-config.yaml.