Giter Site home page Giter Site logo

nebulaflask's Introduction

NebulaFlask

Secure Flask User Registration and Login witg Argon2 Password Hashing and MySQL Database Storage

This is a Flask application that provides user registration and login functionality. It uses the Argon2 password hashing algorithm for secure password storage. The application uses SQLAlchemy as the ORM (Object-Relational Mapping) tool to interact with a MySQL database.

Features

  • User registration: Users can create a new account by providing a unique username, password, and name.
  • User login: Registered users can log in to access their dashboard.
  • Password validation: Passwords must be at least 8 characters long and contain at least 1 special character and 1 number.
  • Session management: User sessions are stored using Flask's session management, allowing authenticated access to protected routes.
  • Logging: The application logs new user registrations and successful user logins.

Usage

1. Install the required dependencies listed in the "Dependencies" section.

pip install flask flask_sqlalchemy argon2-cffi mysqlclient uvicorn gunicorn gevent asgiref python-dotenv

or

pip install -r requirements.txt

2. Set up a MySQL database and update the "SQLALCHEMY_DATABASE_URI" configuration in the code to point to your database.

  • I used XAMPP to set up a local MySQL database for testing and imported the users.sql file to create the user table.

3. Run the application.

uvicorn main:app

4. Access the application in your web browser and register a new user.

5. Log in with the registered user's credentials and access the user's dashboard.

Note: This code is provided as a basic example and may need further enhancements and security considerations for production use. Make sure to properly secure your application and database when deploying it.

Dependencies

  • Python 3.6+ (I used Python 3.11.3)

Attention

  • this was tested with Windows 11 Pro 22H2 22621.1778
  • for Unix systems, you may need to change some things

Found a bug?

Feel free to open a new issue. Make sure to include as much information as possible so I can reproduce the bug or open a pull request.

License

GNU GPLv3

nebulaflask's People

Contributors

entytaiment25 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

nebulaflask's Issues

Config

Config file for all the data. use .json or .env

Favicon

Fix the non working Favicon

Security Fixes

Some Friend looked into the code some time ago and mentioned "security vulnerabilities" please make you're not using that in Production it's for Education. Will try to fix them some day but I have many other important projects.

Security

Check for possible Sql injections and XSS Attacks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.