Skip to content

unhejing/fastapi-project-init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Project

A modern FastAPI application with a clean architecture.

Project Structure

fastapi_project/
├── app/
│   ├── __init__.py
│   ├── main.py           # FastAPI application entry point
│   ├── core/             # Core functionality and settings
│   │   ├── __init__.py
│   │   └── config.py     # Application configuration
│   ├── routers/          # API route handlers
│   │   ├── __init__.py
│   │   ├── users.py      # User endpoints
│   │   └── items.py      # Item endpoints
│   ├── models/           # Database models
│   ├── schemas/          # Pydantic models
│   └── services/         # Business logic
├── tests/                # Test files
├── requirements.txt      # Python dependencies
├── .env.example         # Environment variables example
└── README.md

Installation

  1. Create a virtual environment:
conda create -n deepflow_openapi python=3.11 -y
conda activate deepflow_openapi
pip install -r requirements.txt
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy the environment variables:
cp .env.example .env
  1. Run the application:
uvicorn app.main:app --reload

The API will be available at http://localhost:8000

API Documentation

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Available Endpoints

Health Check

  • GET /healthCheck - Health check endpoint

Development

To run tests:

pytest

License

MIT

About

fastapi初始化项目

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages