Update README with enhanced documentation and schema details
This commit is contained in:
parent
db9aa8e5e2
commit
4f8a38ad51
40
README.md
40
README.md
@ -1,6 +1,6 @@
|
|||||||
# FastAPI Todo API
|
# FastAPI Todo API
|
||||||
|
|
||||||
This is a simple Todo API built with FastAPI and SQLite.
|
A robust Todo API built with FastAPI and SQLite for efficient task management.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@ -8,19 +8,25 @@ This is a simple Todo API built with FastAPI and SQLite.
|
|||||||
- SQLite database with SQLAlchemy ORM
|
- SQLite database with SQLAlchemy ORM
|
||||||
- Alembic for database migrations
|
- Alembic for database migrations
|
||||||
- Health check endpoint
|
- Health check endpoint
|
||||||
|
- Input validation with Pydantic
|
||||||
|
- Automatic API documentation
|
||||||
|
- Fast and efficient database operations
|
||||||
|
|
||||||
## Project Structure
|
## Project Structure
|
||||||
|
|
||||||
```
|
```
|
||||||
.
|
.
|
||||||
├── alembic/ # Database migration files
|
├── alembic/ # Database migration files
|
||||||
|
│ └── versions/ # Migration version scripts
|
||||||
├── app/ # Application code
|
├── app/ # Application code
|
||||||
│ ├── api/ # API endpoints
|
│ ├── api/ # API endpoints
|
||||||
|
│ │ └── endpoints/ # Route handlers
|
||||||
│ ├── core/ # Core functionality and config
|
│ ├── core/ # Core functionality and config
|
||||||
│ ├── crud/ # CRUD operations
|
│ ├── crud/ # CRUD operations
|
||||||
│ ├── db/ # Database setup
|
│ ├── db/ # Database setup
|
||||||
│ ├── models/ # SQLAlchemy models
|
│ ├── models/ # SQLAlchemy models
|
||||||
│ └── schemas/ # Pydantic schemas
|
│ ├── schemas/ # Pydantic schemas
|
||||||
|
│ └── storage/ # Database storage
|
||||||
├── alembic.ini # Alembic configuration
|
├── alembic.ini # Alembic configuration
|
||||||
├── main.py # Application entry point
|
├── main.py # Application entry point
|
||||||
└── requirements.txt # Project dependencies
|
└── requirements.txt # Project dependencies
|
||||||
@ -44,16 +50,42 @@ This is a simple Todo API built with FastAPI and SQLite.
|
|||||||
|
|
||||||
## API Documentation
|
## API Documentation
|
||||||
|
|
||||||
Once the server is running, you can access the API documentation at:
|
Once the server is running, you can access the interactive API documentation at:
|
||||||
|
|
||||||
- Swagger UI: http://localhost:8000/docs
|
- Swagger UI: http://localhost:8000/docs
|
||||||
- ReDoc: http://localhost:8000/redoc
|
- ReDoc: http://localhost:8000/redoc
|
||||||
|
|
||||||
## API Endpoints
|
## API Endpoints
|
||||||
|
|
||||||
|
### Todo Operations
|
||||||
- `GET /api/v1/todos/`: Get all todos
|
- `GET /api/v1/todos/`: Get all todos
|
||||||
- `POST /api/v1/todos/`: Create a new todo
|
- `POST /api/v1/todos/`: Create a new todo
|
||||||
- `GET /api/v1/todos/{todo_id}`: Get a specific todo by ID
|
- `GET /api/v1/todos/{todo_id}`: Get a specific todo by ID
|
||||||
- `PUT /api/v1/todos/{todo_id}`: Update a specific todo
|
- `PUT /api/v1/todos/{todo_id}`: Update a specific todo
|
||||||
- `DELETE /api/v1/todos/{todo_id}`: Delete a specific todo
|
- `DELETE /api/v1/todos/{todo_id}`: Delete a specific todo
|
||||||
- `GET /health`: Health check endpoint
|
|
||||||
|
### System Endpoints
|
||||||
|
- `GET /health`: Health check endpoint to verify API status
|
||||||
|
|
||||||
|
## Todo Schema
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"title": "Complete project",
|
||||||
|
"description": "Finish the FastAPI project by Friday",
|
||||||
|
"completed": false
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
The API uses SQLAlchemy for ORM operations and Alembic for database migrations. The database file is stored in `app/storage/db/db.sqlite`.
|
||||||
|
|
||||||
|
## Technologies
|
||||||
|
|
||||||
|
- **FastAPI**: Modern, fast web framework for building APIs
|
||||||
|
- **SQLAlchemy**: SQL toolkit and ORM
|
||||||
|
- **Pydantic**: Data validation and settings management
|
||||||
|
- **Alembic**: Database migration tool
|
||||||
|
- **SQLite**: Lightweight disk-based database
|
Loading…
x
Reference in New Issue
Block a user