Backend API service built with FastAPI, SQLAlchemy, and Alembic for a social pet platform.
- FastAPI
- SQLAlchemy
- Alembic migrations
- PostgreSQL
- JWT-based authentication
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a .env file in the project root with the following keys:
DATABASE_HOSTNAME=localhost
DATABASE_PORT=5432
DATABASE_PASSWORD=your_password
DATABASE_NAME=your_database
DATABASE_USERNAME=your_user
SECRET_KEY=your_secret
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
AZURE_STORAGE_CONNECTION_STRING=your_connection_string
AZURE_STORAGE_ACCOUNT_KEY=your_account_key
AZURE_STORAGE_CONTAINER_NAME=your_container
EMAIL_SENDER=your_sender@example.com
EMAIL_PASSWORD=your_email_passwordalembic upgrade headuvicorn app.main:app --reloadOpen Swagger docs at: http://127.0.0.1:8000/docs
app/main.py– app initialization and router wiringapp/routers/– route handlers (auth, users, posts, pets, messaging, etc.)app/models.py– SQLAlchemy modelsapp/schemas.py– Pydantic schemasapp/database.py– database connection/session setupalembic/– migration configuration and revision history
- Add automated tests for core auth and post flows (smoke + integration tests).
- Introduce structured logging and request IDs for easier production debugging.
- Add CI checks for linting, migration drift, and test execution.