Repository navigation
chore: sync shared submodules to merged main and align app configs - #86
Merged
Merged
Conversation
…client/server/database
…t assignments in override template (Day 11)
…buildResources API update)
Add build+migrate step to dev server command so TypeORM migrations run automatically when the container starts in dev mode. Before: CMD yarn start:dev (migrations never ran in dev) After: yarn build && typeorm migration:run && yarn start:dev
…li-ts/run:ts duplicates
…emove duplicate AGENTS.md
There was a problem hiding this comment.
Pull request overview
Syncs the client/shared and server/shared submodules to the latest main and updates the application code/config to match the updated shared APIs, ensuring the repo builds, tests, and boots cleanly against the new shared baselines.
Changes:
- Server: migrate to shared bootstrap/base app module and update DI wiring for user initialization.
- Server entities: switch to shared entity import helper (
createSharedEntitiesImports(userConfig)) to align shared entity registration. - Client/tooling: centralize Vite/Jest config via shared base configs; adjust Docker Compose service naming and dev overrides.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/user-init.module.ts | Exposes the user initialization service via the shared injection token. |
| server/src/main.ts | Uses shared bootstrapNraApplication entrypoint. |
| server/src/entities.module.ts | Uses createSharedEntitiesImports(userConfig) and trims explicit shared entity registrations. |
| server/src/app.service.ts | Removes legacy hello-world service. |
| server/src/app.module.ts | Replaces local Nest module wiring with shared BaseNraAppModule.forRoot(...). |
| server/src/app.controller.ts | Removes legacy controller (auth/profile/health/hello endpoints presumably moved to shared base app). |
| server/src/tests/app.service.spec.ts | Removes tests tied to deleted legacy service. |
| server/src/tests/app.module.spec.ts | Removes tests tied to deleted legacy module structure. |
| server/src/tests/app.controller.spec.ts | Removes tests tied to deleted legacy controller. |
| server/package.json | Tweaks TypeORM CLI invocation and adds a prettier script. |
| server/jest.config.js | Delegates Jest config to shared base config helper. |
| server/Dockerfile | Improves build layering and adjusts copy strategy. |
| docker-compose.yml | Renames services (client/server/database) and aligns dependencies. |
| docker-compose.override.yml.template | Updates dev override template (service names, env, healthchecks, volumes). |
| docker-compose.override.yml | Adds a concrete dev override file mirroring the template. |
| client/vite.config.js | Delegates Vite config to shared createViteConfig(). |
| client/src/App.jsx | Uses shared buildResources(...) to generate admin resources list. |
| client/jest.config.js | Delegates Jest config to shared base and restores project setup file. |
| client/Dockerfile | Normalizes Dockerfile and dev env handling. |
| client/.gitignore | Ignores .vite-cache/. |
| AGENTS.md | Removes agent workflow documentation file. |
| .gitignore | Stops ignoring docker-compose.override.yml. |
| .github/workflows/run-tests.yml | Switches to a reusable workflow for CI tests. |
| .github/workflows/copilot-setup-steps.yml | Adds Copilot setup workflow to install dependencies (with submodules). |
| .env.template | Updates default MYSQL_HOST to database. |
| - run: yarn | ||
| - run: yarn test | ||
| tests: | ||
| uses: buzz-code/multi-repo-codespace/.github/workflows/reusable-tests.yml@main |
Comment on lines
+31
to
+33
| # Copy shared directory first for better layer caching | ||
| COPY shared /app/shared | ||
| # Copy the rest of the application |
| PORT: 3000 | ||
| REACT_APP_API_URL: http://localhost:3001 | ||
| ports: | ||
| - "3000:3000" |
| REACT_APP_API_URL: http://localhost:3001 | ||
| ports: | ||
| - "3000:3000" # Main Vite dev server port | ||
| - "3000:3000" |
Comment on lines
+3
to
8
| client: | ||
| container_name: client | ||
| restart: unless-stopped | ||
| depends_on: | ||
| - backend | ||
| - server | ||
| build: |
| import { Student } from "./db/entities/Student.entity"; | ||
| import { Teacher } from "./db/entities/Teacher.entity"; | ||
| import { registerEntityNameMap } from '@shared/entities/configs/import-file.config'; | ||
| import userConfig from "../shared/entities/configs/user.config"; |
Comment on lines
+1
to
+3
| version: "3" | ||
| name: react-admin-nestjs-dev | ||
| services: |
| @@ -48,14 +23,10 @@ jobs: | |||
| cache-dependency-path: server/yarn.lock | |||
| - run: yarn | |||
| - run: yarn test | |||
…gitignore
- CI: restore prepare job with dorny/paths-filter@v2 so tests only run
when relevant client/** or server/** paths changed
- App.jsx: restore recordRepresentation on student_by_year (CommonRepresentation),
grade_effect_by_user and abs_count_effect_by_user ('effect'); these 3 resources
need the old conditional-spread pattern since buildResources doesn't support
recordRepresentation
- .gitignore: re-add docker-compose.override.yml (should stay local, not committed)
- AGENTS.md: restore deleted file from main
- App.jsx: split adminResources into preStudentResources and postStudentResources so student (with nested route) is declared between lesson and student_klass, restoring the original data-group menu order - main.ts: pass explicit swagger title/description/tag to bootstrapNraApplication instead of relying on package.json name
buildResources DSL adds more complexity than it removes here: - student needs nested route (can't use DSL) - 3 admin resources need recordRepresentation (can't use DSL) - splits a simple sequential list into two arrays + inline elements The original flat style is cleaner and easier to read.
Comment on lines
20
to
36
| volumes: | ||
| - ./client:/app | ||
| - ./client/node_modules:/app/node_modules | ||
| networks: | ||
| - private-network | ||
|
|
||
| backend: | ||
| container_name: backend-dev | ||
| server: | ||
| container_name: ran-server-dev | ||
| build: | ||
| target: development | ||
| command: sh -c "yarn typeorm:run && yarn start:dev" | ||
| ports: | ||
| - "3001:3000" # Map container port 3000 to host port 3001 | ||
| - "3001:3000" | ||
| volumes: | ||
| - ./server:/app | ||
| - ./server/node_modules:/app/node_modules | ||
| networks: |
Host bind-mounts (./client/node_modules:/app/node_modules) break when the host directory doesn't exist (Docker creates a root-owned empty dir that blocks yarn install) and fail on non-Linux hosts with native modules. Anonymous volumes (/app/node_modules) let Docker own the directory, matching the documented strategy in AGENTS.md.
… to override base file's external:true)
… relies on host-mounted deps)
…a works for column type inference
… decorator metadata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client/shared(nra-client) to latestmainafter PR mergeserver/shared(nra-server) to latestmainafter PR mergeuserConfigtocreateSharedEntitiesImports(...)in server entities modulesetupFilesAfterEnvsojest-dommatchers andwhatwg-fetchare loadedWhy
The shared modules changed on
main, and the app needed small integration updates to compile and test cleanly against those new shared versions.Verification
cd server && yarn test --runInBand✅ (88/88 suites, 804 tests)cd client && yarn test --runInBand✅ (14/14 suites, 105 tests)BACKEND_URL=http://localhost:3001 sh server/shared/utils/testing/test-all-endpoints-runner.sh✅ (44 passed, 0 failed)