https://github.com/lucho00cuba/sample-api
A FastAPI-based REST API with JWT authentication and automatic route loading.
https://github.com/lucho00cuba/sample-api
api-rest fastapi python3
Last synced: 2 months ago
JSON representation
A FastAPI-based REST API with JWT authentication and automatic route loading.
- Host: GitHub
- URL: https://github.com/lucho00cuba/sample-api
- Owner: Lucho00Cuba
- License: mit
- Created: 2025-03-22T23:35:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-23T00:57:48.000Z (over 1 year ago)
- Last Synced: 2025-03-23T01:28:55.975Z (over 1 year ago)
- Topics: api-rest, fastapi, python3
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sample API FastAPI


This is a sample API built with FastAPI and Authentication and Authorization using JWT.
## Requirements
- DevContainers (VSCode)
- Python 3.12
- Docker
## Setup
1. Clone the repository
```bash
git clone https://github.com/Lucho00Cuba/sample-api.git
cd sample-api
```
2.a. **Using DevContainers (Recommended)**
- VSCode should prompt you to open the project in a DevContainer. The necessary environment will be set up automatically.
2.b. **Without DevContainers**
- Create a virtual environment:
```
python3 -m venv venv
```
- Activate the virtual environment:
**On Linux/MacOS:**
```
source venv/bin/activate
```
**On Windows:**
```
.\venv\Scripts\activate
```
- Install dependencies:
```
pip install -r requirements.txt
```
- Run the API:
```bash
API_IS_DEV=true src/entrypoint.sh
```
## Features
- 🔐 Authorization and Authentication using JWT
- 🔄 Automatic loading routes from the `src/routes` folder
- 📝 Manually set an endpoint if needed
- 📊 Custom response formatting for consistent API responses
- 📑 Swagger and Redoc auto-generated API documentation
- 📦 Docker support
## TODO
- [ ] ✅ Improve unit and integration test coverage
- [ ] 🔗 Integrate with a third-party user system such as Rancher-Manager (Local)
- [ ] 🚀 Implement rate-limiting to prevent abuse
- [ ] 🔄 Implement a refresh token mechanism for better security
- [ ] 📂 Improve database handling, possibly integrating SQLAlchemy or another ORM