How nunofernandes2000/react works
Purpose and Runtime
This is a Vite-based React single-page application for an informatics engineering project. It has student (Aluno) and teacher (Docente) dashboard/exercise views, plus login and registration. Browser execution starts through Vite’s React entry module: src/main.jsx or the parallel TypeScript entry src/main.tsx.
Application Bootstrap
The root application component is implemented in both JavaScript and TypeScript variants: src/App.jsx and src/App.tsx. These are expected to own the top-level UI composition, page selection/routing state, and global layout styling, with base styles in src/App.css. The HTML host document is index.html.
Authentication and Access Boundary
Authentication-facing screens are separated into src/pages/Login.jsx and src/pages/Register.jsx, with login-specific presentation in src/pages/Login.css. These pages form the user-entry boundary before access to role-oriented student or teacher experiences. No router or authentication provider is present in the supplied tree, so navigation and session handling likely remain local to the app/page layer.
Role-Specific Dashboards
The main post-login experiences are divided by actor:
• Student dashboard: src/pages/DashboardAluno.jsx
• Teacher dashboard: src/pages/DashboardDocente.jsx
This split is the primary domain boundary: each role can receive separate data loading, actions, and navigation while sharing the top-level application shell.
Exercise Workflow
Student exercise interaction is isolated in src/pages/AlunoExercicio.jsx. It likely represents the detailed exercise stage reached from the student dashboard, handling answer/progress state and exercise-specific UI. Reusable progress visualization is provided by src/components/ProgressBar.jsx with src/components/ProgressBar.css.
API and External-Service Boundary
src/api/http.js is the centralized HTTP boundary for browser-to-backend communication. Page-level features should depend on this module rather than embed transport details, allowing shared base URLs, headers, authentication tokens, error handling, and request conventions. The backend API itself is not included in this repository.
Shared Feedback Components
Cross-page UI feedback is componentized:
• Progress display: src/components/ProgressBar.jsx
• Transient notifications: src/components/Toast.jsx
These components should receive state from pages or the application shell rather than directly owning domain/API workflows, keeping UI feedback separate from role and exercise logic.
Main entry points: App.jsx App Shell (JS) · http.js HTTP Client · DashboardAluno.jsx Student Dashboard · App.tsx App Shell (TS)
Components 13
Browser Runtime
- HTML Host
index.html - React Entry (JS)
src/main.jsx - React Entry (TS) · Parallel TypeScript entry variant.
src/main.tsx - App Shell (JS) · Owns top-level composition and page state.
src/App.jsx - App Shell (TS) · Parallel TypeScript app-shell variant.
src/App.tsx
Role Experiences
- Student Dashboard
src/pages/DashboardAluno.jsx - Teacher Dashboard
src/pages/DashboardDocente.jsx - Student Exercise · Handles exercise answers and progress.
src/pages/AlunoExercicio.jsx
Shared UI & API
- HTTP Client · Centralizes browser-to-backend requests.
src/api/http.js - Progress Bar
src/components/ProgressBar.jsx - Toast · Transient cross-page notifications.
src/components/Toast.jsx
Connections 18
- HTML Host → React Entry (JS): loads
- HTML Host → React Entry (TS): loads · Alternative entry variant.
- React Entry (JS) → App Shell (JS): mounts
- React Entry (TS) → App Shell (TS): mounts
- App Shell (JS) → Login: selects view
- App Shell (JS) → Register: selects view
- App Shell (JS) → Student Dashboard: selects role view
- App Shell (JS) → Teacher Dashboard: selects role view
- App Shell (TS) → Login: selects view
- App Shell (TS) → Student Dashboard: selects role view
- Student Dashboard → Student Exercise: opens exercise
- Login → HTTP Client: auth requests
- Register → HTTP Client: registration requests
- Student Dashboard → HTTP Client: loads student data
- Teacher Dashboard → HTTP Client: loads teacher data
- Student Exercise → HTTP Client: loads or submits work
- Student Exercise → Progress Bar: renders progress
- App Shell (JS) → Toast: shows feedback