Skip to content

app-generator/docs-flask-simple-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Authentication Project

A simple Flask application demonstrating authentication, SQLAlchemy ORM, and a REST API. Links & Resources:

Features

  • User authentication (login/register/logout)
  • Public and protected routes
  • SQLite database with SQLAlchemy ORM
  • REST API endpoint for users
  • Bootstrap-styled templates

Installation

  1. Create a virtual environment:
python -m venv venv
  1. Activate the virtual environment:
  • Windows:
venv\Scripts\activate
  • Unix or MacOS:
source venv/bin/activate
  1. Install requirements:
pip install -r requirements.txt
  1. Run the application:
python run.py

Routes

  • / - Public homepage
  • /private - Protected route (requires login)
  • /api/users - API endpoint listing all users
  • /login - User login
  • /register - User registration
  • /logout - User logout

API Usage

Get list of all users:

curl http://localhost:5000/api/users

Security Note

This is a demonstration project. In a production environment, you should:

  • Use a proper secret key
  • Enable HTTPS
  • Implement proper password validation
  • Add rate limiting
  • Use environment variables for sensitive data