{"id":2839,"date":"2025-07-27T06:06:36","date_gmt":"2025-07-27T06:06:36","guid":{"rendered":"https:\/\/codeinsightacademy.com\/blog\/?p=2839"},"modified":"2025-07-27T06:10:07","modified_gmt":"2025-07-27T06:10:07","slug":"rest-api-crud-project","status":"publish","type":"post","link":"https:\/\/codeinsightacademy.com\/blog\/java\/rest-api-crud-project\/","title":{"rendered":"Rest API CRUD Project"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image.png\"><img loading=\"lazy\" width=\"758\" height=\"276\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image.png\" alt=\"\" class=\"wp-image-2840\" srcset=\"https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image.png 758w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-300x109.png 300w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1.png\"><img loading=\"lazy\" width=\"1024\" height=\"527\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1-1024x527.png\" alt=\"\" class=\"wp-image-2841\" srcset=\"https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1-1024x527.png 1024w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1-300x154.png 300w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1-768x395.png 768w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-1.png 1051w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><figcaption>listing.html<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-2.png\"><img loading=\"lazy\" width=\"693\" height=\"429\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-2.png\" alt=\"\" class=\"wp-image-2842\" srcset=\"https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-2.png 693w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-2-300x186.png 300w\" sizes=\"(max-width: 693px) 100vw, 693px\" \/><\/a><figcaption>add.html<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-3.png\"><img loading=\"lazy\" width=\"657\" height=\"567\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-3.png\" alt=\"\" class=\"wp-image-2845\" srcset=\"https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-3.png 657w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-3-300x259.png 300w\" sizes=\"(max-width: 657px) 100vw, 657px\" \/><\/a><figcaption>details.html<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-4.png\"><img loading=\"lazy\" width=\"714\" height=\"400\" src=\"https:\/\/codeinsightacademy.com\/blog\/http:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-4.png\" alt=\"\" class=\"wp-image-2847\" srcset=\"https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-4.png 714w, https:\/\/codeinsightacademy.com\/blog\/wp-content\/uploads\/2025\/07\/image-4-300x168.png 300w\" sizes=\"(max-width: 714px) 100vw, 714px\" \/><\/a><figcaption>edit.html<\/figcaption><\/figure>\n\n\n\n<h1 id=\"product-requirements-document-prd\">Product Requirements Document (PRD)<\/h1>\n\n\n\n<p><strong>Project:<\/strong> Employee Management CRUD System<br><strong>Date:<\/strong> July 27, 2025<br><strong>Author:<\/strong> [Your Name]<\/p>\n\n\n\n<h2 id=\"1-purpose--background\">1. Purpose &amp; Background<\/h2>\n\n\n\n<p>The Employee Management CRUD System aims to provide a simple web-based interface and REST API to manage employee records efficiently. It fulfills the need to maintain essential employee data such as ID, name, department, and salary with complete create, read, update, and delete functionalities.<\/p>\n\n\n\n<p>This product will be used internally by HR staff and managers to maintain an up-to-date employee database with easy access to employee details.<\/p>\n\n\n\n<h2 id=\"2-objectives--goals\">2. Objectives &amp; Goals<\/h2>\n\n\n\n<ul><li>Enable users to <strong>list all employees<\/strong> in a readable tabular format.<\/li><li>Allow users to <strong>add new employees<\/strong> with required fields (name, department, salary).<\/li><li>Support editing employee details with a pre-filled form.<\/li><li>Provide a read-only detailed view of individual employees.<\/li><li>Allow deletion of employees with user confirmation.<\/li><li>REST API endpoints should support all CRUD operations for integration or future enhancements.<\/li><li>The UI should be intuitive with responsive, clear action buttons (View, Edit, Delete).<\/li><\/ul>\n\n\n\n<h2 id=\"3-stakeholders\">3. Stakeholders<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Stakeholder<\/th><th>Role<\/th><th>Responsibility<\/th><\/tr><\/thead><tbody><tr><td>Product Manager<\/td><td>Oversees requirements &amp; scope<\/td><td>Define features and priorities<\/td><\/tr><tr><td>Frontend Developer<\/td><td>Implements HTML + Axios views<\/td><td>Build UI pages and integrate API calls<\/td><\/tr><tr><td>Backend Developer<\/td><td>Develops REST API<\/td><td>Implement API endpoints for employee data<\/td><\/tr><tr><td>QA Tester<\/td><td>Quality assurance<\/td><td>Test functionality and user experience<\/td><\/tr><tr><td>HR Users<\/td><td>End users<\/td><td>Use product to manage employee records<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"4-user-stories\">4. User Stories<\/h2>\n\n\n\n<ul><li>As an HR user, I want to <strong>see all employees listed<\/strong>, so that I can find and review employee info quickly.<\/li><li>As an HR user, I want to <strong>add a new employee<\/strong>, so that I can keep records of newly hired staff.<\/li><li>As an HR user, I want to <strong>edit employee details<\/strong>, so that I can update information if there are changes.<\/li><li>As an HR user, I want to <strong>delete an employee<\/strong>, so that I can remove records of former employees.<\/li><li>As an HR user, I want to <strong>view detailed employee information<\/strong>, so I can get a focused read-only snapshot of an individual\u2019s record.<\/li><\/ul>\n\n\n\n<h2 id=\"5-functional-requirements\">5. Functional Requirements<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>ID<\/th><th>Requirement Description<\/th><th>Priority<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>FR-01<\/td><td>The system shall display a list of employees with fields: ID, Name, Department, Salary.<\/td><td>High<\/td><td>See <code>listing.html<\/code><\/td><\/tr><tr><td>FR-02<\/td><td>The system shall allow adding a new employee with Name, Department, Salary.<\/td><td>High<\/td><td><code>add.html<\/code> form submission using Axios<\/td><\/tr><tr><td>FR-03<\/td><td>The system shall allow editing existing employee details via a pre-filled form.<\/td><td>High<\/td><td><code>edit.html<\/code> with PUT API call<\/td><\/tr><tr><td>FR-04<\/td><td>The system shall allow deletion of an employee with a confirmation popup.<\/td><td>High<\/td><td>Delete button triggers confirm popup + Axios DELETE<\/td><\/tr><tr><td>FR-05<\/td><td>The system shall provide a read-only details page to view employee records individually.<\/td><td>Medium<\/td><td><code>details.html<\/code> showing employee details<\/td><\/tr><tr><td>FR-06<\/td><td>The system shall expose the following REST API endpoints: GET \/employees, GET \/employees\/{id}, POST \/employees, PUT \/employees\/{id}, DELETE \/employees\/{id}.<\/td><td>High<\/td><td>Backend API support required<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"6-non-functional-requirements\">6. Non-functional Requirements<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Requirement Description<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>The system should be responsive and load employee data quickly.<\/td><td>Performance: API responses under 2 seconds<\/td><\/tr><tr><td>Data should be validated on client and server-side.<\/td><td>Name and Department non-empty, Salary positive number<\/td><\/tr><tr><td>System should handle concurrency safely (no data conflicts).<\/td><td>Backend-managed<\/td><\/tr><tr><td>Security: API endpoints to be secured with authentication (future scope).<\/td><td>Currently internal use<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"7-user-interface--ux\">7. User Interface \/ UX<\/h2>\n\n\n\n<ul><li>Tables with borders and clear labeling for readability.<\/li><li>Action buttons for View, Edit, Delete placed on each row.<\/li><li>Modals or confirm popups for delete actions to prevent accidental deletions.<\/li><li>Forms for Add and Edit with required field validation.<\/li><li>Navigation links to switch between listing, add, edit, and details pages.<\/li><\/ul>\n\n\n\n<h2 id=\"8-api-specification\">8. API Specification<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Method<\/th><th>Endpoint<\/th><th>Description<\/th><th>Request Body<\/th><th>Response<\/th><\/tr><\/thead><tbody><tr><td>GET<\/td><td>\/api\/employees<\/td><td>Retrieve list of all employees<\/td><td>None<\/td><td>Array of employee objects<\/td><\/tr><tr><td>GET<\/td><td>\/api\/employees\/{id}<\/td><td>Retrieve one employee by ID<\/td><td>None<\/td><td>Employee object<\/td><\/tr><tr><td>POST<\/td><td>\/api\/employees<\/td><td>Create a new employee<\/td><td>JSON with name, department, salary<\/td><td>Created employee object<\/td><\/tr><tr><td>PUT<\/td><td>\/api\/employees\/{id}<\/td><td>Update employee by ID<\/td><td>JSON with fields to update<\/td><td>Updated employee object<\/td><\/tr><tr><td>DELETE<\/td><td>\/api\/employees\/{id}<\/td><td>Delete employee by ID<\/td><td>None<\/td><td>Success status<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"9-success-metrics\">9. Success Metrics<\/h2>\n\n\n\n<ul><li>100% of employee records can be created, viewed, updated, and deleted successfully without errors.<\/li><li>User confirmation for delete reduces unintended deletions by 90%.<\/li><li>UI loads employee listings and details pages within 2 seconds for up to 1000 records.<\/li><li>Positive user feedback from HR team on usability (survey post-release).<\/li><\/ul>\n\n\n\n<h2 id=\"10-timeline--milestones\">10. Timeline &amp; Milestones<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Milestone<\/th><th>Target Date<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>PRD Approval<\/td><td>[Date]<\/td><td>Finalize product requirements document.<\/td><\/tr><tr><td>Design &amp; UI Mockups<\/td><td>+1 week<\/td><td>Design review for all pages.<\/td><\/tr><tr><td>Backend API Development<\/td><td>+3 weeks<\/td><td>REST API endpoints complete.<\/td><\/tr><tr><td>Frontend Development<\/td><td>+4 weeks<\/td><td>Integrate UI with API and build views.<\/td><\/tr><tr><td>QA Testing<\/td><td>+5 weeks<\/td><td>Functional and usability testing.<\/td><\/tr><tr><td>Deployment<\/td><td>+6 weeks<\/td><td>Release to production environment.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"11-constraints--assumptions\">11. Constraints &amp; Assumptions<\/h2>\n\n\n\n<ul><li>Current version targets internal HR users only.<\/li><li>Authentication &amp; authorization to be added later.<\/li><li>Backend API under development or assumed ready to accept calls as described.<\/li><li>UI will be web-based, supported in modern browsers.<\/li><\/ul>\n\n\n\n<h2 id=\"12-appendix\">12. Appendix<\/h2>\n\n\n\n<ul><li>Sample UI HTML files: <code>listing.html<\/code>, <code>add.html<\/code>, <code>edit.html<\/code>, <code>details.html<\/code><\/li><li>Axios usage examples for API communication.<\/li><li>API specification document (Swagger\/OpenAPI recommended for future).<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Product Requirements Document (PRD) Project: Employee Management CRUD SystemDate: July 27, 2025Author: [Your Name] 1. Purpose &amp; Background The Employee Management CRUD System aims to provide a simple web-based interface and REST API to manage employee records efficiently. It fulfills the need to maintain essential employee data such as ID, name, department, and salary with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,18,9],"tags":[],"_links":{"self":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2839"}],"collection":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=2839"}],"version-history":[{"count":4,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2839\/revisions"}],"predecessor-version":[{"id":2849,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/2839\/revisions\/2849"}],"wp:attachment":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=2839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/categories?post=2839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/tags?post=2839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}