šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

zeon

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zeon

A powerful CLI tool to scaffold and manage FastAPI projects with authentication, database migrations, and more

1.0.0
PyPI
Maintainers
1

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:

pip install zeon

šŸš€ Quick Start

Initialize a New Project

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

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

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:

zeon routers users
# Creates app/routers/users.py and registers it in main.py

Package Management

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

Example:

zeon add redis
# Installs redis and updates requirements.txt

Database Migrations (Alembic)

# Create migration
zeon makemigrations [message] [project_name]

# Apply migrations
zeon migrate [project_name]

Examples:

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

# 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:

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

šŸš€ Running Your Project

After creating a project:

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.

Keywords

fastapi

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts