Skip to content

Backend Development

This guide covers the prerequisites and installation steps for backend of the PixErase.

Prerequisites

  • Python: >= 3.12
  • Docker: For containerized deployment
  • Git: For cloning the repository
  • Just: Task runner

Installation Steps

  1. Clone the Repository:
git clone https://github.com/C3EQUALZz/PixErase
cd PixErase/backend
  1. Set Up Virtual Environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
  1. Install Dependencies: Use the provided just command to bootstrap the environment:
just bootstrap

This copies .env.dist to .env, installs dependencies, and sets up pre-commit hooks.

  1. Docker Setup: To run the infrastructure with Docker:
just up-dev

This starts all services defined in docker-compose.dev.yaml, including the API, database, broker.

  1. Scheduler Setup:

    Open new window in terminal and run scheduler using this command:

    taskiq scheduler pix_erase.scheduler:create_scheduler_taskiq_app -fsd -tp pix_erase.infrastructure.scheduler.tasks
    
  2. Worker Setup:

    To run worker use this command:

    taskiq worker --ack-type when_saved pix_erase.worker:create_worker_taskiq_app -fsd -tp pix_erase.infrastructure.scheduler.tasks
    
  3. API Setup

    To run api use this command:

    uvicorn --factory src.pix_erase.web:create_fastapi_app --port 8080
    
  4. Database Migration

    Run migration using this command:

    alembic upgrade head
    

[!NOTE] Super Admin in System is provided here: email: admin@pixerase.com password: admin12345

[!NOTE] Swagger: http://localhost:8080