This repository is a Proof of Concept (POC) for testing techniques to use GitHub Copilot Agent Mode at its best. The goal is to build a mortgage calculator in a quick and solid way, leveraging the power of GitHub Copilot Agent Mode for rapid development.
This POC aims to:
- Create a modern, accessible mortgage calculator frontend
- Demonstrate rapid development with GitHub Copilot Agent Mode
- Implement best practices for Svelte development
- Showcase test-driven development (TDD) with comprehensive testing
- Serve as a reference for GitHub Copilot agent mode optimization
- Interactive mortgage calculation with real-time updates
- Responsive design with clean visual hierarchy
- Accessibility-first approach (WCAG 2.1 AA compliance)
- TypeScript for type safety
- Modern testing setup with Vitest and Playwright
- Svelte 5 - Modern reactive framework with runes system
- SvelteKit - Full-stack Svelte framework
- Vite - Fast build tool and development server
- TypeScript - Type safety and enhanced developer experience
- Vitest - Unit testing framework
- Playwright - Browser testing (optional)
- ESLint - Code linting
- Prettier - Code formatting
- Node.js 20+ (verified with v20.19.4)
- npm 10+ (verified with v10.8.2)
This project includes a convenient Makefile for common development tasks:
# See all available commands
make help
# Using Makefile (recommended)
make install
# Or using npm directly
npm install
# Using Makefile (recommended)
make run
# Or using npm directly
npm run dev
The application will be available at http://localhost:5173/
# Using Makefile (recommended)
make build
# Or using npm directly
npm run build
You can preview the production build with make preview
or npm run preview
.
The project uses:
- @sveltejs/adapter-static for static site generation
- GitHub Actions workflow (
.github/workflows/deploy.yml
) for CI/CD - Base path configuration for GitHub Pages subpath deployment
- Prerendering enabled for all routes
Key configuration for GitHub Pages deployment:
// svelte.config.js
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: undefined,
precompress: false,
strict: true
}),
paths: {
base: process.env.NODE_ENV === 'production'
? '/github-copilot-agent-mode-frontend-poc'
: ''
}
# Using Makefile (recommended)
make format # Format code
make lint # Check code style and run linting
make check # Run TypeScript type checking
# Or using npm directly
npm run format # Format code
npm run lint # Lint code
npm run check # Type check
This project follows a comprehensive testing approach:
- Unit Tests: Business logic and utility functions (working)
- Component Tests: Svelte component behavior (requires Playwright)
- Integration Tests: User workflows and data flow
- Accessibility Tests: Automated a11y validation
- End-to-End (E2E) Tests: Full browser automation and visual checks using Playwright
# Using Makefile (recommended)
make test # Run all tests (Vitest unit/server tests)
make test-server # Run server-side tests only (no browser required)
make test-browser # Run browser tests only (requires Playwright browsers)
make test-e2e # Run Playwright E2E tests (full browser automation)
# Or using npm/Playwright directly
npm run test # Run all Vitest tests
npx playwright test # Run all Playwright E2E tests
E2E Playwright Details:
- Playwright E2E tests are in the
e2e/tests/
directory. - The
playwright.config.ts
file ensures the SvelteKit dev server is started automatically. - For interactive debugging, use:
npx playwright test --ui
- E2E tests are the preferred way to visually verify your app in a real browser and are separate from Vitest unit/server tests.
Note: Browser tests require Playwright browsers to be installed:
# Using Makefile (recommended)
make install-browsers
# Or using npm directly
npx playwright install --with-deps
The test runner automatically detects if Playwright browsers are available and gracefully falls back to server-side tests only when browsers are not installed.
This project follows a comprehensive testing approach:
- Unit Tests: Business logic and utility functions (working)
- Component Tests: Svelte component behavior (requires Playwright)
- Integration Tests: User workflows and data flow
- Accessibility Tests: Automated a11y validation
# Using Makefile (recommended)
make test # Run all tests (automatically detects browser availability)
make test-server # Run server-side tests only (no browser required)
make test-browser # Run browser tests only (requires Playwright browsers)
make test-unit # Run unit tests only
# Or using npm directly
npm run test # Run all tests (automatically detects browser availability)
npm run test:unit # Run unit tests only
npm run test:server # Run server-side tests only (no browser required)
npm run test:browser # Run browser tests only (requires Playwright browsers)
Note: Browser tests require Playwright browsers to be installed:
# Using Makefile (recommended)
make install-browsers
# Or using npm directly
npx playwright install --with-deps
The test runner automatically detects if Playwright browsers are available and gracefully falls back to server-side tests only when browsers are not installed.
This project includes a comprehensive Makefile that provides convenient shortcuts for all development tasks. The Makefile follows best practices and includes a helpful command reference.
make help # Show all available commands with descriptions
make install # Install all dependencies
make run # Start development server
make test # Run all tests
make build # Build for production
-
Setup & Installation:
make install
- Install all dependenciesmake install-browsers
- Install Playwright browsers for browser testing
-
Development:
make run
/make dev
- Start development servermake build
- Build for productionmake preview
- Preview production build locallymake dev-setup
- Full development setup
-
Testing:
make test
- Run all tests (requires Playwright browsers for full suite)make test-server
- Run server-side tests only (no browser required)make test-browser
- Run browser tests only (requires Playwright browsers)make test-unit
- Run unit tests only
-
Code Quality:
make lint
- Check code style and run lintingmake format
- Format code with Prettiermake check
- Run TypeScript type checking
-
Maintenance:
make clean
- Clean build artifacts and node_modulesmake ci
- Run CI pipeline (lint, check, build, test-server)make audit
- Run npm audit for security vulnerabilities
- Simplified Commands - Shorter, memorable commands (
make run
vsnpm run dev
) - Consistency - Same commands work across different projects
- Documentation - Built-in help system with
make help
- Best Practices - Follows standard Makefile conventions
- Error Handling - Better error messages and status indicators
- Workflow Shortcuts - Combined commands like
make ci
for complete CI pipeline
- Color Scheme: ING Orange (#FF6200) primary, complementary blues/grays
- Layout: Card-based design with clear visual hierarchy
- Typography: Clean, modern, accessible fonts
- WCAG 2.1 AA compliance required
- Proper ARIA labels and semantic HTML
- Keyboard navigation support
- Screen reader compatibility
- Minimum 44px touch targets for mobile
- High contrast color ratios
Repository root:
βββ .github/ # Copilot instructions and GitHub config
βββ docs/ # Design, accessibility, and UX documentation
βββ e2e/ # Playwright end-to-end (E2E) tests
βββ src/
β βββ lib/
β β βββ assets/ # Static assets (e.g., favicon)
β β βββ components/ # Svelte components and their tests
β β βββ index.ts # Library exports
β βββ routes/ # SvelteKit pages and layouts
β βββ app.d.ts # TypeScript app definitions
β βββ app.html # HTML template
βββ static/ # Public static files
βββ Makefile # Development task automation
βββ package.json # Dependencies and scripts
βββ playwright.config.ts # Playwright E2E test config
βββ svelte.config.js # SvelteKit configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite/Vitest configuration
βββ README.md # Project documentation (this file)
Tip: For a full breakdown of design, accessibility, and UX standards, see the
docs/
folder. For E2E/browser tests, see thee2e/
folder andplaywright.config.ts
.
This project serves as a testing ground for exploring the capabilities and best practices of GitHub Copilot Agent Mode in frontend development scenarios.
For detailed instructions on working with this codebase using GitHub Copilot, see .github/copilot-instructions.md.
This project is licensed under the MIT License.