Skip to content

Conversation

@Boxuan-Matty-Lin
Copy link
Owner

This pull request introduces the initial implementation of a currency converter web application, focusing on core features, UI structure, Dockerization, and development tooling. The most significant changes include the creation of a multi-stage Docker setup, the main page layout, reusable UI components for currency input and display, and improved development/testing documentation. Below are the most important changes grouped by theme:

Infrastructure & Tooling

  • Added a multi-stage Dockerfile for efficient development, build, and production deployment, including dependency installation, build, and secure runtime stages.
  • Created a comprehensive .dockerignore to exclude unnecessary files and improve Docker build performance.
  • Added components.json to configure the UI library, aliases, and icon set for consistent component development.
  • Updated the CI workflow to inject API credentials as environment variables for testing, improving test reliability and flexibility.

Documentation

  • Rewrote README.md to provide clear project overview, local and Docker-based development instructions, production deployment steps, and testing guidelines.

API & Backend

  • Implemented the /api/rates/latest API route to fetch and return AUD-based exchange rates, supporting optional currency filtering via query parameters.

UI & Frontend Structure

  • Overhauled the main page (app/page.tsx) to introduce a sidebar layout with a header and placeholder for the currency converter UI.
  • Added a ThemeProvider and utility class integration to enable dark mode and consistent theming throughout the app. [1] [2]
  • Extended and refactored globals.css to define a comprehensive color palette, support for dark mode, and improved base styles leveraging CSS variables.

UI Components

  • Introduced CurrencyAmountInput, a controlled numeric input with validation, accessible labeling, and a refresh button for updating rates.
  • Added CurrencyCard, a reusable component to display converted currency amounts, rates, and metadata in a visually appealing card format.

Boxuan-Matty-Lin and others added 22 commits October 27, 2025 15:26
update: enable PR checks for all  branch
feat(sidebar): introduce validated currency input, improve accessibility, and add tests and docs
…d-docs

Finish updating  Testing Infrastructure & Configuration& Docs for MVP 1
Finish updating README for the project, finish setting docker for the project
Copilot AI review requested due to automatic review settings October 29, 2025 13:32
@Boxuan-Matty-Lin Boxuan-Matty-Lin added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 29, 2025
@Boxuan-Matty-Lin Boxuan-Matty-Lin linked an issue Oct 29, 2025 that may be closed by this pull request
2 tasks
@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 54.92% 78 / 142
🔵 Statements 54.72% 81 / 148
🔵 Functions 54.54% 24 / 44
🔵 Branches 26.75% 42 / 157
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
components/sidebar/CurrencyAmountInput.tsx 100% 100% 100% 100%
components/sidebar/CurrencyCard.tsx 100% 87.5% 100% 100%
components/sidebar/CurrencySidebar.tsx 96.15% 75% 100% 100%
components/ui/button.tsx 100% 66.66% 100% 100%
components/ui/card.tsx 28.57% 100% 28.57% 28.57%
components/ui/chart.tsx 8.47% 0% 0% 8.47%
components/ui/index.ts 0% 0% 0% 0%
components/ui/input.tsx 100% 100% 100% 100%
components/ui/label.tsx 0% 100% 0% 0%
components/ui/skeleton.tsx 100% 100% 100% 100%
lib/utils.ts 100% 100% 100% 100%
lib/server/oxr.ts 68.42% 41.66% 100% 76.47%
lib/server/oxr_convert.ts 100% 100% 100% 100%
Generated in workflow #15 for commit 581296e by the Vitest Coverage Report Action

@Boxuan-Matty-Lin Boxuan-Matty-Lin linked an issue Oct 29, 2025 that may be closed by this pull request
7 tasks
@Boxuan-Matty-Lin Boxuan-Matty-Lin merged commit d5b9b96 into main Oct 29, 2025
6 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request transforms a Next.js starter template into a full-featured currency converter application with comprehensive testing infrastructure, Docker support, and production-ready configuration.

  • Implements currency conversion functionality using Open Exchange Rates API with AUD as base currency
  • Sets up Vitest testing infrastructure with separate unit and integration test projects
  • Adds Docker development and production deployment configurations
  • Integrates shadcn/ui component library with theme support

Reviewed Changes

Copilot reviewed 36 out of 38 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
vitest.config.mts Configures Vitest with separate unit/integration projects and coverage reporting
tsconfig.json Excludes .history directory from TypeScript compilation
setup.env.ts Loads .env.test file for test environment configuration
package.json Adds UI component libraries, testing scripts, and dotenv dependency
next.config.ts Enables standalone output mode for Docker deployment
lib/utils.ts Utility function combining clsx and tailwind-merge for className handling
lib/server/oxr_convert.ts Server-side logic for converting USD-based rates to AUD-based rates
lib/server/oxr.ts Client module for fetching exchange rates from Open Exchange Rates API
lib/server/tests/*.test.ts Unit tests for currency conversion logic with mocked dependencies
lib/server/tests/oxr.integration.test.ts Integration test hitting real OXR API with retry logic
components/ui/* shadcn/ui components (Button, Card, Chart, Input, Label, Skeleton)
components/sidebar/* Currency converter UI components with tests
components/theme-provider.tsx Wraps next-themes for light/dark mode support
app/page.tsx Main page displaying currency converter interface
app/layout.tsx Root layout with theme provider and font configuration
app/globals.css Design system CSS variables and Tailwind configuration
app/api/rates/latest/route.ts API route returning AUD-based exchange rates
Dockerfile Multi-stage Docker build with dev, builder, and runner stages
compose.*.yml Docker Compose configurations for dev and production environments
.dockerignore Excludes development files from Docker context
eslint.config.mjs Adds .history and coverage to ESLint ignore patterns
.github/workflows/cicd.yml Updates CI workflow to run integration tests when credentials available
README.md Comprehensive documentation for setup, development, testing, and deployment
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

base: "USD",
rates: { AUD: 1.0 },
}),
} as unknown as Response); // 这里返回值“长得像”Response
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Comment contains Chinese text '这里返回值"长得像"Response' which should be translated to English for consistency with the rest of the codebase. Suggested translation: 'Type assertion to Response for mock compatibility'.

Suggested change
} as unknown as Response); // 这里返回值“长得像”Response
} as unknown as Response); // Type assertion to Response for mock compatibility

Copilot uses AI. Check for mistakes.
.vscode
.idea

# Env files (改为在运行容器时注入)
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

Comment contains Chinese text '改为在运行容器时注入' which should be translated to English for consistency. Suggested translation: 'Inject at container runtime instead'.

Suggested change
# Env files (改为在运行容器时注入)
# Env files (Inject at container runtime instead)

Copilot uses AI. Check for mistakes.
@Boxuan-Matty-Lin Boxuan-Matty-Lin linked an issue Oct 29, 2025 that may be closed by this pull request
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

2 participants