Skip to content

Latest commit

 

History

History
89 lines (75 loc) · 3 KB

README.md

File metadata and controls

89 lines (75 loc) · 3 KB

FastAPI Demo Project

This repository follows best practices for clean architecture and component reusability while leveraging the power of FastAPI for building high-performance web applications. We at Fiftyfive Technologies follow the practices defined by SOLID principles and Clean Architecture.

Features

  • High Performance: Built on FastAPI, an asynchronous web framework for fast, modern, and efficient APIs.
  • Scalability: Designed to handle high loads with ease.
  • Readability: Clean architecture with modular components.
  • Extensibility: Easily customizable and expandable.

Tech Stack

  • FastAPI - A modern web framework for high-performance APIs.
  • Pydantic - Data validation and settings management.
  • JWT/OAuth2 - Authentication and authorization.
  • Pytest - Testing framework for unit and integration tests.
  • MongoDb - A NoSQL database solution.

Installation

Prerequisites

Ensure you have the following installed:

  • Python 3+
  • MongoDB (or any supported database)

Steps to Install and Run

  1. Clone the repository:
    git clone https://github.com/your-repo/fastapi-project.git
    cd fastapi-project
  2. Create and activate a virtual environment:
    python -m venv .venv
    source env/bin/activate  # On Windows use `env\Scripts\activate`
  3. Install dependencies:
    pip install -r requirements.txt
  4. Configure the environment variables by creating a .env file:
    MONGO_DB_URI=mongodb://localhost:27017/mydatabase
    MONGO_DB_USER_NAME=username
    MONGO_DB_USER_PASSWORD=pass
    SECRET_KEY=your_secret_key
  5. Start the FastAPI application:
    uvicorn src.main:app --reload

Running the Application

Project Structure

fastapi-project/
├── src/
│   ├── api/               # Application endpoints
│   ├── constants/         # Authentication keys and constants
│   ├── exception/         # Custom exception handling
│   ├── service/           # Bussiness logic
│   ├── model/             # Database schemas and Pydantic models
│   ├── util/              # Helper functions and utilities
│
├── main.py                # Entry point of the application
├── config.py              # configuration and settings
├── requirements.txt       # Python dependencies
├── README.md              # Project documentation
└── .env                   # Environment variables

API Documentation

FastAPI provides interactive API documentation. Once the server is running, visit:

License

55 Tech

We are relentlessly focusing on digital transformation. Dive deep into the customer cases to know more about the project which we delivered.