# {project_name}

{project_description}

## Setup

### Prerequisites

- Python 3.11 or higher
- pip or poetry for package management

### Installation

1. Clone the repository (or navigate to your project directory)

2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

4. Configure environment variables:
```bash
cp .env.example .env
# Edit .env and update with your configuration
```

5. Initialize the database:
```bash
# Run migrations if using Alembic
alembic upgrade head

# Or for simple setup with SQLite (tables will be created automatically on first run)
```

### Running the Application

Development mode with auto-reload:
```bash
uvicorn main:app --reload
```

Or:
```bash
python main.py
```

The API will be available at:
- Main API: http://localhost:8000
- Interactive docs (Swagger): http://localhost:8000/docs
- Alternative docs (ReDoc): http://localhost:8000/redoc

## Project Structure

```
.
├── main.py                 # Application entry point
├── app/
│   ├── __init__.py
│   ├── core/              # Core utilities
│   │   ├── config.py      # Configuration management
│   │   ├── database.py    # Database setup
│   │   └── __init__.py
│   └── modules/           # Feature modules
│       └── __init__.py
├── requirements.txt       # Python dependencies
├── .env                  # Environment variables (not in git)
├── .gitignore
├── .flake8               # Flake8 linter configuration
├── .pylintrc             # Pylint configuration
├── pyproject.toml        # Project metadata and tool configuration
└── README.md
```

## Adding Modules

This project uses `fastapi-blocks-registry` for modular architecture. To add pre-built modules:

```bash
# List available modules
fastapi-registry list

# Add a module (e.g., auth)
fastapi-registry add auth

# Get module information
fastapi-registry info auth
```

## API Documentation

Once the server is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc

## Development

### Running Tests

```bash
pytest
```

### Code Formatting

```bash
black .
```

### Linting

```bash
ruff check .
```

## Environment Variables

Key environment variables (see `.env` file):

- `PROJECT_NAME`: Application name
- `DATABASE_URL`: Database connection string
- `SECRET_KEY`: Secret key for security (change in production!)
- `CORS_ORIGINS`: Allowed CORS origins (JSON array format: `["http://localhost:3000","http://localhost:5173"]`)
- `CORS_METHODS`: Allowed HTTP methods (JSON array format: `["GET","POST"]` or `["*"]` for all)
- `CORS_HEADERS`: Allowed HTTP headers (JSON array format: `["*"]` for all)
- `ENVIRONMENT`: Environment (development/production)

## License

[Your License Here]

