This directory contains the source code for the frontend of ModulePal (React, TypeScript) hosted using Firebase Hosting. We assume you are comfortable with the technologies used by the project.
We use the following technologies:
... and various other libraries detailed in the package.json. It should be noted we use Reactstrap for using Boostrap in React. We utilise Firebase Authentication for session management purposes only (hence, we only use the Anonymous sign-in-provider, and perform university account to Firebase session ID association on the backend).
We recommend using the Visual Studio Code IDE for development. You will need Yarn (or if you prefer, npm, but we do not provide instructions for it).
You will need the backend running either on the cloud or locally for the frontend to function properly. You must use the same private Firebase Project as the backend for the frontend.
The following steps will run the frontend either locally or via Firebase Hosting:
- In your Firebase Project, ensure that Firebase Authentication is setup with only the Anonymous sign-in-method.
- If deploying via Firebase Hosting, ensure that you have setup Firebase Hosting (but do not run the requested commands), and install the Firebase CLI. After, Run
firebase loginto login to the Firebase CLI, and login to the account which contains your Firebase Project. - Open src/services/rest/rest.ts and enter your backend's base URL (before
/api, e.g.https://modulepal-backend.com) intobaseUrl, and the to-be-deployed frontend's base URL (e.g.http://localhost:3000if locally) intofrontendBaseUrl. - Open .firebaserc and enter your Firebase Project ID under
projects.default. - Open firebase.json and enter your Firebase Project ID under
hosting.site. - Open src/services/firebase/firebase.ts and modify
firebaseConfigwith your Firebase Config object. - Run
yarnto install the dependencies. This will take a while. - If deploying locally for development, run
yarn start. If deploying via Firebase Hosting, runyarn buildfollowed byfirebase deploy --project <projectid>where<projectid>is your Firebase Project ID. - 🚀