Skip to content

XYFORA/XYFORA-FastAPI-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XYFORA Fast API App Boilerplate

👤 Author

AHMED SALEEM SHAIKH | Co-Founder Of XYFORA AB

A lightweight and scalable starter template for building modern REST APIs using FastAPI, SQLAlchemy, and PostgreSQL. Designed with a clean project structure and best practices, it helps developers quickly set up production-ready backend applications with minimal configuration.


✨ Features

  • ⚡ FastAPI-powered high-performance APIs
  • 🗄️ SQLAlchemy ORM integration
  • 🐘 PostgreSQL database support
  • ✅ Pydantic request validation
  • 🌐 CORS middleware configuration
  • 🔒 Centralized exception handling
  • 📁 Modular and scalable folder structure
  • 🔧 Environment variable management with python-dotenv
  • 📚 Automatic Swagger & ReDoc API documentation
  • 🚀 Ready for authentication and authorization implementation

📦 Requirements

  • Python 3.10+
  • PostgreSQL

🛠️ Installation

Clone the Repository

git clone https://github.com/XYFORA/XYFORA-Fast-API-Boilerplate.git

cd xyfora-fast-api-boilerplate

Create Virtual Environment

uv venv

Windows

.venv\Scripts\activate

Linux / macOS

source .venv/bin/activate

Install Dependencies

uv pip install -r requirements.txt

📄 Environment Variables

Create a .env file in the project root:

DATABASE_URL=postgresql+psycopg2://postgres:password@localhost:5432/database_name

▶️ Run the Application

uvicorn main:app --reload

The API will be available at:

http://127.0.0.1:8000

📚 API Documentation

Swagger UI

http://127.0.0.1:8000/docs

📂 Project Structure

.
├── src
│   ├── config
│   │   └── db.py
│   ├── models
│   ├── routes
│   ├── schemas
│   └── app.py
├── .env
├── main.py
├── requirements.txt
└── README.md

📋 Dependencies

python-dotenv
fastapi
uvicorn
sqlalchemy
psycopg2-binary

About

XYFORA FastAPI App Boilerplate is a lightweight, scalable starter template for building REST APIs with FastAPI, SQLAlchemy, and PostgreSQL, featuring a clean architecture, best practices, and production-ready project structure.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages