Skip to Content
Getting Started

Getting Started

Get your DermaDetect development environment up and running in minutes.

Prerequisites

Before you begin, make sure you have:

Quick Start

1. Clone the Repository

git clone https://github.com/dermadetect/backend_2025.git cd backend_2025

2. Install Dependencies

# Using just (recommended) just install # Or manually cd packages/py_core && uv sync cd ../services/ai_service && uv sync cd ../api_gateway && uv sync

3. Start Local Services

# Start PostgreSQL, AI service, and API gateway just up # Or manually docker compose up -d

4. Run Tests

# Test all services just test # Test specific service just test-service packages/py_core

5. Access the Services

Project Structure

backend_2025/ β”œβ”€β”€ packages/ β”‚ └── py_core/ # Shared utilities β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ auth/ # JWT, password hashing β”‚ β”‚ β”œβ”€β”€ db/ # Database connections β”‚ β”‚ β”œβ”€β”€ models/ # Pydantic models β”‚ β”‚ └── storage/ # Cloud storage β”‚ └── pyproject.toml β”‚ β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ ai_service/ # AI/ML service β”‚ β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”‚ β”œβ”€β”€ api/ # FastAPI routes β”‚ β”‚ β”‚ β”œβ”€β”€ core/ # Business logic β”‚ β”‚ β”‚ └── main.py # Entry point β”‚ β”‚ └── pyproject.toml β”‚ β”‚ β”‚ └── api_gateway/ # API gateway β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ api/ β”‚ β”‚ β”‚ └── v1/ # Versioned routes β”‚ β”‚ β”œβ”€β”€ auth/ # Authentication β”‚ β”‚ └── main.py β”‚ └── pyproject.toml β”‚ └── docs/ # This documentation site

Common Commands

Development

just up # Start local development stack just down # Stop services just logs # View all logs just logs-service postgres # View specific service logs

Code Quality

just lint # Run ruff linter and formatter just pre-commit # Run pre-commit hooks

Testing

just test # Run all tests just test-integration # Run integration tests just test-service services/ai_service # Test specific service

Database

just migrate # Run database migrations just migrate-create "add_user_table" # Create new migration

Local Development

just start-ai # Start AI service locally (with reload) just start-api # Start API gateway locally (with reload)

Environment Variables

Create a .env file in the project root:

# Database DATABASE_URL=postgresql+asyncpg://dermadetect:password@localhost:5432/dermadetect # AI Service AI_SERVICE_URL=http://localhost:8080 # Authentication JWT_SECRET=your-secret-key-change-in-production # Cloud Storage (optional) AZURE_CONN_STRING=your-azure-connection-string GCS_BUCKET=your-gcs-bucket

Next Steps

Troubleshooting

Port Already in Use

If ports 8000 or 8080 are already in use:

# Find and kill process on port 8000 lsof -ti:8000 | xargs kill -9 # Or change ports in docker-compose.yml

Database Connection Issues

# Check PostgreSQL is running docker compose ps postgres # View database logs just logs-service postgres # Reset database just down just up

Python Version Issues

Ensure you’re using Python 3.13:

python --version # Should show 3.13.x # Or use uv to manage Python versions uv python install 3.13

Getting Help

  • πŸ“– Check the documentation
  • πŸ› Open an issue on GitHub
  • πŸ’¬ Ask in team chat
Last updated on