A web application for booking company vehicles built with Svelte 5 frontend and FastAPI backend.
├── frontend/ # Svelte 5 frontend application
│ ├── src/ # Source code
│ ├── package.json # Frontend dependencies
│ └── vite.config.ts # Vite configuration
├── backend/ # FastAPI backend application
│ ├── models/ # Database models
│ ├── api/ # API routes
│ ├── services/ # Business logic
│ ├── tests/ # Test files
│ ├── main.py # FastAPI application
│ └── requirements.txt # Backend dependencies
└── README.md # This file
Navigate to the backend directory:
cd backend
Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
Copy environment file:
cp .env.example .env
Run the development server:
python run_dev.py
The API will be available at http://localhost:8000
Navigate to the frontend directory:
cd frontend
Install dependencies:
npm install
Run the development server:
npm run dev
The frontend will be available at http://localhost:5173
The database is automatically initialized when you start the backend server. For manual database management:
cd backend
# Check database status
python manage_db.py status
# Initialize database manually
python manage_db.py init
# List all vehicles
python manage_db.py vehicles
# Check vehicle availability for date range
python manage_db.py availability 2024-01-15 2024-01-17
# Seed database with initial data
python manage_db.py seed
For detailed database setup and migration information, see backend/DATABASE_SETUP.md.
Once the backend is running, visit http://localhost:8000/docs for interactive API documentation.
cd backend
pytest
cd frontend
npm test