https://github.com/blueorionn/flask-booklist
BookList Collection Web Application.
https://github.com/blueorionn/flask-booklist
authentication flask flask-application
Last synced: about 1 month ago
JSON representation
BookList Collection Web Application.
- Host: GitHub
- URL: https://github.com/blueorionn/flask-booklist
- Owner: blueorionn
- License: mit
- Created: 2025-03-08T09:44:22.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-09-09T05:40:17.000Z (10 months ago)
- Last Synced: 2025-10-14T18:57:13.179Z (9 months ago)
- Topics: authentication, flask, flask-application
- Language: Python
- Homepage:
- Size: 1.26 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FLASK BOOKLIST

This project is a Flask-based web application that explores session authentication and middleware. The backend handles user authentication using Flask sessions, enforcing secure login/logout mechanisms, and applying middleware for request validation and logging. This setup provides a structured way to learn about user authentication, middleware functions, and frontend asset management in a Flask environment.
⚠️ This project is created solely for fun and learning
## TechStack
- Flask
- Tailwindcss
- MariaDB
## Database Setup
Required a **MySQL/MariaDB** database local or cloud.
Create the movie table and load data as specified in the `data/books.sql` file.
## User Creation
To create a user, use the script with the following options. **Before beginning, make sure to properly load all environment variables listed in the [Installation section](#installation).**
```bash
python scripts/register_user.py -fn [first_name] -ln [lastname] -u [username] -p [password] -r [role]
```
**Valid user roles are `admin` and `user`.**
## Installation
### Prerequisites
- Python 3.11+
- pip (Python package installer)
- Nodejs
- npm
### Steps
1. Clone the repository:
```bash
git clone https://github.com/blueorionn/Flask-BookList.git
cd Flask-BookList
```
2. Create and activate a virtual environment:
```bash
python -m venv .venv
source .venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install the dependencies:
```bash
pip install -r requirements.txt
```
4. Export variables:
```bash
export PYTHONDONTWRITEBYTECODE=1
export FLASK_ENV="development"
export SECRET_KEY="your-secret-key"
export DB_HOST="your-database-host"
export DB_NAME="your-database-name"
export DB_USER="your-database-username"
export DB_PASSWORD="your-database-password"
export DB_PORT="your-database-port"
```
5. Run the Flask app:
```bash
python wsgi.py
```
6. Open the app in your browser at `http://127.0.0.1:8000/`.
## License
This project is released under the MIT License.