Skip to content

sureshthevar27/User-Authentication-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 User Authentication System (Flask)

Live Demo

A Flask-based User Authentication System implementing secure user registration, login, logout, and session management.
This project focuses on authentication fundamentals such as password hashing, session handling, and access control.
A minimal Todo module is included only to demonstrate authenticated user access.


🚀 Features

  • User Registration
  • User Login & Logout
  • Session-based Authentication
  • Secure Password Hashing using bcrypt
  • Protected Routes (authorized access only)
  • SQLite database with SQLAlchemy ORM
  • Authentication-first architecture

🛠 Tech Stack

  • Backend: Flask (Python)
  • Database: SQLite
  • ORM: SQLAlchemy
  • Authentication: Flask Sessions
  • Security: bcrypt password hashing
  • Frontend: HTML, CSS (Jinja Templates)

📂 Project Structure

User-Authentication-System/
│── app.py  
│── requirements.txt  
│── .gitignore  
│── templates/  
│   ├── login.html  
│   ├── register.html  
│   ├── index.html  
│   └── update.html  
│── static/  

⚙️ Installation & Setup

1️⃣ Clone the repository

git clone https://github.com/your-username/User-Authentication-System.git
cd User-Authentication-System

2️⃣ Create virtual environment (recommended)

python -m venv env
env\Scripts\activate   # Windows

3️⃣ Install dependencies

pip install -r requirements.txt

4️⃣ Run the application

python app.py

5️⃣ Open in browser

http://127.0.0.1:2711

🔐 Authentication Flow

  1. User registers with email and password
  2. Password is securely hashed using bcrypt
  3. User logs in with valid credentials
  4. Session is created and stored server-side
  5. Protected routes are accessible only to authenticated users
  6. Logout clears session data

🧪 Key Routes

Route Purpose
/register User registration
/login User login
/logout End user session
/home Protected route (authentication required)
/ Redirects based on authentication status

🔒 Security Highlights

  • Passwords are never stored in plain text
  • bcrypt hashing ensures strong password security
  • Session-based authentication prevents unauthorized access
  • Database and environment files excluded via .gitignore

🧩 About the Demo Module

The Todo functionality exists only as a demonstration layer to validate:

  • Successful authentication
  • User-specific access
  • Session persistence

The primary focus of this repository is user authentication, not task management.


📌 Future Improvements

  • Flask-Login integration
  • Role-based access control (RBAC)
  • Password reset & email verification
  • JWT-based authentication
  • OAuth (Google / GitHub login)

👨‍💻 Author

Suresh Thevar
Focused on backend development, authentication systems, and Flask-based web applications.


⭐ If you find this useful

Give the repository a ⭐ and feel free to fork!

About

User Authentication System built with Flask featuring registration, login, session management, and secure password hashing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors