- Install docker desktop
- Add environment variables
Create a .env
file in the /app
directory following the .env.example
file. Ask your development directors for the values.
Note: The app will not run correctly unless you have the
.env
file in your/app
directory. 3. Run the following in the root directory
docker compose up -d --build
- Go to
localhost:3000
to see the app. Changes on the backend and frontend will hot reload. - To stop containers run,
docker compose down
If you wish to run the app on your local machine instead, please follow these instructions.
Install node version 20.4.0
Verify node installation by running node -v
and npm -v
The lounge-hub repo is a mono repo separated into two parts:
- app: express API backend
- client: next.js React frontend You'll need to install two separate node modules to get all the dependencies and run two seperate servers for the backend and the frontend.
To install backend dependencies, in the root directory, run
cd app
npm install
To install frontend dependencies, in the root directory, run:
cd client
npm install
You'll also need to install node module dependencies in the root directory for development and deployment dependencies. Run npm install
in the root directory.
In the root directory run
./start.sh
View start.sh
to see the separate commands that are run if you wish to run the backend and frontend separately.
The tests are separated by backend, frontend and integration tests.
Run backend tests by running cd app
and then npm test
.
The repo uses the Prettier formatter. Run prettier locally by running npm run format
in the root directory.
The lounge hub uses a PostgreSQL database hosted on a AWS EC2 instance. You can login into the AWS account using [email protected]. The password for AWS is saved in the google password manager. If you need access to the gmail of [email protected], please contact your development directors.
- Login to AWS and search for EC2.
- Go to
Instances
and click on theubcea-1
instance. You should be able to see all the information for the instance here. - See below for how to connect to the instance locally.
The EC2 instance uses SSH to connect to your local machine.
- Ask your development directors for the
augmnt.pem
file.[IMPORTANT]: Do NOT share this file with anyone.
- Move the downloaded
augmnt.pem
to a secure folder. This file is usually placed under your users.ssh
folder found under/Users/<USER>/.ssh/
. - Run
ssh -i "<path to your augmnt.pem>" [email protected]
- You can now login to the database using
sudo -u postgres psql
You can use any database development platform with PostgreSQL but we recommend pgAdmin. Here is a quick guide on how to connect to pgAdmin.
- Open pgAdmin and click "Add New Server"
- Add a server name (this can be anything)
- Click on the connection tab and enter:
- Host name:
54.245.134.32
- this is the EC2 instance public IP address. - Post:
5432
- this is the port to connect to postgre - Maintenance db:
loungehub
- Username:
admin
- Password: contact your development directors for the password
- Click
save
- Host name:
You should now be connected to the database on pgAdmin. If you have any issues, please contact your development directors.