Skip to content

lymanny/FastAPI-CRUD-Todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ‰ FastAPI CRUD Todo with SQLite

Overview πŸ“š

This project is a simple FastAPI application that demonstrates CRUD (Create, Read, Update, Delete) operations using an SQLite database. It's perfect for beginners who want to learn how to build web APIs with FastAPI, Python, and SQLAlchemy.

Features πŸ”‘

  • CRUD Operations: Easily create, read, update, and delete Todo items using FastAPI endpoints.
  • SQLite Database: Lightweight and easy-to-set-up database solution.
  • Interactive API Documentation: Automatically generated with FastAPI and accessible via /docs.
  • Modular Structure: Clean and modular project structure using routers, models, and schemas.

Requirements πŸ“‹

  • Python 3.7+
  • FastAPI
  • Uvicorn
  • SQLAlchemy
  • Pydantic

Installation πŸ“

  1. Clone the repository:

    git clone https://github.com/lymanny/FastAPI-CRUD-Todo.git
  2. Navigate into the project directory:

    cd FastAPI-CRUD-Todo

Create a Virtual Environment & Activate It πŸ’»

Before running the project, it's best to use a virtual environment to manage dependencies.

  1. Create a virtual environment:

    python -m venv env
  2. Activate the virtual environment:

    • On macOS/Linux:

      source env/bin/activate
    • On Windows:

      .\env\Scripts\activate
  3. Install the project dependencies:

    pip install -r requirements.txt

Usage πŸš€

  1. Start the FastAPI application:

    uvicorn main:app --reload
  2. Open your browser and navigate to http://127.0.0.1:8000/docs to access the interactive API documentation.

API Documentation Screenshot

Here’s an example of the interactive documentation generated by FastAPI:

FastAPI Documentation

Project Structure πŸ“‚

FastAPI-CRUD-Todo/
β”œβ”€β”€ database.py              # Database setup and connection
β”œβ”€β”€ models.py                # SQLAlchemy models
β”œβ”€β”€ schemas.py               # Pydantic schemas for validation
β”œβ”€β”€ routers/
β”‚   └── todo.py              # API endpoints for CRUD operations
β”œβ”€β”€ main.py                  # Entry point for the FastAPI app
β”œβ”€β”€ requirements.txt         # List of dependencies
└── README.md                # Project documentation

Contributing 🀝

Contributions are welcome! Please feel free to submit issues, fork the repository, and create pull requests.

License πŸ“„

This project is licensed under the MIT License.

Author πŸ‘©β€πŸ’»

lymanny - iOS Developer
🌐 Portfolio

About

🐍 A basic FastAPI demonstrating CRUD operations with SQLite.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages