Metadata-Version: 2.4
Name: zeon
Version: 1.0.1
Summary: A powerful CLI tool to scaffold and manage FastAPI projects with authentication, database migrations, and more
Author-email: Vinyas Bharadwaj <vinyasbharadwaj101@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/vinyasbharadwaj/zeon
Project-URL: Repository, https://github.com/vinyasbharadwaj/zeon
Project-URL: Documentation, https://github.com/vinyasbharadwaj/zeon#readme
Project-URL: Bug Tracker, https://github.com/vinyasbharadwaj/zeon/issues
Keywords: fastapi,cli,scaffolding,web,api,authentication,jwt,sqlalchemy,alembic
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: FastAPI
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: typer>=0.9.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn[standard]>=0.20.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: passlib[bcrypt]>=1.7.4
Requires-Dist: python-jose[cryptography]>=3.3.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic[email]>=2.0.0
Requires-Dist: alembic>=1.12.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: httpx>=0.24.0; extra == "dev"

# Zeon 🧬

**Zeon** is a powerful Python-based CLI tool that instantly scaffolds a complete FastAPI project with built-in authentication, user management, JWT handling, database migrations, and environment-based configuration. It provides a comprehensive set of commands to manage your FastAPI project lifecycle.

---

## ✨ Features

- 🚀 **FastAPI Project Scaffolding** - Generate complete project structure instantly
- 🔐 **JWT Authentication** - Built-in user authentication with OAuth2 and JWT tokens
- 🗄️ **Database Management** - SQLite + SQLAlchemy ORM with pre-configured models
- � **Database Migrations** - Optional Alembic integration for database versioning
- 🛠️ **Router Generation** - Create new API routers with automatic registration
- 📦 **Package Management** - Install packages and update requirements.txt automatically
- 🔒 **Security Utils** - Password hashing with bcrypt
- 🌐 **Environment Configuration** - Secure environment variable management
- 📁 **Organized Structure** - Clean separation of concerns (routers, models, schemas)
- 🐍 **Virtual Environment** - Automatic virtual environment creation and management

---

## 📦 Installation

To install Zeon from [PyPI](https://pypi.org/project/zeon/):

```bash
pip install zeon
```

---

## 🚀 Quick Start

### Initialize a New Project

```bash
zeon init myproject
```

This creates a complete FastAPI project with the following structure:

```
myproject/
├── venv/                    # Virtual environment
├── app/
│   ├── __init__.py
│   ├── main.py             # FastAPI app entry point
│   ├── database.py         # Database configuration
│   ├── models.py           # SQLAlchemy models (User model included)
│   ├── schemas.py          # Pydantic schemas
│   ├── utils.py            # Utility functions (password hashing)
│   ├── oauth2.py           # JWT authentication logic
│   └── routers/
│       ├── __init__.py
│       └── auth.py         # Authentication endpoints
├── alembic/                # Database migrations (optional)
├── alembic.ini            # Alembic configuration (optional)
├── .env                   # Environment variables
├── .gitignore            # Git ignore file
└── requirements.txt      # Python dependencies
```

---

## 📚 Commands

### Project Initialization

```bash
zeon init <project_name>
```
- Creates complete FastAPI project structure
- Sets up virtual environment
- Installs all dependencies
- Optionally configures Alembic for database migrations
- Generates secure environment variables

### Router Management

```bash
zeon routers <router_name> [project_name]
```
- Creates a new router in `app/routers/`
- Automatically adds import and registration to `main.py`
- Includes basic GET endpoint template

Example:
```bash
zeon routers users
# Creates app/routers/users.py and registers it in main.py
```

### Package Management

```bash
zeon add <package_name> [project_name]
```
- Installs package in the project's virtual environment
- Automatically updates `requirements.txt` with all dependencies

Example:
```bash
zeon add redis
# Installs redis and updates requirements.txt
```

### Database Migrations (Alembic)

```bash
# Create migration
zeon makemigrations [message] [project_name]

# Apply migrations
zeon migrate [project_name]
```

Examples:
```bash
zeon makemigrations "Add user profile"
zeon migrate
```

---

## 🔐 Built-in Authentication

Zeon includes a complete authentication system:

### Endpoints
- `POST /auth/register` - User registration
- `POST /auth/login` - User login (returns JWT token)
- `GET /auth/user/{id}` - Get user by ID

### Features
- Password hashing with bcrypt
- JWT token generation and validation
- OAuth2 password flow
- User model with SQLAlchemy
- Pydantic schemas for validation

### Example Usage

```python
# Register a new user
POST /auth/register
{
    "username": "john_doe",
    "email": "john@example.com", 
    "password": "securepassword"
}

# Login
POST /auth/login
Form data: username=john_doe&password=securepassword

# Response
{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
    "token_type": "bearer"
}
```

---

## 🔧 Environment Configuration

Zeon automatically generates a `.env` file with:

```env
SECRET_KEY=<auto-generated-secure-key>
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
```

---

## 🚀 Running Your Project

After creating a project:

```bash
cd myproject

# Activate virtual environment
# Windows
venv\Scripts\activate
# Unix/macOS
source venv/bin/activate

# Run the development server
uvicorn app.main:app --reload
```

Your API will be available at `http://localhost:8000` with automatic documentation at `http://localhost:8000/docs`.

---

## 📋 Requirements

- Python 3.8+
- pip

---

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

---

## 📄 License

This project is licensed under the MIT License.
