- Clone the repository:
git clone https://github.com/howen02/oyen.git
- Change into the project directory:
cd oyen
- Ensure you have Python installed with:
If not, you can install it here
python3 --version
- Create a virtual environment:
- On macOS and Linux:
python3 -m venv venv
- On Windows:
py -m venv venv
- On macOS and Linux:
- Activate the virtual environment:
- On macOS and Linux:
source venv/bin/activate
- On Windows:
.\venv\Scripts\activate
- On macOS and Linux:
- Install python dependencies:
pip install -r requirements.txt
- Startup frontend server:
- On macOS and Linux:
cd frontend && open app.html
- On Windows:
cd frontend && app.html
- On macOS and Linux:
- Startup backend server:
cd .. && cd backend && uvicorn main:app --reload
- 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
- 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
- If the user already has a valid JWT in their local storage, they get redirected from
app.html
to the login-gated pagehome.html