This is a simple Flask-based web application with user authentication functionality, including login and registration features. Below is the updated project structure and a brief overview of its components.
Demo-Flask-Website-WebApp-Project/
│
├── .venv/ # Virtual environment for the project
│
├── instance/ # Instance folder for SQLite3 database
│ └── users.db # SQLite3 database file for storing user data
│
├── static/
│ └── style.css # CSS file for styling
│
├── templates/ # HTML templates
│ ├── home.html # Home page
│ ├── login.html # Login page
│ └── register.html # Registration page
│
├── app.py # Main Flask application
├── README.md # Project documentation
└── requirements.txt # List of Python dependencies
The main Flask application includes routes for:
- Home (
/
) - Login (
/login
) - Register (
/register
)
- User authentication using Flask and SQLAlchemy.
- Database initialization for user management.
- Flash messages for form validation feedback.
-
Clone the repository:
git clone https://github.com/GDG-Biet/Demo-Flask-Website-WebApp-Project.git cd Demo-Flask-Website-WebApp-Project
-
Set up a virtual environment:
python -m venv .venv source .venv/bin/activate # For Linux/Mac .venv\Scripts\activate # For Windows
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask app:
python app.py
-
Open your browser and visit
http://127.0.0.1:5000
.
- The
users.db
file in theinstance/
directory is an SQLite database used to store user registration data. - If the file does not exist, it will be created automatically when the application is run for the first time.
- Contains a list of Python dependencies required to run the project:
Flask SQLAlchemy
To install the dependencies:
pip install -r requirements.txt
- Flask: Web framework for Python.
- SQLAlchemy: ORM for database management.
- HTML/CSS: Frontend templates and styling.
- SQLite: Lightweight database for user data storage.
- HTML - For structuring the web pages.
- CSS - For styling and layout (basic styles provided in
style.css
).
- Flask - Lightweight Python web framework for building web applications.
- SQLAlchemy - Object-Relational Mapping (ORM) tool for database interactions.
- SQLite - Lightweight and embedded database for managing user authentication data.
- Flask Development Server - Built-in development server for running and testing the application.
- Python - The programming language used for backend development.
- Virtual Environment (
venv
) - For managing Python dependencies locally without affecting the global environment.
- Frontend: HTML, CSS
- Backend: Flask, Python
- Database: SQLite
- Tools: SQLAlchemy, Python Virtual Environment
This combination of technologies makes the project simple, modular, and easy to deploy or scale as needed.