Metadata-Version: 2.4
Name: fastapi-server-kit
Version: 0.1.0
Summary: A production-grade FastAPI template with support for PostgreSQL, SQLite, and MySQL.
Author-email: atnatewoshw <icodeyt21@gmail.com>
License: MIT
Keywords: fastapi,starter-template,postgresql,mysql,sqlite,asyncio
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: aiomysql>=0.3.2
Requires-Dist: asyncpg>=0.31.0
Requires-Dist: fastapi[standard]>=0.129.2
Requires-Dist: pydantic-settings>=2.13.1
Requires-Dist: pytest>=9.0.2
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: sqlalchemy>=2.0.46

# FastAPI Server Kit

A production-grade FastAPI template and toolkit with support for PostgreSQL (Sync/Async), SQLite (Async), and MySQL (Async). Built for speed, scalability, and clean architecture.

## 🚀 Features

- **Multi-Database Support**: Easily switch between SQLite, PostgreSQL, and MySQL.
- **SQLAlchemy 2.0 (Async)**: Modern ORM patterns with centralized session management.
- **Clean Architecture**: Organized into Core, Models, Repositories, Services, and Routers.
- **Alembic Migrations**: Ready-to-use async migration setup.
- **Environment Management**: Robust configuration using `pydantic-settings`.

## 📦 Installation

You can install `fastapi-server-kit` using `uv` (recommended) or `pip`:

```bash
uv add fastapi-server-kit
# or
pip install fastapi-server-kit
```

## 🛠️ Quick Start (CLI)

The easiest way to start a new project is to use the built-in CLI tool:

```bash
# Initialize a new server folder in your current directory
fastapi-server-kit
```

This will create a `server/` directory with the complete production-ready structure.

## 🛠️ Manual Setup
If you prefer to clone the repository or use it as a template:

```bash
git clone https://github.com/atnatewoshw/fastapi-starter-template
cd fastapi-starter-template/server
```

### 2. Configure Environment
Create and configure your `.env` file from `.env_example`:

```bash
cp .env_example .env
```

### 3. Install Dependencies
```bash
uv sync
```

### 4. Running Locally
```bash
uv run uvicorn fastapi_server_kit.server.app.main:app --reload
```

## 📂 Project Structure

The kit follows a structured directory layout within the `server` package:

```text
fastapi_server_kit/
└── server/
    └── app/
        ├── core/          # Configuration and security
        ├── models/        # SQLAlchemy models
        ├── repositories/  # Data access layer
        ├── routers/       # API endpoints
        ├── schemas/       # Pydantic models
        └── services/      # Business logic
```

## 🗄️ Database Migrations

Initialize your database:
```bash
uv run alembic upgrade head
```

Create a new migration:
```bash
uv run alembic revision --autogenerate -m "description"
```

## 📜 License

This project is licensed under the MIT License.
