Skip to content

Commit 21b426d

Browse files
committed
fix: todo modules and login
1 parent 5da5980 commit 21b426d

47 files changed

Lines changed: 1536 additions & 189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 0 additions & 62 deletions
This file was deleted.

Dockerrfile renamed to Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ COPY src ./src
1919
EXPOSE 8000
2020

2121
# Run application
22-
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]
22+
COPY start.sh ./script/start.sh
23+
RUN chmod +x start.sh
24+
25+
CMD ["./script/start.sh"]

Makefile

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
SHELL := /bin/bash
2+
3+
PYTHON := .venv/bin/python
4+
PYTEST := .venv/bin/pytest
5+
RUFF := .venv/bin/ruff
6+
UVICORN := .venv/bin/uvicorn
7+
ALEMBIC := .venv/bin/alembic
8+
POETRY := poetry
9+
COMPOSE_FILE := docker-compose.yml
10+
11+
.DEFAULT_GOAL := help
12+
13+
.PHONY: help install run test lint import-check check migrate downgrade revision db-up db-down db-logs clean
14+
15+
help:
16+
@echo "[make:help] Available commands:"
17+
@echo " [make:install] Install project dependencies with Poetry"
18+
@echo " [make:run] Run the FastAPI development server"
19+
@echo " [make:test] Run pytest"
20+
@echo " [make:lint] Run Ruff checks"
21+
@echo " [make:import-check] Verify src.main imports"
22+
@echo " [make:check] Run tests, lint, and import check"
23+
@echo " [make:migrate] Apply Alembic migrations"
24+
@echo " [make:downgrade] Roll back one Alembic migration"
25+
@echo " [make:revision] Create an Alembic migration: make revision name=\"describe change\""
26+
@echo " [make:db-up] Start Docker Compose services"
27+
@echo " [make:db-down] Stop Docker Compose services"
28+
@echo " [make:db-logs] Follow Docker Compose logs"
29+
@echo " [make:clean] Remove local Python cache files"
30+
31+
install:
32+
@echo "[make:install] Installing dependencies with Poetry"
33+
@$(POETRY) install
34+
35+
run:
36+
@echo "[make:run] Starting FastAPI development server on http://localhost:8000"
37+
@$(UVICORN) src.main:app --reload --host 0.0.0.0 --port 8000
38+
39+
test:
40+
@echo "[make:test] Running pytest"
41+
@$(PYTEST) -q
42+
43+
lint:
44+
@echo "[make:lint] Running Ruff checks"
45+
@$(RUFF) check src tests
46+
47+
import-check:
48+
@echo "[make:import-check] Verifying src.main imports"
49+
@PYTHONDONTWRITEBYTECODE=1 $(PYTHON) -c "import src.main; print('import ok')"
50+
51+
check: test lint import-check
52+
@echo "[make:check] All checks completed"
53+
54+
migrate:
55+
@echo "[make:migrate] Applying Alembic migrations"
56+
@$(ALEMBIC) upgrade head
57+
58+
downgrade:
59+
@echo "[make:downgrade] Rolling back one Alembic migration"
60+
@$(ALEMBIC) downgrade -1
61+
62+
revision:
63+
@if [ -z "$(name)" ]; then \
64+
echo "[make:revision] Usage: make revision name=\"describe change\""; \
65+
exit 1; \
66+
fi
67+
@echo "[make:revision] Creating Alembic migration: $(name)"
68+
@$(ALEMBIC) revision --autogenerate -m "$(name)"
69+
70+
db-up:
71+
@echo "[make:db-up] Starting Docker Compose services"
72+
@docker compose -f $(COMPOSE_FILE) up -d
73+
74+
db-down:
75+
@echo "[make:db-down] Stopping Docker Compose services"
76+
@docker compose -f $(COMPOSE_FILE) down
77+
78+
db-logs:
79+
@echo "[make:db-logs] Following Docker Compose logs"
80+
@docker compose -f $(COMPOSE_FILE) logs -f
81+
82+
clean:
83+
@echo "[make:clean] Removing local Python cache files"
84+
@find . -type d -name "__pycache__" -prune -exec rm -rf {} +
85+
@find . -type d -name ".pytest_cache" -prune -exec rm -rf {} +
86+
@find . -type d -name ".ruff_cache" -prune -exec rm -rf {} +

0 commit comments

Comments
 (0)