Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
cdbf1e4
Hardcoded is no no
TeinSchoemaker Sep 17, 2025
3e91625
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 19, 2025
da6fa09
Docker?
TeinSchoemaker Sep 19, 2025
8a334c3
Merge branch 'new-server-fixes' into 67-update-fixing-front-end-conne…
TeinSchoemaker Sep 23, 2025
a82f4b2
Whoa! Docker compose?
TeinSchoemaker Sep 23, 2025
78afe2a
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 24, 2025
c64309f
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 24, 2025
23337e9
Team integration
TeinSchoemaker Sep 24, 2025
7144539
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 26, 2025
4880ae8
Demo ready
TeinSchoemaker Sep 29, 2025
61ae87f
Merge branch 'remove_sso' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 29, 2025
9455bab
Merge remote-tracking branch 'origin/mathiasjakubelisabeth-#120-small…
TeinSchoemaker Sep 29, 2025
c98063c
Merge branch 'buttonInvisibleForUsersNoCohort' into 67-update-fixing-…
TeinSchoemaker Sep 29, 2025
526aa90
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 29, 2025
63ee270
Demo
TeinSchoemaker Sep 29, 2025
8a81bf7
Merge remote-tracking branch 'origin/nav_to_cohort' into 67-update-fi…
TeinSchoemaker Sep 29, 2025
4fdbcee
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 29, 2025
49aac24
Merge branch 'main' into 67-update-fixing-front-end-connections
TeinSchoemaker Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependencies
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Build output
build
dist

# Local env files
.env*

# VCS
.git
.gitignore

# Editor/OS
.DS_Store
.vscode
Thumbs.db
28 changes: 27 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
REACT_APP_API_URL="http://localhost:4000"
## Setup: copy this file to .env then run: docker compose up --build -d
## Replace API_TOKEN & JWT_SIGNING_KEY with secure random keys (>64 bytes for HS512).
## Generate command: openssl rand -hex 96

POSTGRES_USER=appuser
POSTGRES_PASSWORD=apppassword
POSTGRES_DB=appdb
DB_PORT=5434

# Server project expected in sibling folder to this client repo
API_BUILD_CONTEXT=../csharp-team-dev-server-team-4/exercise.wwwapi
API_DOCKERFILE=Dockerfile

API_IMAGE_NAME=team-dev-api
API_PORT=3001
ASPNETCORE_ENVIRONMENT=Development
ASPNETCORE_URLS=http://+:8080
# HS512 signing keys must be >64 bytes. Replace these dev values.
JWT_SIGNING_KEY=change-me-jwt-signing-key-min-65-bytes
API_TOKEN=change-me-api-token-min-65-bytes

WEB_IMAGE_NAME=team-dev-client:web
WEB_PORT=3000

REACT_APP_API_URL=http://localhost:3001

COMPOSE_PROJECT_NAME=team-dev
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

FROM node:20-alpine AS builder

WORKDIR /app


COPY package*.json ./

RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund


COPY . .

ARG REACT_APP_API_URL

ENV REACT_APP_API_URL=$REACT_APP_API_URL

RUN npm run build


FROM nginx:alpine

COPY nginx.conf /etc/nginx/conf.d/default.conf

COPY --from=builder /app/build /usr/share/nginx/html

EXPOSE 8080

CMD ["nginx", "-g", "daemon off;"]
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Client repository for team dev project.
2. Make sure the `REACT_APP_API_URL` environment variable in the `.env` file contains the URL of the server app on your machine
3. `npm ci` to install dependencies
4. `npm start` to run the app. The server must also be running on your machine
5. `docker compose up --build` to start up the docker containers for use
6. `docker compose down` to stop running docker

### Project Management

Expand Down
42 changes: 42 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
services:
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER:-appuser}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-apppassword}
- POSTGRES_DB=${POSTGRES_DB:-appdb}
ports:
- "${DB_PORT:-5434}:5432"
volumes:
- pgdata:/var/lib/postgresql/data

api:
build:
context: ${API_BUILD_CONTEXT:-../csharp-team-dev-server-team-4/exercise.wwwapi}
dockerfile: ${API_DOCKERFILE:-Dockerfile}
image: ${API_IMAGE_NAME:-team-dev-api}
environment:
- ConnectionStrings__DefaultConnection=Host=db;Port=5432;Database=${POSTGRES_DB:-appdb};Username=${POSTGRES_USER:-appuser};Password=${POSTGRES_PASSWORD:-apppassword};SSL Mode=Disable
- Token=${API_TOKEN:-dev-token-please-change}
- JWT__SigningKey=${JWT_SIGNING_KEY:-dev-super-secret-signing-key}
- ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT:-Development}
- ASPNETCORE_URLS=${ASPNETCORE_URLS:-http://+:8080}
ports:
- "${API_PORT:-3001}:8080"
depends_on:
- db

web:
build:
context: .
dockerfile: Dockerfile
args:
REACT_APP_API_URL: ${REACT_APP_API_URL:-http://localhost:${API_PORT:-3001}}
image: ${WEB_IMAGE_NAME:-team-dev-client:web}
ports:
- "${WEB_PORT:-3000}:80"
depends_on:
- api

volumes:
pgdata:
15 changes: 15 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 8080;
server_name _;

root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri /index.html;
}

gzip on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css application/json image/svg+xml;
gzip_min_length 256;
}