DEV Community

Cover image for My project 7 : Todo Pro (with Flask)
Sabin Sim
Sabin Sim

Posted on

My project 7 : Todo Pro (with Flask)

πŸ—‚οΈ Building β€œTodo Pro” β€” My First Flask Project Using Blueprints

Based on everything I studied earlier, I wanted to build a more detailed and scalable version of a Todo application. This project is still in its early stage, but the architecture is now prepared for real features such as authentication, database integration, and service layers.

With this project, I’m finishing my Flask learning journey β€” and next, I will move on to **FastAPI** to understand modern, async-friendly API development. I think comparing Flask and FastAPI side-by-side will help me understand backend architecture more clearly.


🧱 1. Project Overview

This project focuses on creating a clean, modular Flask structure using Blueprints.

What this minimal version demonstrates:

  • Application Factory Pattern (create_app())
  • Clean routing separation with Blueprints
  • Independent template folders per module
  • URL prefix structure (e.g., /todos, /auth)
  • A scalable foundation for real features

Even though the app is simple now, the architecture is ready to grow.


πŸ“‚ 2. Project Structure


todo_pro/
β”‚
β”œβ”€β”€ app.py
β”‚
β”œβ”€β”€ auth/
β”‚   β”œβ”€β”€ routes.py
β”‚   └── templates/
β”‚        └── auth/
β”‚            └── login.html
β”‚
└── todo/
    β”œβ”€β”€ routes.py
    └── templates/
         └── todo/
             └── index.html

Enter fullscreen mode Exit fullscreen mode

A clean and realistic folder layout β€” just like real production Flask apps.


πŸ–₯️ 3. app.py β€” Application Factory + Blueprint Registration

from flask import Flask
from todo.routes import todo_bp
from auth.routes import auth_bp

def create_app():
    app = Flask(__name__)
    app.config['SECRET_KEY'] = "sabin_secret"

    # Register Blueprints
    app.register_blueprint(todo_bp, url_prefix="/todos")
    app.register_blueprint(auth_bp, url_prefix="/auth")

    return app

app = create_app()

if __name__ == "__main__":
    app.run(debug=True)
Enter fullscreen mode Exit fullscreen mode

πŸ” 4. Auth Blueprint β€” auth/routes.py

from flask import Blueprint, render_template

auth_bp = Blueprint("auth", __name__, template_folder="templates")

@auth_bp.route("/login")
def login():
    return render_template("auth/login.html")
Enter fullscreen mode Exit fullscreen mode

auth/templates/auth/login.html

<h1>Login Page</h1>
<p>Login functionality will be implemented here.</p>
Enter fullscreen mode Exit fullscreen mode

πŸ“ 5. Todo Blueprint β€” todo/routes.py

from flask import Blueprint, render_template

todo_bp = Blueprint("todo", __name__, template_folder="templates")

@todo_bp.route("/")
def index():
    return render_template("todo/index.html")
Enter fullscreen mode Exit fullscreen mode

todo/templates/todo/index.html

<h1>Todo Pro Home</h1>
<p>Todo Pro features will be added here.</p>
Enter fullscreen mode Exit fullscreen mode

πŸš€ 6. How to Run

Install dependencies:

pip install flask
Enter fullscreen mode Exit fullscreen mode

Run the project:

python app.py
Enter fullscreen mode Exit fullscreen mode

Open in browser:

http://127.0.0.1:5000/todos
http://127.0.0.1:5000/auth/login
Enter fullscreen mode Exit fullscreen mode

πŸ“š 7. What I Learned

  • How to structure a real Flask application
  • How Blueprints separate responsibilities
  • How to prepare an app for authentication and database layers
  • Why scaling requires modular architecture
  • How Flask project architecture influences FastAPI later

Even a minimal setup teaches a lot when the folder structure is correct.


πŸ“Œ 8. Future Improvements (Beginner-Friendly Tasks)

Here are simple tasks you can try if you want to extend this project:

  • Add a real login system
  • Add a signup page
  • Connect SQLite with SQLAlchemy
  • Build full CRUD for Todo items
  • Add session management for logged-in users
  • Add a clean UI using TailwindCSS

These are perfect next steps on the journey to becoming a full-stack developer.


Step by step, project by project β€” that’s how I’m learning backend development. Now that the Flask foundation is complete, it’s time to move on to FastAPI.

Top comments (0)