This is a simple api with an auth implementation built with FastAPI.
This project is built with FastAPI and is organized for scalability and maintainability.
- Modular structure for routes, middlewares, and utilities
- Environment-based configuration
- Virtual environment for dependency isolation
.env # Environment variables
requirements.txt # Python dependencies
src/
main.py # Application entry point
routes.py # API route definitions
config/ # Configuration files
constants/ # Constant values
middlewares/ # Custom middlewares
modules/ # Application modules
utils/ # Utility functions
-
Clone the repository:
git clone https://github.com/benkwash/simple_python_auth_fastapi.git cd simple_python_auth_fastapi -
Create and activate a virtual environment:
python3 -m venv env source env/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
- Copy
.env.exampleto.envand update values as needed.
- Copy
-
Run the application locally:
uvicorn src.main:app --reload
- Access the API at
http://localhost:8000 - Interactive API docs available at
http://localhost:8000/docs