Skip to content

Commit

Permalink
Add TradeDesk to new website
Browse files Browse the repository at this point in the history
  • Loading branch information
Ming Xuan Yong committed Jun 13, 2024
2 parents 6af87dd + 16ad1ca commit 80bbc83
Show file tree
Hide file tree
Showing 90 changed files with 2,535 additions and 3,126 deletions.
12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Backend CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./backend

steps:
- uses: actions/checkout@v3

- name: Use Node.js 22
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install dependencies
run: npm install

- name: Check types
run: npm run type-check

- name: Build Express app
run: npm run build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Frontend CI

on:
push:
Expand All @@ -10,8 +10,13 @@ jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v3

- name: Use Node.js 16
uses: actions/setup-node@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
**/node_modules
/.pnp
.pnp.js

Expand All @@ -14,6 +14,8 @@

# production
/build
/frontend/.next
/backend/dist

# misc
.DS_Store
Expand Down
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# CSESoc Website

## How to run locally
- Install dependencies with `npm install`
- Run using `npm run dev`
This repository contains the code for a redesigned CSESoc website. The current website can be found at [csesoc.unsw.edu.au](https://csesoc.unsw.edu.au/).

## How to run locally (without Docker, development mode)

### Running the frontend

1. Navigate to the `frontend` directory with `cd frontend`.

2. Create a `.env` file in the `frontend` directory with the following content:
```
NEXT_PUBLIC_BACKEND_HOST=localhost
NEXT_PUBLIC_BACKEND_PORT=9000
```
This is necessary for the frontend to communicate with the backend.

2. Install dependencies with `npm install` if you haven't already.

3. Run using `npm run dev`, changes will be reflected live.

See `package.json` for further commands to lint, build, etc.


### Running the backend

1. Navigate to the `backend` directory with `cd backend`.

2. Install dependencies with `npm install` if you haven't already.

3. Run using `npm run dev`, changes will be reflected live.


## How to run locally (with Docker, production mode)

Make sure you have [Docker](https://docs.docker.com/get-docker/) installed.

1. Run `docker compose build` in the root directory, this will build the frontend and backend services in production mode, meaning live changes will not be reflected. In the future, you will only need to run either `docker compose build frontend` or `docker compose build backend` if you have only made changes to the frontend or backend respectively.

2. Run `docker compose up` (or `docker compose up -d` to run in the background) in the root directory, this will start the frontend and backend services.

3. Run `docker compose down` to stop the services.
6 changes: 6 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
npm-debug.log
build
.git
*.md
.gitignore
13 changes: 13 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22-alpine

ENV NODE_ENV production

WORKDIR /app
COPY . .

RUN npm ci
RUN npm run build

EXPOSE 9000

CMD ["npm", "start"]
Loading

0 comments on commit 80bbc83

Please sign in to comment.