# Developer Agent Prompt: Develop a Working Notes App

This document outlines the development methodology, code implementation approach, technology stack strategy, code organization, and customized workflow for building a "notes app" based on the user's request.

## 1. Development Methodology

An Agile, iterative development approach will be followed, focusing on incremental delivery. Each main task defined in `.sureai/tasks_list.md` will be broken down into smaller, manageable subtasks. Progress will be tracked diligently within the `tasks_list.md` file.

## 2. Code Implementation Approach

### 2.1. Backend (Spring Boot)
- Implement RESTful APIs for comprehensive notes management (create, read, update, delete).
- Utilize Spring Data JPA for efficient and robust database interactions.
- Incorporate proper error handling, input validation, and security measures.
- Adhere strictly to the existing Spring Boot project structure, coding conventions, and best practices found in `develop_a_working_20251006_065420-develop_a_working_20251006_065420-b-b/authsec_springboot/backend/`.

### 2.2. Frontend (Angular Clarity)
- Develop a responsive and intuitive user interface for displaying, adding, editing, and deleting notes.
- Leverage Angular components, services, and routing for modularity and navigation.
- Seamlessly integrate with the backend APIs to fetch and persist notes data.
- Strictly follow the Clarity Design System guidelines for UI/UX consistency and accessibility.
- Maintain the existing Angular project structure and coding conventions found in `develop_a_working_20251006_065420-develop_a_working_20251006_065420-f-f/authsec_angular/frontend/angular-clarity-master/`.

### 2.3. Database (MySQL)
- Define a clear and efficient database schema for storing notes, including fields such as `id`, `title`, `content`, `created_at`, and `updated_at`.
- Utilize existing database migration mechanisms (e.g., `schema.sql`, `data.sql` if present, or implement Flyway/Liquibase if necessary) for managing schema changes.

## 3. Technology Stack Implementation Strategy

- **Backend (Spring Boot):** Maximize the use of Spring Boot's auto-configuration, dependency injection, and starter projects. Emphasize a clean architecture with clear separation of concerns (controllers, services, repositories, entities, DTOs).
- **Frontend (Angular Clarity):** Utilize the Angular CLI for efficient component, service, and module generation. Implement reactive forms for robust user input handling. Use Angular's `HttpClient` module for all API communications.
- **Database (MySQL):** Ensure proper indexing and relationships are defined in the database schema to optimize data retrieval and manipulation performance.

## 4. Code Organization and Structure Framework

### 4.1. Backend (`develop_a_working_20251006_065420-develop_a_working_20251006_065420-b-b/authsec_springboot/backend/src/main/java/com/realnet/develop_a_working_20251006_065420-b/`)
- `controller/`: Contains RESTful API endpoints for handling HTTP requests related to notes.
- `model/`: Defines JPA entities representing the `Note` data structure in the database.
- `repository/`: Houses Spring Data JPA interfaces for database access and persistence operations.
- `service/`: Implements the core business logic for notes management.
- `dto/`: Data Transfer Objects for efficient and structured communication between the API and the frontend.

### 4.2. Frontend (`develop_a_working_20251006_065420-develop_a_working_20251006_065420-f-f/authsec_angular/frontend/angular-clarity-master/src/app/`)
- `components/`: Reusable UI components (e.g., `NoteListComponent`, `NoteDetailComponent`, `NoteFormComponent`).
- `services/`: Angular services responsible for interacting with the backend APIs and managing frontend data state (e.g., `NoteService`).
- `models/`: TypeScript interfaces defining the structure of `Note` objects.
- `modules/`: Feature-specific Angular modules (e.g., `NotesModule`) to encapsulate related components, services, and routing.
- `routing/`: Configuration for Angular's client-side routing.

## 5. Customized Development Workflow

1.  **Understand Task:** Begin by thoroughly reading the current main task and its associated subtasks from the `.sureai/tasks_list.md` file.
2.  **Break Down (if needed):** If a subtask is complex, further break it down into smaller, more granular implementation steps.
3.  **Implement Backend Components:** Create or update the necessary Spring Boot entities, repositories, services, and controllers for notes functionality within the designated backend directory. Ensure any required database schema updates are handled.
4.  **Implement Frontend Components:** Create or update Angular components, services, and models for notes within the designated frontend directory. Implement UI logic and integrate with the newly developed backend APIs.
5.  **Run Language-Specific Checks:** After implementing code for a subtask, run relevant syntax/static checks (e.g., `npx -y tsc --noEmit` for TypeScript, Maven compile for Java).
6.  **Update `tasks_list.md`:** Mark the completed subtask with `- [x]` and update the "Currently Working On" and "Completed Tasks" sections in `.sureai/tasks_list.md`.
7.  **Main Task Testing:** Once all subtasks for a main task are complete, perform comprehensive testing for that entire main task. This includes unit tests, integration tests (if applicable), and verifying the functionality as a whole. Append ` — TEST: PASS` or ` — TEST: FAIL` to the main task header in `tasks_list.md`.
8.  **Application Smoke Test (Final Task):** After all main tasks are successfully completed and tested, execute a full application smoke test. This involves verifying the project file structure, installing all dependencies (backend and frontend), starting both the backend and frontend servers, and ensuring both processes run without errors. If errors occur, diagnose, fix, and re-run the smoke test until it passes.