Skip to content

Dev 44 develop boilerplate new appointment booking app#1062

Merged
chrsamp merged 18 commits into
developfrom
dev-44-develop-boilerplate-new-appointment-booking-app
May 20, 2026
Merged

Dev 44 develop boilerplate new appointment booking app#1062
chrsamp merged 18 commits into
developfrom
dev-44-develop-boilerplate-new-appointment-booking-app

Conversation

@veenupunyani
Copy link
Copy Markdown
Collaborator

This pull request sets up the initial boilerplate for a React + TypeScript project using Vite, including configuration for linting, formatting, and TypeScript. It establishes basic project structure, tooling, and a minimal application entry point, making the repository ready for further development.

Project setup and configuration:

  • Added initial package.json with scripts for development, build, linting, formatting, type-checking, and license checking, and included all necessary dependencies and devDependencies for React, TypeScript, Vite, ESLint, and Prettier.
  • Configured TypeScript with tsconfig.json, tsconfig.app.json, and tsconfig.node.json for strict type-checking, modern module resolution, and path aliases. [1] [2] [3]
  • Added Vite configuration in vite.config.ts with React plugin and path alias for @ to the src directory.

Linting and formatting:

  • Added ESLint configuration in eslint.config.js with recommended rules for JavaScript, TypeScript, React hooks, React Refresh, and Prettier integration.
  • Added Prettier configuration in .prettierrc to enforce code style.
  • Added .gitignore to exclude logs, build output, node_modules, and editor files.

Base application structure:

  • Added index.html as the entry point, src/main.tsx to bootstrap the React app, and a minimal App.tsx component with placeholder content. [1] [2] [3]
  • Created an empty src/index.css for future styling.

Documentation:

  • Added a detailed README.md with setup instructions, information about the stack, and guidance on extending ESLint configuration for production use.

…n system

- Create folder structure (components, services, models, utils, hooks)
- Install @bcgov/design-system-react-components and @bcgov/design-tokens
- Create Layout, Page, and Button wrapper components
- Add BC Gov branding and styling (header, footer, theme colors)
- Update license-check to include 0BSD (permissive)
- All quality gates pass: type-check, lint, license-check, build
Introduce a multi-stage Dockerfile for the appointment-booking SSR application. The builder stage uses node:22-alpine to install dependencies (npm ci --legacy-peer-deps), copy source, and run the build. The runtime stage installs production dependencies, copies built artifacts (dist, server.js, public) from the builder, exposes port 5173, configures a healthcheck against /config/runtime-config.json, sets NODE_ENV=production, and runs server.js.
@veenupunyani
Copy link
Copy Markdown
Collaborator Author

Summary

This PR delivers the initial boilerplate for the new appointment-booking React app. It sets up a working foundation with SSR, API connectivity to the Q backend, automated checks, and Docker support so feature work can start on a stable base.

What was implemented

  1. Created a new React + TypeScript app structure for appointment-booking.
  2. Added SSR server flow with runtime config endpoint.
  3. Wired API proxy support for /api/v1 calls to backend.
  4. Added foundational services:
    • runtime config loader
    • API client with timeout and error handling
    • booking API groundwork
  5. Added initial automated tests for app bootstrap and API client behavior.
  6. Added frontend quality checks for lint, type-check, test, build, and license compliance.
  7. Added production Dockerfile and validated image build.
  8. Updated onboarding README with clean start steps and local startup shortcuts.
  9. Added local startup helper command for macOS/local backend target.
  10. Added automatic frontend port fallback if 5173 is busy.

Steps to Test

Pull up this branch:

git fetch origin
git checkout dev-44-develop-boilerplate-new-appointment-booking-app
  1. Start database from repo root:
docker start citz-sbc-queue-postgres-1

If not present:

docker compose up -d db
  1. Start backend in terminal A:
cd api
uv sync
DATABASE_HOST=127.0.0.1 DATABASE_PORT=5432 DATABASE_NAME=sbc_queue DATABASE_USERNAME=postgres DATABASE_PASSWORD=postgres uv run gunicorn wsgi --bind=0.0.0.0:5100 --access-logfile=- --config=gunicorn_config.py --reload --timeout=0
  1. Start frontend in terminal B:
cd appointment-booking
npm install --legacy-peer-deps
npm run dev:local
  1. Validate endpoints:
curl -i http://localhost:5173/config/runtime-config.json
curl -i http://localhost:5173/api/v1/healthz/
curl -i http://localhost:5173/api/v1/offices/
  1. Run full quality checks:
npm run ci:check
  1. Validate Docker build:
docker build -t appointment-booking:test .

Expected results

  1. Frontend starts successfully.
  2. Backend connectivity is confirmed from UI and curl checks.
  3. Automated checks pass with one command.
  4. Docker image builds successfully.

Notes

  1. On macOS, port 5000 may be occupied by Control Center/AirTunes. This PR uses backend port 5100 for local runs.
  2. This PR is boilerplate/foundation only. Booking feature flows, WCAG hardening, and full E2E user journeys are follow-up work.

@veenupunyani veenupunyani marked this pull request as ready for review May 15, 2026 23:00
Removed unnecessary commands from the setup instructions.
Copy link
Copy Markdown
Collaborator

@chrsamp chrsamp left a comment

Choose a reason for hiding this comment

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

Hey @veenupunyani,

Overall, this is a great foundation. I only have a few small comments (with the exception of the proxy issue below). I’m especially glad to see SSR included up front, along with the Dockerfile and a quick smoke test for API connectivity.

We can chat offline, but I’d like to better understand the choice of a vanilla React + Vite app versus something like Next. To be clear, I don’t have concerns with the approach itself. I just want to make sure I understand the rationale, since once we need SSR, routing, caching, and similar concerns, not using a framework tends to be the less common path. I’d like to be well-versed in why we’re choosing it here.

I also had a question about the API request proxying around the macOS port 5000 issue. I see where you’re coming from, but I don’t think I fully understand the tradeoff yet. It’s causing some issues for me locally, and I’d be curious whether you’re seeing the same thing. If we do need to proxy requests, I think it may be worth using Vite’s built-in dev proxy rather than maintaining our own custom proxy.

One other thought: there are already tasks defined in .vscode/launch.json for starting services, and we could extend those to include a new task for the appointment-booking frontend. There’s also a compound task for starting all services, which works both locally and in a dev container. Since the root README.md already covers things like database bootstrapping, environment setup, and service startup, I think it may be cleaner for this README to point users there and stay focused on frontend-specific instructions.

Nice work getting this set up. This gives us a solid base to iterate from.

Comment thread appointment-booking/package.json Outdated
Comment thread appointment-booking/src/entry-client.tsx
Comment thread appointment-booking/src/services/booking-api.service.ts
Comment thread appointment-booking/server.js Outdated
Comment thread appointment-booking/src/components/common/Layout.tsx Outdated
Remove legacy npm flags and tidy dev setup for the appointment-booking app.

Updated CI workflow and Dockerfile to use plain `npm ci`, added a VS Code launch configuration for the SSR front end, and added a recorded CI output file. README was simplified and clarified (dev vs prod proxy vars and startup steps). package-lock.json was adjusted to reflect dependency/peer changes and an unused Button component was removed along with small frontend/config tweaks. also removed hardcoded css by importing the bc desing system css file
Add an explicit step to the appointment-booking GitHub Actions workflow to install npm@11 globally prior to running npm ci to ensure a consistent npm version in the CI environment. The package-lock.json was updated by npm as part of this change.
@sonarqubecloud
Copy link
Copy Markdown

@veenupunyani
Copy link
Copy Markdown
Collaborator Author

hi @chrsamp thanks for the thorough review, I have now fixed these issues/concerns, please re-review the PR.

@veenupunyani veenupunyani requested a review from chrsamp May 19, 2026 23:31
Copy link
Copy Markdown
Collaborator

@chrsamp chrsamp left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀 Thanks for the quick turnaround @veenupunyani

@chrsamp chrsamp merged commit 452f0cf into develop May 20, 2026
3 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