Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Login Registration Form
=======================
A small educational web project that demonstrates a complete local authentication flow using HTML, CSS, vanilla JavaScript and a minimal Python backend.
The project includes:
- Login with username or email
- User registration
- Duplicate username/email checks
- Password recovery with username and email verification
- Password reset
- Inline messages without changing page
- User data stored in a local JSON file
Project Structure
-----------------
index.html
Login page.
new-user.html
Registration page.
recover-password.html
Password recovery page.
reset-password.html
Password reset page.
style.css
Shared styling for all pages.
script.js
Frontend JavaScript. It intercepts form submissions, sends data to the Python backend with fetch(), and shows server messages inside the page.
server.py
Local Python server. It serves the HTML/CSS/JS files and handles login, registration, password recovery and password reset.
utenti.json
Local JSON file used as a simple user store.
How to Run
----------
Run the Python server from the project folder:
python server.py
Then open this URL in your browser:
http://localhost:5500
Do not open the HTML files directly and do not use VS Code Live Server for the full project flow.
Why Live Server Does Not Work
-----------------------------
Live Server only serves static files such as HTML, CSS and JavaScript.
This project also needs Python because the backend reads and writes utenti.json. Without server.py running, requests such as /login, /register, /recover-password and /reset-password will not work.
Important Notes
---------------
This project is for learning purposes only.
Passwords are stored in clear text inside utenti.json. This is not safe for a real website.
For a production project, passwords should be hashed, user data should be stored in a real database, and the backend should include proper validation, sessions and security protections.
Deployment
----------
This project does not work on Netlify as-is because Netlify static hosting does not run server.py and cannot update utenti.json.
To deploy it properly, you would need a real backend service, for example:
- Python backend hosted on Render, Railway or PythonAnywhere
- A database instead of utenti.json
- Or serverless functions rewritten for the chosen hosting platform
Demonstration Deploy Version
----------------------------
To show this project inside the personal portfolio without changing this original folder, a separate deploy copy was created:
C:\Code\Web\form_login-registrazione-deploy
That copy separates frontend and backend:
- Static frontend published on GitHub Pages in the public repository `Login_Registration_Form_Deploy`
- Frontend URL: https://stefadale.github.io/Login_Registration_Form_Deploy/
- Python WSGI backend published on PythonAnywhere
- Backend URL: https://stefadale.pythonanywhere.com
The deploy copy uses an `app.py` file suited for PythonAnywhere and a `script.js` that calls the online backend. This original folder remains intended for local use with `server.py`.
The deployed demo is shown in the Netlify portfolio inside the Projects section through a modal/iframe preview.
Current Status
--------------
The project works locally when started with:
python server.py
Implemented backend endpoints:
- POST /login
- POST /register
- POST /recover-password
- POST /reset-password