Setup should be easy for all systems because it just requires NodeJS and MongoDB installations.
- Download and install NodeJS for your system.
- Download and install MongoDB for your system.
- You may also get MongoDB Compass which will help with manually configuring the DB.
- Run this command with previleges.
- Windows:
- Open PowerShell as administrator
npm install -g expo-cli
- Max/Linux:
sudo npm install -g expo-cli
- Windows:
- Run the following commands (run in the project root).
cd web
npm install
cd ../mobile
npm install
cd ..
To run the web app, go into the web
folder and run npm start
. This launches both the front-end and the back-end. The browser should open automatically to http://localhost:3000
Install Expo on your phone's app store.
In the mobile
directory, run npm run web
. This will launch your web browser. In the bottom left, there's a QR code. Scan that code, and Expo will open automatically and start downloading assets.
If you're running a system capable of simulator your device, you may follow the instructions here to set that up.
To get production-worthy code for the front-end, run npm run build
from the frontend
directory. This will automatically minimize HTML, CSS, and JS assets as well as making the JS code compatible for older web browsers. So feel free to using ES6 syntax for the front-end!
Note that production code should run quite smooth compared to unoptimized code.
- The API server runs on port 8000.
- React has it's own development server that serves you the web assets. This is on port 3000.
- React automatically refreshes the page when you make changes.
- The server automatically restarts when you make changes but will not refresh the page as it isn't always necessary.
- In development, the React server will automatically forward all /api requests to the backend.
- React supports ES6 by default. I have also configured the backend to support it as well.