Skip to content

Paul-Austin-Oswego-CSC480-HCI521/OZ-CSC-480-HCI-521-Fall-2024

Repository files navigation

OZ-CSC-480-HCI-521-Fall-2024

Repo for CSC 480 HCI 521 class of fall 2024

Tech Stack:

Frontend: React with Vite and JS, Tailwind css, and Shadcn for the UI library

Backend: OpenLiberty, MicroProfile, and SQLite

Running the demo

Set up a GitHub OAuth application for social login

  1. Sign into github
  2. Navigate to Settings->Developer Settings->OAuth Apps
  3. Click New OAuth App
  4. Fill in
    • Application Name (anything is fine)
    • set Homepage URL to https://localhost:9443 (9443 or the auth-service https port found in <liberty.var.https.port> if you changed it)
    • set Authorization callback URL to https://localhost:9443/ibm/api/social-login/redirect/githubLogin (again the auth-service https port)
  5. Click Register application
  6. Click Generate a new client secret
  7. Copy the client secret and store it somewhere

Set GitHub environment variables

Create a new file at /backend/auth-service/src/main/liberty/config/server.env and put

GITHUB_CLIENT_ID=<your OAuth app's client id>
GITHUB_CLIENT_SECRET=<your OAuth app's client secret>

Run the application

Prerequisites: make sure you have mvn and npm (or yarn/bun) installed

In the root directory run:

Windows:

.\start_website.bat

Linux/Mac:

./start_website.sh

the webpage will be served at http://localhost

WARNING: the website does not work on safari we will attepmt to fix it at a later date

Stopping the application

🔥🚀🎉 NEW! 🔥🚀🎉 just do q+enter in the vite terminal, we'll auto shutdown the backend

if you ctrl+c out of habit you can still run:

Windows:

.\stop_website.bat

Linux/Mac:

./stop_website.sh

Configuration

Unfortunately, OpenLiberty is allergic to .env files, so two configuration files, /backend/pom.xml and /frontend/.env, must be used and kept in sync.

I'm really trying to find a better solution

the configuration options are

  1. auth-service port: <oz.auth.port> and VITE_AUTH_ROOT
  2. database-service port: <oz.api.port> and VITE_API_ROOT
  3. frontend port: <oz.frontend.root> and VITE_FRONTEND_PORT