Getting Started
Get your DermaDetect development environment up and running in minutes.
Prerequisites
Before you begin, make sure you have:
- Python 3.13+ - Download PythonΒ
- uv - Fast Python package manager (Install uvΒ )
- Docker & Docker Compose - Install DockerΒ
- just (optional) - Command runner (Install justΒ )
Quick Start
1. Clone the Repository
git clone https://github.com/dermadetect/backend_2025.git
cd backend_20252. 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 sync3. Start Local Services
# Start PostgreSQL, AI service, and API gateway
just up
# Or manually
docker compose up -d4. Run Tests
# Test all services
just test
# Test specific service
just test-service packages/py_core5. Access the Services
- API Gateway: http://localhost:8000Β
- AI Service: http://localhost:8080Β
- API Docs: http://localhost:8000/docsΒ (Swagger UI)
- PostgreSQL: localhost:5432
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 siteCommon Commands
Development
just up # Start local development stack
just down # Stop services
just logs # View all logs
just logs-service postgres # View specific service logsCode Quality
just lint # Run ruff linter and formatter
just pre-commit # Run pre-commit hooksTesting
just test # Run all tests
just test-integration # Run integration tests
just test-service services/ai_service # Test specific serviceDatabase
just migrate # Run database migrations
just migrate-create "add_user_table" # Create new migrationLocal 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-bucketNext Steps
- π Read the Architecture guide to understand the system
- π§ Explore the API Reference for available endpoints
- π Learn about Deployment strategies
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.ymlDatabase Connection Issues
# Check PostgreSQL is running
docker compose ps postgres
# View database logs
just logs-service postgres
# Reset database
just down
just upPython 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.13Getting Help
- π Check the documentation
- π Open an issue on GitHub
- π¬ Ask in team chat
Last updated on