This is a comprehensive FastAPI project template with robust authentication, database configuration, and scalable architecture.
- Async SQLAlchemy with PostgreSQL
- JWT Authentication
- Dependency Injection
- Environment Configuration
- Comprehensive Error Handling
- Modular Project Structure
- Python 3.10+
- PostgreSQL
- Poetry or pip
- Clone the repository
git clone https://your-repo-url.git
cd fastapi-project
- Create Virtual Environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
- Install Dependencies
pip install -r requirements.txt
- Set up Environment Variables
- Copy
.env.example
to.env
- Fill in your configuration details
- Database Setup
# Create database
createdb fastapi_db
# Run migrations
alembic upgrade head
- Run Application
uvicorn app.main:app --reload
pytest
app/
: Main application codetests/
: Test suitemigrations/
: Database migrations
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.