# SIBU Project Rules and Conventions ## Project Structure This is a full-stack transportation application: - **Backend**: FastAPI + SQLModel + Postgres (in `backend/` folder) using uv - **Frontend**: Vue3 + Vite + Shadcn (in `frontend/` folder) using Bun ## Package Management ### Backend - **Always use `uv` for package management** - **NEVER edit `pyproject.toml` manually** - use `uv add ` instead - Execute backend with: `uv run fastapi dev app/main.py` (development) or `uv run fastapi run app/main.py` (production) - Run migrations with: `uv run alembic upgrade head` ### Frontend - **Always use `bun` for package management** - **NEVER edit `package.json` manually** - use `bun add ` instead - Run development server: `bun run dev` - Build for production: `bun run build` ## Backend Conventions ### Configuration - Use `pydantic-settings` BaseSettings class in `app/core/config.py` for all environment variable management - Environment files: `.env.development` and `.env.production` - Database URL format: `postgresql+asyncpg://localhost:5432/sibu_dev` ### Code Style - Use Python type hints for all function parameters and return types - Use SQLModel for database models - Use Pydantic schemas for request/response validation - Follow FastAPI best practices for API routes - Use dependency injection for database sessions ### Project Structure ``` backend/ ├── app/ │ ├── api/ # API route handlers │ ├── core/ # Configuration and database │ ├── models/ # SQLModel models │ ├── schemas/ # Pydantic schemas │ └── services/ # Business logic ├── alembic/ # Database migrations └── pyproject.toml # Managed by uv ``` ## Frontend Conventions ### Code Style - Use Vue3 Composition API with `