A sleek, responsive authentication portal with dark/light theme support, built with Flask backend and vanilla JavaScript frontend.
- π Dark/Light Mode Toggle - Automatic system theme detection
- π± Fully Responsive - Works perfectly on all devices
- π― Modern UI/UX - Clean, intuitive interface with smooth transitions
- π International Phone Input - Country flags and dial codes
- π€ User Registration - Full name, email, phone, and secure password
- π User Login - Login with email or phone number
- π‘οΈ Password Security - BCrypt hashing for maximum security
- π§ Email Validation - Real-time email format checking
- π Password Strength - Minimum 8 characters with visual feedback
- π Flask Backend - Lightweight and efficient Python server
- π RESTful API - Clean JSON endpoints for registration/login
- πΎ JSON Database - Simple file-based user storage
- π¨ Pure CSS - No external CSS frameworks
- β‘ Vanilla JavaScript - No jQuery or heavy libraries
- Python 3.8+
- pip (Python package manager)
-
Clone the repository
git clone https://github.com/saad2134/auth-system.git cd auth-system -
Install dependencies
pip install -r requirements.txt
-
Start the backend server
python app.py
Server runs on
http://localhost:5000 -
Open the frontend
- Open
index.htmlin your browser - Or use a local server:
python -m http.server 8000
- Open
Register a new user account.
Request:
{
"full_name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"password": "securepassword123"
}Response:
{
"status": "success",
"message": "User registered successfully."
}Authenticate an existing user.
Request:
{
"identifier": "john@example.com", // or phone number
"password": "securepassword123"
}Response:
{
"status": "success",
"message": "Login successful."
}Modify CSS variables in styles.css:
:root {
--bg-color: #ffffff;
--text-color: #000000;
--button-bg: #6600ff;
--form-bg: #f9f9f9;
}- Update HTML form in
index.html - Add validation in
scripts.js - Modify Flask routes in
app.py
- Production Server: Use Gunicorn or uWSGI
- Platforms: Heroku, DigitalOcean, AWS, PythonAnywhere
- Static Hosting: Netlify, Vercel, GitHub Pages
- Remember: Update
API_URLinscripts.jsfor production
-
CORS Errors
- Ensure Flask server is running on port 5000
- Check browser console for specific errors
-
Phone Input Not Loading
- Verify
assets/folder exists with intl-tel-input library - Check network tab for failed resource loads
- Verify
-
Registration Fails
- Check if all required fields are filled
- Verify email and phone aren't already registered
We welcome contributions! Please feel free to submit pull requests or open issues for bugs and feature requests.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- intl-tel-input for phone number formatting
- Flask for the lightweight backend
- BCrypt for password security
β Star this repo if you found it helpful! Thanks for reading.