https://github.com/dmickelson/fastapisqlalchemyproject
FastAPI SQLAlchemy Test Project
https://github.com/dmickelson/fastapisqlalchemyproject
fastap orm-framework python redoc sqlalchemy sqlalchemy-python swagger
Last synced: 3 months ago
JSON representation
FastAPI SQLAlchemy Test Project
- Host: GitHub
- URL: https://github.com/dmickelson/fastapisqlalchemyproject
- Owner: dmickelson
- Created: 2024-10-28T00:00:24.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T00:03:27.000Z (about 1 year ago)
- Last Synced: 2025-01-12T10:09:13.348Z (12 months ago)
- Topics: fastap, orm-framework, python, redoc, sqlalchemy, sqlalchemy-python, swagger
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FastAPI SQLAlchemy Project
A modern REST API project built with FastAPI and SQLAlchemy, providing a robust foundation for building scalable web applications.
## Project Structure
- `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
## Technical Stack
- **FastAPI** - Modern, fast web framework for building APIs
- **SQLAlchemy** - SQL toolkit and ORM
- **Uvicorn** - Lightning-fast ASGI server
- **SQLite** - Lightweight database
## Getting Started
1. Install dependencies:
```bash
pip install fastapi uvicorn sqlalchemy
```
[image](1_Hjn46ufGabp3Of-IgrP3pg.webp)
## Running the Application
Start the server:
`python main.py`
## API Documentation
API documentation is automatically generated by FastAPI. Access it at
- Swagger UI: `http://localhost:8000/docs`
- ReDoc: `http://localhost:8000/redoc`
## Database
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.