An open API service indexing awesome lists of open source software.

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

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.