# GitHub Copilot Instructions for Finance App ## Project Overview This project is a financial transaction management application built with Astro and TypeScript, using Prisma for database operations. It follows a two-column dashboard layout for managing bank accounts and transactions. ## Technology Stack * **Framework:** Astro (latest version) * **Language:** TypeScript, JavaScript (client-side scripts), HTML, CSS * **Styling:** Plain CSS (`src/styles/global.css`) * **Data:** Using Astro's built-in API routes in `src/pages/api/` with persistent database storage via Prisma ORM (`src/data/db.service.ts`). * **Development Environment:** VS Code Dev Container using private Docker image (`ghcr.io/acedanger/finance-devcontainer:latest`) ## Development Environment * **Dev Container:** The project uses a VS Code Dev Container for consistent development environments. * Container configuration in `.devcontainer/devcontainer.json` * Uses a private container image hosted on GitHub Container Registry * Image: `ghcr.io/acedanger/finance-devcontainer:latest` * Includes all necessary development tools and extensions * Configured with GitHub CLI and authentication * Features Docker-in-Docker support for additional container needs * **Container Features:** * Node.js and npm pre-installed * Git and GitHub CLI configured * TypeScript support * VS Code extensions pre-configured * Docker-in-Docker capability * Automatic GitHub authentication * **Authentication:** * Requires GitHub Personal Access Token for private container access * Token should be configured in `.devcontainer/.env` * GitHub CLI authentication handled in post-start command ## Current State & Key Features * **Layout:** A two-column dashboard layout (`src/layouts/BaseLayout.astro`, `src/pages/index.astro`) is implemented. * **Sidebar:** (`src/components/Sidebar.astro`) Contains account selection dropdown and a collapsible section for adding new transactions. Includes an account summary section. * **Main Content:** (`src/components/MainContent.astro`) Displays the header with the current account name and the transaction list. * **Components:** Separate Astro components exist for major UI sections (Sidebar, MainContent, TransactionTable, AddTransactionForm, AccountSummary). * **API Integration:** * API routes structure implemented in `src/pages/api/` * Database integration using Prisma ORM in `src/data/db.service.ts` * All API endpoints implemented and fully functional: * GET /api/accounts - List all accounts * GET /api/accounts/:id - Get single account details * GET /api/accounts/:id/transactions - Get transactions for an account * POST /api/transactions - Create new transaction * PUT /api/transactions/:id - Update existing transaction * DELETE /api/transactions/:id - Delete transaction * Comprehensive error handling and validation * Database persistence with proper transaction support * **Account Switching:** Selecting an account from the dropdown in the sidebar correctly updates the Main Content area (header, transaction table) and the Account Summary section using client-side JavaScript (`