How thedouglasaraujo/crud-javascript works
Project Type and Purpose
• This is a lightweight, front-end only Single-Page Application (SPA) for managing student records (Create, Read, Update, Delete).
• Purpose: allow users to input student data (name, course, period, grades, absences), compute average and status (approved, recovery, failed), and search/filter the list.
• Technologies: plain HTML (index.html), CSS (style.css), and JavaScript (script.js). No backend or external database—data is kept in memory or via browser LocalStorage.
File Structure Analysis
• Root
• index.html → main UI markup
• style.css → styling and layout rules
• script.js → application logic (data model, view updates, event handlers, storage)
• No “backend” folder or API configuration—everything runs client-side.
Key Architectural Patterns
• Model-View-Controller (MVC) or Model-View-Presenter (MVP) style:
• Model: data structures for Student (fields + computed properties like average and status).
• View: DOM elements in index.html, manipulated via CSS and JavaScript.
• Controller/Presenter: script.js functions that listen to UI events, update the model, persist to LocalStorage, and refresh the view.
Main Components
a. UI Layer
• HTML Form (input fields, buttons)
• Table/List component (to display students)
• Search Bar (filter function)
b. Business Logic Layer
• Data Model (Student object with validation, average/status rules)
• Controller Functions (createStudent, readStudents, updateStudent, deleteStudent, filterStudents)
c. Data Persistence
• Browser LocalStorage (or in-memory JS array)
d. Assets
• CSS styles
• Image assets (for documentation/screenshots)
Relationships and Data Flow
• User interacts with UI (forms, buttons) → Controller
• Controller validates input, updates Model
• Controller persists Model to LocalStorage
• Controller triggers View update (re-render list/table)
• Search input → Controller filter function → filtered dataset → View update
Final Checklist
[ ] Clear labels on all components
[ ] Annotations for business rules (absence >18, average thresholds)