- VirtualBox 6.0.x
- Vagrant
- Git - If you use linux, use your favorite package manager if not installed.
I recommend you use Visual Studio Code (with js/html/css/react/etc...) packages installed. When editting your files through your host machine, please make sure you are using Linux line endings. (LF). On Visual Studio Code, you can find that option on the bottom right after "Spaces/Tabs...".
After you've finished installing all the required software.
-
Download the Vagrantfile and setup_win.bat (in env_setup_scripts) to the root directory where you want to clone this repository.
-
If you are using Windows, please run the setup_win.bat as administrator, which will restart your PC (must run).
-
Start your favorite terminal / command prompt.
If on Windows, start with administrative mode. (Must do!)
-
Start vagrant and
cd
intoshared
folder, which will be synchorinzed with the folder where you started vagrant. -
Please clone your repository under
shared
.
- To start vagrant (your build/run environment) with
vagrant up
. - Load your vagrant session by
vagrant ssh
.
You should now have all you need to run/build this project. See running for instructions on how to build/run our project.
- In vagrant, type
exit
to leave vagrant. - To stop vagrant machine, you have two options.
vagrant halt
, stopping its processing until you start it again.
vagrant destroy
, deleting the box and its content (would have to re-setup).
The latter is useful when you want to re-install everything.
NOTE: You can also perform vagrant up --provision
so that the box performs
the initialization procedure (if you updated something by accident).
Since our project is setup as a frontend / backend package, you are allowed to run each indepdently, or together.
NOTE: Before running the backend server, you must run the initialize_project.sh
so that the project environment variables and packages are setup.
- Acquire a username / password from our MongoDB Atlas database accounts (for respective project).
- Acquire the cluster name for the respective project.
cd
into the root of the project../setup <mongo_user> <mongo_pass> <mongo_cluster_name>
or...
- Run
cd env_setup_scripts && ./setup_defaults
for a working development configuration.
cd backend/
orcd frontend/
- (Using docker)
sudo docker-compose up
orsudo docker-compose up -d
to run in the background.
(Using npm) (Probably easier) Please usenpm start
for frontend, andnpm run dev
for backend. - You can access the frontend through 11.11.11.11:3000 on your host machine, backend on 11.11.11.11:8080.
cd
into the root of the project.- Run
start_server.sh
- Access frontend through 11.11.11.11:3000
- Access backend through 11.11.11.11:8080.
stop_server.sh
to shutdown the container (do not forget).
The backend server has no changes in terms of deployment, but React has an optimized build step
which you can test like so.
docker-compose -f docker-compose-prod.yaml up -d --build