Skip to main content

A CLI tool for Flaskion โ€” a lightweight MVC micro-framework built on Flask

Project description

Flaskion

Flaskion is a lightweight MVC micro-framework for Flask, providing developers with a structured foundation for scalable, maintainable applications. Inspired by Laravel, Flaskion introduces clean architecture, modular scaffolding, and a developer-first CLI to streamline your Flask workflow.


๐Ÿš€ Features

โœ… MVC Architecture โ€“ Clean separation of controllers, models, and templates
โœ… Built-in CLI โ€“ Scaffold full resources, controllers, models, and authentication with ease
โœ… Web & API Routing โ€“ Clean route structure split between HTML and JSON endpoints
โœ… DB Choice at Setup โ€“ Use SQLite, MySQL, or Postgres with built-in .env generation
โœ… Flask-Migrate Ready โ€“ Migrations are set up and ready to run on first build
โœ… Authentication Scaffolding โ€“ Generate full auth (login/register/logout/dashboard) with one command


๐Ÿ“ Project Structure

flaskion/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ __init__.py           # Application factory
โ”‚   โ”œโ”€โ”€ routes/               # Web + API routes
โ”‚   โ”‚   โ”œโ”€โ”€ web_routes.py
โ”‚   โ”‚   โ””โ”€โ”€ api_routes.py
โ”‚   โ”œโ”€โ”€ controllers/          # View logic
โ”‚   โ”œโ”€โ”€ models/               # SQLAlchemy models
โ”‚   โ”œโ”€โ”€ schemas/              # Marshmallow schemas
โ”‚   โ”œโ”€โ”€ templates/            # Jinja2 templates
โ”‚   โ”œโ”€โ”€ static/               # CSS, JS, images
โ”‚   โ””โ”€โ”€ config.py             # App configuration
โ”œโ”€โ”€ migrations/               # Auto-generated with Flask-Migrate
โ”œโ”€โ”€ run.py                    # Entry point
โ”œโ”€โ”€ requirements.txt          # Dependencies
โ”œโ”€โ”€ .env.example              # Example environment file
โ””โ”€โ”€ README.md                 # This doc

๐Ÿงช Installation & Setup

1. Install the CLI

pipx install flaskion-cli
# or
pip install flaskion-cli

2. Create a New Project

flaskion make:new myproject --db=sqlite     # Or --db=mysql / --db=postgres

3. Enter the project & activate venv

cd myproject
source venv/bin/activate

โš™๏ธ CLI Commands

Command Description
flaskion make:new <name> Create a new project scaffold
flaskion make:model Create a SQLAlchemy model
flaskion make:schema Create a Marshmallow schema
flaskion make:controller Create a controller with CRUD methods
flaskion make:resource Generate model + controller + schema + routes
flaskion make:auth Generate full login/register/logout system

Add --api to make:resource for API route generation instead of web views.


๐Ÿ›ฃ๏ธ Managing Routes

Flaskion separates routes for HTML views and API endpoints:

  • Web Routes: app/routes/web_routes.py
  • API Routes: app/routes/api_routes.py

Both are registered in app/__init__.py:

from app.routes.api_routes import api_routes
from app.routes.web_routes import web_routes

def register_routes(app):
    app.register_blueprint(api_routes)
    app.register_blueprint(web_routes)

๐Ÿงฌ Database Migrations

Flaskion uses Flask-Migrate out of the box:

flask db init
flask db migrate -m "Initial"
flask db upgrade

๐Ÿ” Authentication

Generate full login/register/logout and dashboard flow:

flaskion make:auth
  • HTML templates auto-created under templates/auth/
  • Session-based login using Flask sessions
  • Routes for /login, /register, /dashboard, and /logout

โ–ถ๏ธ Running the App

flask run

Then visit: http://127.0.0.1:5000


๐Ÿ“š Documentation

Coming soon at: https://flaskion.dev (in progress)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flaskion_cli-1.0.9.1.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flaskion_cli-1.0.9.1-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

Details for the file flaskion_cli-1.0.9.1.tar.gz.

File metadata

  • Download URL: flaskion_cli-1.0.9.1.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for flaskion_cli-1.0.9.1.tar.gz
Algorithm Hash digest
SHA256 f38181a2f4f053a71deaca67d4a93298bef01be90f12bf62d4650d9da2a727ad
MD5 4197660f4b3714bd4b202ec4fc8edc31
BLAKE2b-256 89bac2eef4ba8e1b6d0a2cf87e9c5923ce3e0207c04979b4a7c1dfd9b8e91556

See more details on using hashes here.

File details

Details for the file flaskion_cli-1.0.9.1-py3-none-any.whl.

File metadata

  • Download URL: flaskion_cli-1.0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for flaskion_cli-1.0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7ddcd9b82110e3ea2cfe48ee4b5e3f873f2821b0bce4a72f9f8e39368621f4
MD5 d52408e8cdf39a2b064ec35a27bbeef6
BLAKE2b-256 d6e664beac022110fc2aac79e3ee6f30f9a65f8d23ee551d2e8ed9dab9c27adf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page