https://github.com/manavalan2517/login-and-register-system-in-python
This Python script is a comprehensive solution for managing user authentication, which includes both registration and login functionalities. It utilizes a local JSON file to store user credentials securely.
https://github.com/manavalan2517/login-and-register-system-in-python
authentication interactive json py3 python realtime regex security terminal user-management
Last synced: 12 months ago
JSON representation
This Python script is a comprehensive solution for managing user authentication, which includes both registration and login functionalities. It utilizes a local JSON file to store user credentials securely.
- Host: GitHub
- URL: https://github.com/manavalan2517/login-and-register-system-in-python
- Owner: Manavalan2517
- Created: 2024-03-30T09:09:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-01T07:00:30.000Z (about 2 years ago)
- Last Synced: 2025-04-14T14:58:51.666Z (about 1 year ago)
- Topics: authentication, interactive, json, py3, python, realtime, regex, security, terminal, user-management
- Language: Python
- Homepage:
- Size: 1.27 MB
- Stars: 9
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Authentication System in Python

## This project is just a basic method of securing users data
This project provides a comprehensive user authentication and management system, consisting of three main Python files: `main.py`, `server.py`, and `client.py`. The system supports user registration, login, and account deletion, while ensuring secure password storage using bcrypt hashing. Additionally, the project includes a JSON file (`data.json`) to store user data.
## File Descriptions
1. `main.py`: A command-line interface (CLI) application that allows users to register, log in, and delete their accounts. The application uses the `questionary` library to create interactive prompts and the `bcrypt` library to securely hash and verify passwords.
2. `server.py`: A FastAPI-based server that exposes RESTful endpoints for user registration, login, and account deletion. The server also utilizes `bcrypt` for password hashing and verification, and stores user data in a JSON file.
3. `client.py`: A client application that interacts with the FastAPI server using the `requests` library. The client demonstrates how to register, log in, and delete user accounts by sending HTTP requests to the server's endpoints.
## Features
- User registration with password validation (minimum length, uppercase, lowercase, and numeric character requirements) and email validation.
- Secure password storage using bcrypt hashing.
- User login with case-insensitive username support.
- Account deletion for registered users.
- JSON-based data storage for user information.
## Requirements
- Python 3.6 or newer
- `uvicorn` (for running the FastAPI server)
- `fastapi`
- `bcrypt`
- `questionary` (for the CLI application)
- `requests` (for the client application)
## Getting Started
1. Install the required packages:
```bash
pip install uvicorn fastapi bcrypt questionary requests
```
2. Run the FastAPI server:
```bash
python server.py
```
The server will start listening on `http://localhost:8000`.
3. Use the CLI application (`main.py`) to use auth locally and the client (`client.py`) to interact with the server.
## Notes
- The CLI application (`main.py`) can be run independently of the server and uses its own instance of the JSON data file.
- The client application (`client.py`) communicates with the server (`server.py`) and shares the same JSON data file as the server.