A joint university application portal for prospective undergraduates in Singapore, as inspired by UK's UCAS.
Make sure your WAMP/MAMP server and Docker engine is running, and that ports 3001 (used as Docker's published port) and 5762 (used by RabbitMQ) are free.
- Go to the root of the project.
- Check your environment variables in
.env
. (Mac users should have a default port of 8889 and passwword:root
). - Run the shell command:
For Windows users, execute the following:
bash dock.bat
For Mac users:
bash dock.sh
Finally, access the app via http://localhost:3001/.
- Go into the
app
directory from the root folder.
cd app
- Install node modules.
npm install
- Start your localhost in dev mode.
npm run dev
You will be able to access the app via http://localhost:3001/.
Node.js is a backend platform for supporting routing to different pages of our website, accepting authentication
To rewrite their entire code in Flask would be too tedious and error-prone, so this means it's best to do the retrieval of MyInfo data in Node.js itself.
Many node module packages are installed because of this, as seen in package.json > dependencies. The following packages deal with the encryption and safe retrieval of MyInfo data from the API:
- bluebird
- jose
- jsonwebtoken
- nonce
Some of the other packages are for Google's authentication service, while others I'm not too sure. But I think we can just ignore them for now as long as our microservice works.
Node.js has an established package manager (i.e. NPM), and one of the packages it manages is Passport.js. This allows for the easier integration of Google OAuth 2.0 and the recording of sessions in the database.
Besides Passport.js, we also have other packages installed in SGUniGo such as express-session, connect-mongo, mongoose, etc. to mainly help with the following feature:
- 🍪 Allow sessions on SGUniGo
- Users not logged in cannot access their applications, payment or profile page.
- All users who have a current session will also be redirected to their applications page if they access the SGUniGo home page.
- Session data is saved in MongoDB Atlas, a cloud and NoSQL databse connected to SGUniGo. The MONGO_URI can be seen in config > development.env or production.env, depending on the command you run in the CLI (i.e.
npm run dev
ornpm start
, respectively). It is connected via the Mongoose package in config > db.js.
Express.js is a framework for Node.js, which makes writing the code easier.
To set "environment variables" such as port number, database URI, etc. This is required by Node.js so it knows which port to listen on, where to post data, and identifiers needed for APIs.
Required by SingPass MyInfo.
Used to prevent users from accessing pages when they have not logged in.
Schema for MongoDB; it defines the information that gets posted to the database.
Utilities like CSS, JS, jQuery, bootstrap.
Needed by Express.js to identify which files to load based on the URL.
Strictly to store keys for SingPass' API.
Stores files that function like HTML, but with less clutter.
The files/folders that will not get pushed through Git.
Main file for Express/Node.js to determine routing and handling of packages.
Contains metadata regarding the whole project, node packages involved and commands to follow when running the project.