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:
SECRET_KEY- Any random stringJWT_SECRET_KEY- Any random stringMAIL_USERNAME- Your Gmail addressMAIL_PASSWORD- Gmail app password (get from https://myaccount.google.com/apppasswords)
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 userPOST /api/auth/login- LoginGET /api/cache/time- Cached time examplePOST /api/cache/clear- Clear cachePOST /api/tasks/email- Trigger async emailPOST /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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3dd8ee6a15c491eb9ca8e6d9b920c4e1eabdc6df849e526e73ecbcb35d3519a
|
|
| MD5 |
e8d30285e68b2220a74ad5a5cfb06009
|
|
| BLAKE2b-256 |
17922ce6a26550fb6b99079fb6b6f8586293dea23259f0fa4bdc395b96b674b4
|
File details
Details for the file flask_mvc_starter-1.0.0-py3-none-any.whl.
File metadata
- Download URL: flask_mvc_starter-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8eeff9551fa6fcc9e5c1d28df283e0ffef2b6c335c303658719053e1909f0c
|
|
| MD5 |
12c5cf358a4bc2a82d1ff1987e698bc8
|
|
| BLAKE2b-256 |
d1dfcec4e4a41c8ffe75df5c811b8b6cf345e19ceeeb4b31a12791288eac56a6
|