
- Setup project structure and dependencies - Create SQLite database with SQLAlchemy models - Initialize Alembic for database migrations - Implement JWT-based authentication utilities - Create API endpoints for signup, login, and logout - Add health check endpoint - Implement authentication middleware for protected routes - Update README with setup and usage instructions - Add linting with Ruff
19 lines
476 B
Python
19 lines
476 B
Python
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
# Add the current directory to the Python path
|
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
from app.core.config import settings
|
|
|
|
# Ensure database directory exists
|
|
settings.DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
|
|
print(f"Initializing database at {settings.SQLALCHEMY_DATABASE_URL}")
|
|
|
|
# Run Alembic migrations
|
|
subprocess.run(["alembic", "upgrade", "head"], check=True)
|
|
|
|
print("Database initialization completed.")
|