Skip to content

pheonix-coder/flask-minimal-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Starter Template

Welcome to the Flask Starter Template! This template provides a solid starting point for building a Flask web application with authentication, database integration, templating, and minimal styling using Matcha CSS.

What is This Template?

This template includes basic features that every Flask developer needs when starting a new project. It offers:

  • Authentication system (signup, login, logout)
  • Database integration with SQLAlchemy
  • Templating with Jinja2
  • Minimal styling using Matcha CSS
  • Protected routes accessible only after login

You can quickly build upon this structure and add more features as needed!

Technologies Used

  • Flask: A lightweight WSGI web application framework in Python.
  • SQLAlchemy: SQL toolkit and Object-Relational Mapping (ORM) for Python.
  • Flask-Migrate: Extension that handles SQLAlchemy database migrations via Alembic.
  • Matcha CSS: A Drop-in semantic styling library in pure CSS. Learn more about Matcha CSS here.

For a detailed breakdown of this template, check out this video by NeuralNine.

Routes

Route Description
/ Landing page
/signup Sign up for a new account
/login Log into an existing account
/logout Log out of the current session
/protected A protected page accessible after login

Running Instructions

To run this template locally, follow these steps:

  1. Clone the Repository

    git clone <repository_url>
    cd flask_template
  2. Create and Activate a Virtual Environment

    python -m venv .venv
    source .venv/bin/activate  # On Windows, use .venv\Scripts\activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Set Up the Database Initialize, migrate, and upgrade the database.

    flask db init
    flask db migrate
    flask db upgrade
  5. Run the Application

    python run.py

Database Migrations

Any time you make changes to the models, ensure you follow these steps to migrate and apply changes to the database:

flask db migrate
flask db upgrade

Contributing

If you find this template useful, give it a ⭐ on GitHub!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published