Skip to content
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
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
.agents
node_modules
dist
coverage
playwright-report
test-results
.env
.env.*
npm-debug.log*
55 changes: 55 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Pull request checks

on:
pull_request:

permissions:
contents: read

jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run format:check
- run: npm run lint
- run: npm run typecheck
- run: npm test
- run: npm run coverage
- run: npm run test:smoke
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage
path: coverage/
if-no-files-found: ignore

browser-and-build:
needs: quality
if: { hashFiles('index.html', 'src/**') != '' }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- run: npm run build
- run: npm run test:e2e
env:
PLAYWRIGHT_WEB_SERVER: 'true'
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: |
playwright-report/
test-results/
if-no-files-found: ignore
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release to GitHub Pages

on:
push:
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run format:check
- run: npm run lint
- run: npm run typecheck
- run: npm test
- run: npm run coverage
- run: npx playwright install --with-deps chromium
- run: npm run test:e2e
env:
PLAYWRIGHT_WEB_SERVER: 'true'
- name: Verify application entrypoint exists
run: test -f index.html
- run: npm run build
- uses: actions/upload-pages-artifact@v3
with:
path: dist

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
dist/
coverage/
playwright-report/
test-results/
.env
.env.*
!.env.example
npm-debug.log*
*.log
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.agents/
.github/ISSUE_TEMPLATE/
node_modules/
dist/
coverage/
playwright-report/
test-results/
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "none"
}
48 changes: 48 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Agent Guidance

## Project status

This repository has an infrastructure foundation for the planned ClassFinder web application. `infrastructure_plan.md` is the source of truth for platform and tooling decisions; production application source, routes, data, and user flows are not created yet.

## Repository map

- `infrastructure_plan.md`: approved infrastructure plan.
- `package.json`, `tsconfig.json`, `eslint.config.js`, `.prettierrc.json`: TypeScript tooling.
- `Dockerfile`, `compose.yml`, `.dockerignore`: development container setup.
- `scripts/`: infrastructure smoke checks only.
- `tests/unit`, `tests/ui`, `tests/e2e`: reserved for future product tests.
- `.github/workflows/`: pull-request and GitHub Pages release automation.
- `src/`: not created yet; future frontend implementation location.
- API/backend, database, and local services: not required by the plan.
- `.agents/skills/`: local skill instructions.

## Required reading and boundaries

Read `infrastructure_plan.md`, this file, and applicable local skill instructions before changing infrastructure. Do not alter plan decisions without revising the plan through the infrastructure-planning process. Do not commit secrets, generated artifacts, `node_modules`, coverage output, or Playwright reports.

Infrastructure-only work must not create product pages, components, routes, handlers, domain models, route data, authentication, or business tests. Application work should use the frontend UI, test-driven development, browser-testing, security, documentation, review, CI/CD, and git-workflow skills as applicable; use infra-planner before changing infrastructure decisions and infra-builder to implement an approved plan.

## Verification

Run the applicable commands before a change is handed off:

```sh
npm run format:check
npm run lint
npm run typecheck
npm test
npm run coverage
npm run test:e2e
npm run test:smoke
docker compose config
```

The pull-request workflow mirrors these checks when application files and tests exist. Run `docker compose down` after local container work; do not leave containers or volumes running unintentionally.

## Change checklist

- Keep npm as the sole package manager and retain `package-lock.json`.
- Keep Docker development-only; GitHub Pages receives static build output, never a production container.
- Add or update meaningful tests with application behavior, then enforce the coverage threshold selected in the plan.
- Update this file and `README.md` whenever commands, paths, services, or workflows change.
- Use documentation and code-review skills before merging material changes.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:22.14.0-bookworm-slim

WORKDIR /workspace
USER node
CMD ["sh", "-c", "npm ci && npm run dev -- --host 0.0.0.0"]
71 changes: 70 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,70 @@
# TechStartup-Template
# ClassFinder

ClassFinder will help students enter classes and receive campus directions. The repository currently contains the development infrastructure only; production application code, screens, routing logic, and campus data have not been created.

## Repository map

- `infrastructure_plan.md` — selected infrastructure decisions.
- `package.json` — npm scripts and development dependencies.
- `Dockerfile`, `compose.yml`, `.dockerignore` — reproducible Node.js development environment.
- `scripts/` — infrastructure-only verification.
- `tests/` — future unit, UI, and end-to-end test locations; no product tests exist yet.
- `.github/workflows/` — pull-request checks and GitHub Pages release deployment.
- `.agents/skills/` — project-provided agent skills.
- `src/` — not created yet; application implementation owns this directory.

## Getting Started

### Prerequisites

1. Install [Git](https://git-scm.com/downloads) and confirm `git --version` works.
2. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) on Windows or macOS, or Docker Engine on Linux. Confirm `docker version` and `docker compose version` work.
3. Install a current browser. A code editor with TypeScript support is recommended.

Node.js and npm run inside the development container. The image is pinned to Node.js 22.14.0; update it deliberately to a supported LTS line.

### Install dependencies

On a host with Node.js 22 LTS installed, run:

```sh
npm ci
```

Or start the development environment with Docker after application code provides the Vite entrypoint:

```sh
docker compose up --build
```

The container bind-mounts the repository and keeps `node_modules` in a named volume. Stop it with:

```sh
docker compose down
```

### Verify the infrastructure

```sh
npm run format:check
npm run lint
npm run typecheck
npm test
npm run coverage
npm run test:e2e
npm run test:smoke
docker compose config
```

`npm run build` is intentionally not runnable until the application implementation adds Vite's `index.html` and entrypoint. The test commands currently validate the configured harness and pass with no product tests; application work must add meaningful tests before relying on coverage.

## GitHub configuration

The release workflow deploys version tags to GitHub Pages. Before its first release, enable GitHub Pages with **GitHub Actions** as the source and create/protect the `production` environment if an approval gate is wanted. No deployment secret is required for GitHub Pages; the workflow uses GitHub's scoped `GITHUB_TOKEN` permissions.

## Troubleshooting

- **`docker` is not recognized or the daemon is unavailable:** Start Docker Desktop (or the Docker service) and rerun `docker version`.
- **Dependency install fails:** Use Node.js 22 LTS and rerun `npm ci`; do not mix npm with another package manager.
- **Port is already in use:** Stop the process using the future Vite development port or change the Compose port mapping when application development begins.
- **GitHub Pages deployment fails:** Confirm Pages is enabled for GitHub Actions and that the repository allows the workflow's `pages: write` and `id-token: write` permissions.
13 changes: 13 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
web:
build:
context: .
ports:
- '5173:5173'
volumes:
- .:/workspace
- node_modules:/workspace/node_modules
command: sh -c "npm ci && npm run dev -- --host 0.0.0.0"

volumes:
node_modules:
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const js = require('@eslint/js');
const globals = require('globals');
const tseslint = require('typescript-eslint');
const prettier = require('eslint-config-prettier');

module.exports = tseslint.config(
{
ignores: [
'coverage/**',
'dist/**',
'node_modules/**',
'playwright-report/**',
'test-results/**'
]
},
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['eslint.config.js'],
rules: { '@typescript-eslint/no-require-imports': 'off' }
},
{
files: ['**/*.{js,mjs,cjs,ts,tsx}'],
languageOptions: { globals: { ...globals.browser, ...globals.node } }
},
prettier
);
Loading