Visit Jobs Board • About • Team • Installation • Documentation
DevSoc is the UNSW Software Development Society. We do not represent the School, Faculty, or University. This website seeks to be a centralised platform for students looking for employment opportunities, but its information has not been officially endorsed by the University, Faculty, School, or the Computer Science and Engineering Society. You should confirm with the employer that any information received through this website is correct.
Jobs Board is the go-to place for CSE students to find student jobs and internships. DevSoc partners with a wide range of top employers to provide you with only the best opportunities to enhance your student experience.
Visit Jobs Board to find out more. If you're curious about our workflow and how we make all of this possible, feel free to look through our Jira and Confluence workspaces. If there's a missing feature you would like to see, please submit a suggestion through this form or even better, contribute to the project yourself by opening an issue and making a pull request.
Jobs Board was made with 🤍 by CSE students, for CSE students. Jobsboard is a team that is part of DevSoc Projects! See TEAM.md for more details on the teams that contributed to the development of Jobsboard!
-
Clone the jobs-board repo.
git clone https://github.com/devsoc-unsw/jobsboard.git
-
Download Docker Desktop
-
Set up the neccessary environment variables
-
Frontend (optional): Create a
.env.local
file in thefrontend
directory with the following contents:NEXT_PUBLIC_API_BASE_URL=http://localhost:8080/
The environment variable
NEXT_PUBLIC_API_BASE_URL
is used as the base URL for any API requests made by the frontend. If you have the backend running locally, it should use the your local backend instead (http://localhost:8080/). If the backend is not running locally or ifNEXT_PUBLIC_API_BASE_URL
is not provided,https://jobsboard.staging.csesoc.unsw.edu.au/api
will be used as the base URL as a fallback option. -
Backend: Create a
.env
file in thebackend
directory with the following contents:NODE_ENV=development SERVER_PORT=8080 DB_HOST=localhost DB_PORT=5432 DB_USER=postgres DB_PASSWORD=mysecretpassword DB_NAME=postgres MAIL_USERNAME=test@gmail.com MAIL_PASSWORD=password MAIL_SMTP_SERVER=smtp.gmail.com MAIL_SMTP_SERVER_PORT=465
If having
DB_HOST=localhost
result in errors such asECONREFUSED
, change it toDB_HOST=db
.
-
-
Navigate to the
frontend
andbackend
directories and install the required dependencies by runningyarn
-
Start up the frontend by navigating to the
frontend
directory and runningyarn dev
-
Go to localhost:3000 on your browser to see the frontend running locally!
Without Docker
- After installing PostgreSQL on your computer, open a terminal and run
psql
. Now, you should see a command prompt that may look like thismatthewliu=#
. - Create a new database called
postgres
by runningcreate database postgres;
In the future, you can log straight into this database by runningpsql -U postgres
in your terminal. - Navigate to the
backend
directory and runyarn serve
to start up the server.
With Docker
- After installing Docker on your computer, open a terminal and run
docker compose build
to build all the containers required for Jobsboard. In the future, you will only need to run eitherdocker compose build api
ordocker compose build test
as you make changes to them. - Start up the database by running
docker compose up -d db
in your terminal. - Start up the server by running
docker compose up -d api
in your terminal.
Refer to the Using Docker section below if you need more assistance.
Go to localhost:8080 on your browser to see the backend running locally!
API Documentation
After the server is started, you can access the API documentation at localhost:8080/docs.
When adding, modifying or removing routes from backend/src/index.ts
, please remember to update the documentation at backend/src/docs/openapi.json
accordingly to by following the existing format.
Only use this section if you are working on a function that needs the mail queue initialised. This assumes that you are using Gmail as the test account when trying to send emails.
-
Ensure that your 2-FA for Gmail is enabled.
-
Generate an App Password by following this (Focus on the “Create & Use App Passwords” section).
-
Navigate to the
docker-compose.yml
file and add this in under the api environment:
NODE_ENV=production
SERVER_PORT=8080
JOBS_BOARD_API_URL=http://127.0.0.1:8080
MAIL_SMTP_SERVER=smtp.gmail.com
MAIL_SMTP_SERVER_PORT=465
MAIL_USERNAME=<REPLACE WITH YOUR EMAIL ADDRESS>
MAIL_PASSWORD=<REPLACE WITH YOUR APP PASSWORD FROM STEP 2>
-
For the frontend, ensure you set the environment variable in
frontend/.env
to usehttp://localhost:8080/
-
Navigate to
mail.ts
and modify thesecure
field in thetransportOptions
object config totrue
as shown below:
const transportOptions = {
host: process.env.MAIL_SMTP_SERVER,
port: parseInt(process.env.MAIL_SMTP_SERVER_PORT, 10),
secure: true, // SET THIS TO TRUE
auth: {
user: process.env.MAIL_USERNAME,
pass: process.env.MAIL_PASSWORD,
},
requireTLS: true,
};
- Navigate to the root of the project.
- Run
docker compose build
to build all containers ordocker compose build [container-name]
for a specific container specified in the compose file. - Run
docker compose up
to start all containers ordocker compose up [container-name]
for starting a specific container specified in the compose file.To view which containers you would like to build/start, refer to docker-compose.yml
We do not have tests yet... :(
Without Docker
-
Go to
backend/tests/config.js
and setapiUrl
tohttp://localhost:8080
. If this is your first time, rungit update-index --skip-worktree tests/config.js
to prevent git from tracking this file in the future. -
Navigate to the
backend
directory and run the following commands in your terminalyarn serve yarn test
With Docker Navigate to the root directory and run the following commands in your terminal
docker compose build api
docker compose build test
docker compose up test
Make sure to stop the server and db before rerunning the tests either using the the Docker Desktop GUI or by running
docker stop jobsboard-api-1
anddocker stop jobsboard-db-1
in your terminal.
Use the logs in the terminal or the Docker Desktop GUI to check your tests.
The reason Docker is used when testing is because we're given a guarantee that the conditions are exactly the same every time and because it emulates what the behaviour will be on prod running in the container - where there are differences.
Coming
- Run
yarn run lint
to see both style and linting issues in.ts
files within thebackend
directory at once - Run
yarn run lint:fix
to automatically amend all style and linting issues that would be identified by running the first command (recommended) - Run
yarn run format
to see all style issues in.ts
files within thebackend
directory according to the prettier configuration file.prettierrc
- Run
yarn run format:fix
to automatically amend all the style issues identified by runningnpm run prettier
(recommended)
Always double check before submitting your pr
- Run
docker compose build api
anddocker compose build test
and ensure the builds complete successfully - Run
docker compose up test
and ensure all tests pass
Log in to your preferred container registry via command line and run docker-compose push
, ensure that they've finished pushing and then deploy where required.