A modern REST API project built with FastAPI and SQLAlchemy, providing a robust foundation for building scalable web applications.
-
db.py- Database configuration and session management- Sets up SQLite database connection
- Configures SQLAlchemy engine and session
- Provides database dependency injection
- Creates Base class for models
-
main.py- Application entry point (to be implemented)- FastAPI application initialization
- API route definitions
- Server configuration
- FastAPI - Modern, fast web framework for building APIs
- SQLAlchemy - SQL toolkit and ORM
- Uvicorn - Lightning-fast ASGI server
- SQLite - Lightweight database
- Install dependencies:
pip install fastapi uvicorn sqlalchemyStart the server:
python main.py
API documentation is automatically generated by FastAPI. Access it at
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
The project uses SQLite as the database. The database file is stored in data.db file.
The database is automatically created when the application starts.
The database configuration can be customized by modifying the db.py file.