|
| 1 | +# Agent Instructions for Frontend Development |
| 2 | + |
| 3 | +This document provides instructions for AI agents working on the frontend of this project. |
| 4 | + |
| 5 | +## Repository Summary |
| 6 | + |
| 7 | +This repository contains a full-stack application with a Python backend and a React frontend. The frontend is built with TypeScript, Vite, and Tailwind CSS. |
| 8 | + |
| 9 | +**Primary Language**: TypeScript |
| 10 | +**Framework**: React (with Vite) |
| 11 | +**Styling**: Tailwind CSS |
| 12 | +**Linting**: ESLint |
| 13 | +**Testing**: Vitest |
| 14 | + |
| 15 | +## Build and Validation Instructions |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +**CRITICAL**: Always run dependency installation before any build or test operations. All commands should be run from the `frontend` directory. |
| 20 | + |
| 21 | +```bash |
| 22 | +# Navigate to the frontend directory |
| 23 | +cd frontend |
| 24 | + |
| 25 | +# Install dependencies |
| 26 | +npm install |
| 27 | +``` |
| 28 | + |
| 29 | +### Development |
| 30 | + |
| 31 | +To start the development server, run the following command from the `frontend` directory: |
| 32 | + |
| 33 | +```bash |
| 34 | +npm run dev |
| 35 | +``` |
| 36 | + |
| 37 | +### Build |
| 38 | + |
| 39 | +To build the frontend for production, run the following command from the `frontend` directory: |
| 40 | + |
| 41 | +```bash |
| 42 | +npm run build |
| 43 | +``` |
| 44 | + |
| 45 | +### Linting |
| 46 | + |
| 47 | +To run the linter, use the following command from the `frontend` directory: |
| 48 | + |
| 49 | +```bash |
| 50 | +npm run lint |
| 51 | +``` |
| 52 | + |
| 53 | +### Testing |
| 54 | + |
| 55 | +**CURRENT STATE**: The testing framework (`vitest`) is set up, but the tests are currently not running due to a known environment issue (`uv_cwd` error). |
| 56 | + |
| 57 | +To run the tests (once the environment issue is resolved), use the following command from the `frontend` directory: |
| 58 | + |
| 59 | +```bash |
| 60 | +npm run test |
| 61 | +``` |
| 62 | + |
| 63 | +To run the tests with the UI, use the following command: |
| 64 | + |
| 65 | +```bash |
| 66 | +npm run test:ui |
| 67 | +``` |
| 68 | + |
| 69 | +## Project Layout and Architecture |
| 70 | + |
| 71 | +The frontend code is located in the `frontend/` directory. |
| 72 | + |
| 73 | +``` |
| 74 | +frontend/ |
| 75 | +├── src/ |
| 76 | +│ ├── components/ → Shared UI components |
| 77 | +│ ├── features/ → Main feature modules |
| 78 | +│ ├── pages/ → Application pages |
| 79 | +│ ├── stores/ → Global state management |
| 80 | +│ ├── types/ → Shared type definitions |
| 81 | +│ └── ... |
| 82 | +├── public/ → Static assets |
| 83 | +├── index.html → Main HTML file |
| 84 | +├── main.tsx → Application entry point |
| 85 | +└── ... |
| 86 | +``` |
| 87 | + |
| 88 | +## Critical Instructions for Coding Agents |
| 89 | + |
| 90 | +**ALWAYS do the following before making changes:** |
| 91 | + |
| 92 | +1. **Navigate to the `frontend` directory**: `cd frontend` |
| 93 | +2. **Install dependencies**: `npm install` |
| 94 | +3. **Run the linter before committing**: `npm run lint` |
| 95 | +4. **Follow the component structure**: Place new components in the appropriate feature or components directory. |
| 96 | +5. **Keep dependencies up to date**: If you add a new dependency, make sure to add it to the `package.json` file. |
| 97 | +6. **Use the PR template**: When submitting a pull request, please use the provided template. |
| 98 | + |
| 99 | +**NEVER do the following:** |
| 100 | + |
| 101 | +* Do not commit code that fails the linting checks. |
| 102 | +* Do not commit code that breaks the build. |
| 103 | +* Do not add large files to the repository. |
| 104 | + |
| 105 | +**Trust these instructions** - only search for additional information if these instructions are incomplete or found to be incorrect. The testing issue is a known limitation. |
0 commit comments