Skip to content

howen02/oyen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setting up

  1. Clone the repository:
    git clone https://github.com/howen02/oyen.git
  2. Change into the project directory:
    cd oyen
  3. Ensure you have Python installed with:
    python3 --version
    If not, you can install it here
  4. Create a virtual environment:
    • On macOS and Linux:
      python3 -m venv venv
    • On Windows:
      py -m venv venv
  5. Activate the virtual environment:
    • On macOS and Linux:
      source venv/bin/activate
    • On Windows:
      .\venv\Scripts\activate
  6. Install python dependencies:
    pip install -r requirements.txt
  7. Startup frontend server:
    • On macOS and Linux:
      cd frontend && open app.html
    • On Windows:
      cd frontend && app.html
  8. Startup backend server:
    cd .. && cd backend && uvicorn main:app --reload

You should now see this page image

How it Works

Signing Up

  • User has to input a unique username and password
  • Frontend sends a POST request to the backend
  • Backend does the following:
    • Checks if username is unique, rejects register if not unique
    • Hashes the password
    • Stores the username and password in the database, along with an ID for the user

Signing In

  • User has to input their registered username and password
  • Frontend sends a POST request to the backend to verify if the user has a registered account
  • Backend does the following:
    • Look for the user whose username matches the input, rejects if the user does not exist
    • Verifies if the input password hash matches the stored password hash, rejects if password does not match
    • Generates a JWT (JSON Web Token) and stores it in the user's local storage

Navigating Pages

  • If the user already has a valid JWT in their local storage, they get redirected from app.html to the login-gated page home.html

About

Authentication Page

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published