This repository contains the front-end and back-end code for CovEd's revamped website. The website is built using ReactJS, Firebase, and MongoDB.
To install dependencies run the following.
$ npm install
$ npx lerna bootstrap
Ensure that you install from the /packages/client/
directory, NOT the root directory. All dependencies and packages should be added on to either client
or server
.
$ npm uninstall <all new packages>
$ cd packages/client
$ npm install <all new packages>
Ensure that non-development (test frameworks, linting, etc) packages are part of dependencies
and not dev-dependecies
. To fix it:
$ npm uninstall <all new packages>
$ npm install <all packages>
In packages/client
, there is a .env.development
file which contains configuration for Firebase. These lines are injected when developing locally, and can be referenced in code like so: process.env.REACT_APP_FIREBASE_API_KEY
. During build time, these references are replaced with actual values by the CI server in the final output bundle. More documentation here: https://create-react-app.dev/docs/adding-custom-environment-variables/
This will start the live reload servers for both the back-end API and the react client.
$ npm start
This will build the client and start the server in production mode
$ npm run production
Run the following command to run all tests
$ npm test
If there are a lot of errors regarding the linting, run the following command to run it locally
$ npx lerna run lint
Caveat: Do NOT attempt to install eslint
as a package as it will break the code. Use the above code, but install all necessary extensions (most code editors already support it).
- ExpressJS
- MongoDB
- ReactJS
- Testing with Jest and Supertest (read about it here)