- Judao Zhong [email protected]
- Tiffany Gu [email protected]
- Yash Arora [email protected]
- Khurkhartsaga Munkhbold(Saga) [email protected]
The repo has such folders:
- app -------------------------------------------------------------------- router, controllers, database configuration
- config ------------------------------------------------------- MongoDB Setup
- mongodb.config.js -------------------------------MongoDB connection string
- controllers
- push.controller.js --------------------------------Web-Push Functions
- user.controller.js --------------------------------User Functions invoked on req
- resources ------------------------------------------------------------------------- All the resources
- static -------------------------------------------------------------------- html, images, css, JavaScript files
- css -------------------------------------------------------------CSS Stylesheets
- img------------------------------------------------------------ Pictures used
- js ---------------------------------------------------------------JavaScript Files
- json ------------------------------------------------------------GeoJson data, MongoDB JSON backups
- minigames---------------------------------------------------- Modularized Minigames
- tic_tac_toe ----------------------------------------------------------------- React.Js Minigame(Not Static)
- sw.js ----------------------------------------------------------------------Service Worker(Used in the web-push function)
- views -------------------------------------------------------------------- ejs views and compenents
- components -------------------------------------------------- components reused in ejs rendering
- app.js ------------------------------------------------------------------------------- the entrance of the application, drives the app
- package.json ----------------------------------------------------------------------- contains module configuration
- readme.md
-
Download and install Node.js
-
When your node environment is set, clone the github repo to your folder by running the command line:
> git clone https://github.com/Arora-Yash-coder/COMP_2800_Team-BBY-06_Happify.exe.git
-
Install the required Node modules using command line:
>npm i -g
-
After installing the modules, test if you could run the app
>node app.js
-
If you are going to host it with https protocal, get SSL keys and certificates, and then uncomment the following code:
const https = require('https'); var options = { key: fs.readFileSync('./privatekey.pem'), cert: fs.readFileSync('./certificate.pem') }; https.createServer(options, app).listen(443, function () { console.log('Https server listening on port ' + 3011); });
-
Download MongoDB Compass, then connect to the DB using this uri connection string:
mongodb://judao:[email protected]:27017/?authSource=admin&readPreference=primary&appname=MongoDB%20Compass&ssl=false
The data for this app is in DB "test"
-
(Not Suggested)If you want to run the react-based tic tac toe game on your own computer, then you need to go to /resources/tic_tac_toe and do:
> npm i react -g
Then Configure the .env file in each of the different folders and set the PORT to a different value.
-
(Suggested) Deploy the react app to netlify.
-
You will have to link them together again in the ttt_game_entrance.html .
-
Congradulations, you have finished setting up the Development Environment ! You can run the app by inputing the following code and hit enter: With React Deployed Locally:
> npm run dev -concurrently
With React Deployed On Netlify:
> node app.js
https://docs.google.com/spreadsheets/d/1Nki5OthlYfJ5bwWQFmdyP5F_CRIRdo0rsgAe4Eg3li8/edit?usp=sharing
https://docs.google.com/document/d/1fbnJ3FqlW2z1bGHk8YU9_wPUo9LC0aB5cOKmQgqqXYs/edit?usp=sharing