A demo on FastAPI: Fast and Modern API Development.
This project is a sample Python FastAPI application that demonstrates:
- Basic API Endpoints: GET and POST requests.
- Dependency Injection: Cleaner and modular code.
- Background Tasks: Non-blocking operations for improved performance.
- Fast and Efficient: Leverages FastAPI’s asynchronous capabilities.
- Automatic Documentation: Swagger UI and ReDoc are generated automatically.
- Type-Checked Validation: Uses Pydantic models for data validation.
- Modular Design: Easily extendable for larger projects.
- Python 3.10+
- FastAPI
- Uvicorn
- Clone the repository:
git clone https://github.com/wallaceespindola/python-fastapi-demo.git
cd python-fastapi-demo
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
Start the application with:
uvicorn app.main:app --reload
Open your browser at http://127.0.0.1:8000 to see the API in action.
The interactive API documentation can be checked out at:
- Swagger: http://127.0.0.1:8000/docs
- Redoc: http://127.0.0.1:8000/redoc
- Wallace Espindola, Sr. Software Engineer / Java & Python Dev
- LinkedIn: linkedin.com/in/wallaceespindola/
- GitHub: github.com/wallaceespindola
- E-mail: [email protected]
- Twitter: @wsespindola
- Gravatar: gravatar.com/wallacese
- Dev Community: dev.to/wallaceespindola
- DZone Articles: DZone Profile
- Pulse Articles: LinkedIn Articles
- Website: W-Tech IT Solutions
- Presentation Slides: Speakerdeck
- This project is released under the Apache 2.0 License.
- See the LICENSE file for details.
- Copyright © 2025 Wallace Espindola.