Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split backend responsabilities #84

Merged
merged 13 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .changeset/blue-books-draw.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/brave-sheep-invite.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"composite-back": patch
"composite-front": patch
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/dry-pumpkins-act.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/dull-shrimps-allow.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/early-cups-join.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/few-eagles-smash.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/few-games-count.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/five-islands-rule.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/five-wasps-mix.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/forty-clocks-remain.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/forty-countries-repeat.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
5 changes: 5 additions & 0 deletions .changeset/fresh-teachers-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@benjaminbours/composite-core": patch
---

Update three.js version
2 changes: 1 addition & 1 deletion .changeset/healthy-eggs-lick.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/loud-experts-float.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/nervous-apes-explain.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/olive-sheep-eat.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": major
"@benjaminbours/composite-core-api-client": major
"@benjaminbours/composite-core": major
"composite-front": major
"composite-back": major
Expand Down
2 changes: 1 addition & 1 deletion .changeset/pink-socks-hang.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/polite-melons-type.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/poor-cherries-burn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
7 changes: 5 additions & 2 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"initialVersions": {
"composite-back": "0.4.0",
"composite-front": "0.4.0",
"@benjaminbours/composite-api-client": "0.0.1",
"@benjaminbours/composite-core": "0.3.0"
"@benjaminbours/composite-core-api-client": "0.0.1",
"@benjaminbours/composite-core": "0.3.0",
"real_time_api": "0.0.1"
},
"changesets": [
"blue-books-draw",
Expand All @@ -24,6 +25,7 @@
"five-wasps-mix",
"forty-clocks-remain",
"forty-countries-repeat",
"fresh-teachers-tan",
"green-cars-flash",
"healthy-ants-visit",
"healthy-eggs-lick",
Expand All @@ -35,6 +37,7 @@
"pink-socks-hang",
"polite-melons-type",
"poor-cherries-burn",
"sharp-tables-hope",
"short-rules-sort",
"six-files-boil",
"sixty-ducks-bow",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/sharp-tables-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@benjaminbours/composite-core": patch
---

Add fix when wrong three.js instance where patched for three-mesh-bvh
2 changes: 1 addition & 1 deletion .changeset/six-files-boil.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/slow-shirts-return.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/smooth-plants-scream.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/sour-files-hug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/strange-knives-melt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/ten-buttons-rhyme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"composite-front": patch
"composite-back": patch
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/thin-candles-notice.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
2 changes: 1 addition & 1 deletion .changeset/tidy-kiwis-wink.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
"composite-back": patch
"composite-front": patch
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
---

Expand Down
2 changes: 1 addition & 1 deletion .changeset/unlucky-owls-work.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@benjaminbours/composite-api-client": patch
"@benjaminbours/composite-core-api-client": patch
"@benjaminbours/composite-core": patch
"composite-front": patch
"composite-back": patch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push backend image
name: Push core_api image

on:
workflow_dispatch:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Get version
id: package
run: echo "::set-output name=version::$(node -p "require('./back/package.json').version")"
run: echo "::set-output name=version::$(node -p "require('./core_api/package.json').version")"

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand All @@ -45,12 +45,12 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./back/Dockerfile.back
file: ./core_api/Dockerfile
target: final
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/composite-back:${{ steps.package.outputs.version }},
${{ secrets.DOCKERHUB_USERNAME }}/composite-back:latest
${{ secrets.DOCKERHUB_USERNAME }}/composite-core_api:${{ steps.package.outputs.version }},
${{ secrets.DOCKERHUB_USERNAME }}/composite-core_api:latest
build-args: |
POSTGRES_USER=${{ secrets.POSTGRES_USER }}
POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Install, test and build API
name: Install, test and build core_api

# on: [pull_request, workflow_dispatch]
on:
workflow_dispatch:
pull_request:
paths:
- 'back/**'
- 'core_api/**'

jobs:
build:
Expand Down Expand Up @@ -44,16 +44,16 @@ jobs:
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list -w back
run: npm list -w core_api

- name: Install dependencies
run: npm install -w packages -w back && cd back && npx prisma generate
run: npm install -w packages -w core_api && cd core_api && npx prisma generate

- name: Build packages
run: npm run build -w packages

- name: Lint
run: npm run lint -w back
run: npm run lint -w core_api

- name: Build the project
run: npm run build -w back
run: npm run build -w core_api
File renamed without changes.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cSpell.words": [
"Collidable",
"gsap",
"hathora",
"Leaderboard",
"phong"
]
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18-alpine AS base
WORKDIR /app
COPY . .

RUN apk add --update --no-cache \
make \
g++ \
py3-pip \
libc6-compat && \
npm i && \
npm run build -w packages && \
npm cache clean --force && \
rm -rf /var/cache/apk/*
20 changes: 20 additions & 0 deletions Dockerfile.base.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*
!.npmrc

!front
front/node_modules
front/.next

!core_api
core_api/node_modules
core_api/dist

!real_time_api
real_time_api/node_modules
real_time_api/dist

!packages
packages/core/node_modules
packages/core-api-client/node_modules

!./package.json
Loading
Loading