|
||
---|---|---|
.. | ||
alembic | ||
app | ||
tests | ||
.gitignore | ||
README.md | ||
alembic.ini | ||
requirements.txt |
README.md
Backend for Glass Cutting Optimization
This directory contains the FastAPI backend application.
Setup
- Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
Create a
.env
file in this directory based on.env.example
(you'll create this later). - Run database migrations (using Alembic):
# Initialize alembic (only once) # alembic init alembic # Edit alembic.ini and alembic/env.py to point to your models and database URL # ... # Create a migration # alembic revision --autogenerate -m "Initial migration" # Apply the migration # alembic upgrade head
- Run the development server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Project Structure
app/
: Main application codecore/
: Configuration, settings, dependenciesdb/
: Database session managementmodels/
: SQLAlchemy modelsschemas/
: Pydantic schemasrouters/
: API route handlersservices/
: Business logic
alembic/
: Database migration scriptstests/
: Application tests.env
: Environment variables (local)alembic.ini
: Alembic configurationrequirements.txt
: Python dependencies