Skip to content

Donchess1/onionloop

Repository files navigation

MyBalance API

Black Code Style

Technologies

  • 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

How To Start App

  1. Clone the Repository

  2. Create a .env file with the variables in the .env.example file:

    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 .env file.
  3. 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.
  4. Start the application

    make up
  5. Stop the application

    make down
  6. Run tests

    make test
  7. Other commands

    • Check the Makefile for additional commands.

Exploring The App

Ensure that all required services are running before exploring the project.

🔧 Development Guidelines

To maintain a clean and consistent development workflow, all contributions must follow these guidelines:

1️⃣ JIRA Ticket Requirement

  • 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.

2️⃣ Branch Naming Convention

  • Branch names must follow this structure:
    {change-type}/{author-initials}-{JIRA-ticket}
    
    • Change Types: feature, hotfix, bugfix, chore
    • Examples:
      • feature/TA-MD12
      • hotfix/SA-MES5
      • bugfix/JD-WIDGET19
      • chore/JP-MES34

3️⃣ Git Commit Message Format

  • Commit messages must follow this format:
    MYB-{ticket_id} | Commit message
    
    • Examples:
      • MYB-MD12 | Refactored old implementation
      • MYB-MES5 | Reverted migrations folder
      • MYB-WIDGET19 | Fixed withdrawal rate limit issue

4️⃣ Pull Request (PR) Requirements

  • 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.

🔄 CI/CD Workflow

  • CI/CD is set up to automatically deploy changes.
  • Changes merged to staging automatically deploy to the staging environment.
  • Changes merged to main automatically deploy to production.
  • Workflow:
    1. Always branch out from staging to make changes.
    2. Raise a PR to staging.
    3. Once merged, monitor the deployment and test the changes.
    4. After verification, raise a second PR to main for production deployment.

Deployment Links:

✅ Pre-commit (Linting & Formatting)

We use pre-commit to automate code formatting and linting before commits.

1️⃣ Setting up pre-commit

  • Install pre-commit:
    pip install pre-commit
  • Install the hooks:
    pre-commit install

2️⃣ What does pre-commit do?

  • Runs isort to organize imports and enforce ordering.
  • Runs black for automatic code formatting.

3️⃣ Configured hooks

🎉 Happy Coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages