Skip to main content

A simple Flask boilerplate with MVC architecture, JWT, caching, and Celery

Project description

Flask MVC Starter

A simple Flask boilerplate generator with MVC architecture, JWT authentication, caching, and async tasks.

Installation

pip install flask-mvc-starter

Quick Start

Create a new Flask MVC project:

flask-mvc-starter init myproject
cd myproject

Setup Your Project

1. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

2. Install Dependencies

pip install -r requirements.txt

3. Install Redis

Linux (Ubuntu/Debian):

sudo apt-get update
sudo apt-get install redis-server
sudo systemctl start redis

macOS:

brew install redis
brew services start redis

Windows: Download from https://redis.io/download

4. Setup Environment

cp .env.example .env

Edit .env and set:

5. Run the Application

Start Flask server:

python run.py

Terminal 2 - Celery Worker:

celery -A tasks worker --loglevel=info

Terminal 3 - Celery Beat (for scheduled tasks):

celery -A tasks beat --loglevel=info

API Endpoints

  • POST /api/auth/register - Register user
  • POST /api/auth/login - Login
  • GET /api/cache/time - Cached time example
  • POST /api/cache/clear - Clear cache
  • POST /api/tasks/email - Trigger async email
  • POST /api/tasks/async - Trigger async job

Scheduled Tasks

Daily reminder email sent to all users at 8 AM (runs automatically when Celery Beat is running).

Features

  • MVC architecture (Models, Controllers, Utils)
  • Flask-RESTful API endpoints
  • JWT authentication
  • SQLAlchemy ORM
  • Redis caching
  • Celery async tasks
  • Scheduled tasks (Celery Beat)
  • Flask-Mail integration

Notes

  • Redis must be running for caching and Celery
  • All three terminals (Flask, Worker, Beat) need to be running
  • Database: SQLite (app.db)

Development

To contribute or modify this package:

git clone <repository-url>
cd flask-mvc-starter
pip install -e .

License

MIT License

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

flask_mvc_starter-1.0.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

flask_mvc_starter-1.0.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file flask_mvc_starter-1.0.0.tar.gz.

File metadata

  • Download URL: flask_mvc_starter-1.0.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for flask_mvc_starter-1.0.0.tar.gz
Algorithm Hash digest
SHA256 f3dd8ee6a15c491eb9ca8e6d9b920c4e1eabdc6df849e526e73ecbcb35d3519a
MD5 e8d30285e68b2220a74ad5a5cfb06009
BLAKE2b-256 17922ce6a26550fb6b99079fb6b6f8586293dea23259f0fa4bdc395b96b674b4

See more details on using hashes here.

File details

Details for the file flask_mvc_starter-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flask_mvc_starter-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e8eeff9551fa6fcc9e5c1d28df283e0ffef2b6c335c303658719053e1909f0c
MD5 12c5cf358a4bc2a82d1ff1987e698bc8
BLAKE2b-256 d1dfcec4e4a41c8ffe75df5c811b8b6cf345e19ceeeb4b31a12791288eac56a6

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