An asynchronous REST API built with FastAPI and MySQL as the database backend. This API provides CRUD operations for users and ensures high-performance, asynchronous database interactions.
- ⚡ Fully asynchronous API using FastAPI
- 🔗 Integration with MySQL using SQLAlchemy
- 🌐 RESTful API for User CRUD operations
-
Clone the repository:
git clone https://github.com/rahulkumar-fullstack/async-fastapi-mysql-api.git cd async-fastapi-mysql-api
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # Unix .\venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Start the FastAPI application:
uvicorn app.main:app --reload
-
Access the API at
http://127.0.0.1:8000
- Create User:
POST /api/v1/users/
- Get User:
GET /api/v1/users/{user_id}
- Update User:
PUT /api/v1/users/{user_id}
- Delete User:
DELETE /api/v1/users/{user_id}
- List Users:
GET /api/v1/users/
- 🐍 Python: The programming language used.
- 🔧 FastAPI: A modern web framework for building APIs.
- 🌱 MySQL: Database system used for storage.
- 🏗️ SQLAlchemy: ORM tool for managing the database interactions.
- 🚘 Asyncmy: Async MySQL driver