Skip to content

chore: sync shared submodules to merged main and align app configs - #86

Merged
buzz-code merged 37 commits into
mainfrom
feat/use-shared-boilerplate
May 17, 2026
Merged

buzz-code merged 37 commits into
mainfrom
feat/use-shared-boilerplate

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Summary

  • Sync client/shared (nra-client) to latest main after PR merge
  • Sync server/shared (nra-server) to latest main after PR merge
  • Align app code with updated shared APIs:
    • pass userConfig to createSharedEntitiesImports(...) in server entities module
    • restore project-level Jest setup in client via setupFilesAfterEnv so jest-dom matchers and whatwg-fetch are loaded

Why

The shared modules changed on main, and the app needed small integration updates to compile and test cleanly against those new shared versions.

Verification

  • Backend tests: cd server && yarn test --runInBand ✅ (88/88 suites, 804 tests)
  • Frontend tests: cd client && yarn test --runInBand ✅ (14/14 suites, 105 tests)
  • Endpoint smoke tests: BACKEND_URL=http://localhost:3001 sh server/shared/utils/testing/test-all-endpoints-runner.sh ✅ (44 passed, 0 failed)

buzz-code added 20 commits May 3, 2026 09:45
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
Copilot AI review requested due to automatic review settings May 9, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/run-tests.yml Outdated
- run: yarn
- run: yarn test
tests:
uses: buzz-code/multi-repo-codespace/.github/workflows/reusable-tests.yml@main
Comment thread server/Dockerfile Outdated
Comment on lines +31 to +33
# Copy shared directory first for better layer caching
COPY shared /app/shared
# Copy the rest of the application
Comment thread docker-compose.override.yml Outdated
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 thread docker-compose.yml
Comment on lines +3 to 8
client:
container_name: client
restart: unless-stopped
depends_on:
- backend
- server
build:
Comment thread server/src/entities.module.ts Outdated
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";

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 28 changed files in this pull request and generated 2 comments.

Comment thread docker-compose.override.yml Outdated
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
buzz-code added 3 commits May 9, 2026 21:59
…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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.

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:
buzz-code added 10 commits May 10, 2026 18:59
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.
@buzz-code
buzz-code merged commit 0f847e2 into main May 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants