Skip to content

Serene0-0/hackathon

Repository files navigation

Lives Tracker API

Backend API for Mood Tracker - AI-powered mood tracking app for international students.

Tech Stack

  • FastAPI 0.109 - Web framework
  • PostgreSQL 16 - Database
  • SQLAlchemy 2.0 - ORM (async)
  • Alembic - Database migrations
  • Claude API - AI-generated insights
  • Docker - Containerization

activate virtual environment

source .venv/bin/activate

using venv install

PKG=(pytest-mock)
uv pip install "$PKG" --python ../venv/bin/python

generate key/token pepper

openssl rand -base64 32

Local Setup & Run

uvicorn main:app --reload

Quick Start with docker

  1. copy env.example
cp env.example .env
  1. Build all containers
docker compose up -d --build
  1. Start the database and backend containers
docker compose up -d db app
  1. Run database migration with Alembic
docker compose run --rm app alembic upgrade head
  1. Check running services
docker compose ps
  1. View logs if needed
docker compose logs -f db app
  1. Rebuild after updating code
docker compose up -d --build

Database Migrations

Alembic is used for managing database schema changes.

  • Generate a new migration when models change:
docker compose run --rm app alembic revision --autogenerate -m "describe change"
  • Apply migrations to bring the database to the latest state:
docker compose run --rm app alembic upgrade head
  • Check current version:
docker compose run --rm app alembic current

About

gemini hackathon api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages