48 lines
1.6 KiB
Markdown
48 lines
1.6 KiB
Markdown
# REST API Service
|
|
|
|
A FastAPI-based REST API service.
|
|
|
|
## Project Structure
|
|
|
|
```
|
|
/projects/restapiservice-12nbts/
|
|
├── alembic.ini # Alembic configuration
|
|
├── app # Application package
|
|
│ ├── api # API endpoints
|
|
│ │ └── endpoints # Route handlers
|
|
│ ├── core # Core modules
|
|
│ │ └── config.py # Application settings
|
|
│ ├── db # Database modules
|
|
│ │ ├── base.py # Import all models for Alembic
|
|
│ │ ├── base_class.py # SQLAlchemy Base class
|
|
│ │ └── session.py # Database session management
|
|
│ ├── models # SQLAlchemy models
|
|
│ ├── schemas # Pydantic schemas for request/response
|
|
│ └── services # Business logic
|
|
├── main.py # Application entry point
|
|
├── migrations # Alembic migrations
|
|
│ └── versions # Migration scripts
|
|
├── requirements.txt # Project dependencies
|
|
└── tests # Test modules
|
|
```
|
|
|
|
## Getting Started
|
|
|
|
1. Clone the repository
|
|
2. Install dependencies:
|
|
```
|
|
pip install -r requirements.txt
|
|
```
|
|
3. Run the application:
|
|
```
|
|
uvicorn main:app --reload
|
|
```
|
|
|
|
## API Documentation
|
|
|
|
- Swagger UI: [http://localhost:8000/docs](http://localhost:8000/docs)
|
|
- ReDoc: [http://localhost:8000/redoc](http://localhost:8000/redoc)
|
|
|
|
## Health Check
|
|
|
|
- GET `/health`: Returns a health status of the application |