How codegirls-1tdspb/sprint-4 works
Project type and purpose
• This is a full-stack Next.js (v13+) application written in TypeScript.
• The “src/app” folder uses the App Router for both UI routes (pages and components) and API routes under “src/app/api”.
• Purpose: a dashboard-style web app that manages users, teams, tasks (tarefas), alerts (alertas), notifications (notificação) and login/profile flows.
File structure
• Top-level directories:
• public/ — static assets (images).
• src/app/ — Next.js pages (layout.tsx, page.tsx), sub-folders per feature/domain (dashboard, login) and API endpoints.
• src/components/ — shared UI components (Header, Footer, Cards, Logo).
• src/lib/ — shared business logic (auth.ts).
• src/hoc/ — higher-order components (withAuth.tsx).
• src/data/ — sample data (listaDeUsuarios.ts).
• Configuration: next.config.ts, tailwind.config.ts, postcss.config.mjs, eslint.config.mjs, tsconfig.json.
README
• Minimal content (“# Sprint-4”).
Main components and their relationships
a. Frontend (Browser / Client)
• Next.js App Router → server-side & client-side rendering
• Components (pages under “login” and “dashboard”, UI components under src/components)
• withAuth HOC for protected routes
b. API Layer (Next.js Serverless / Node.js)
• RESTful endpoints under src/app/api/{alertas,equipes,login,notificacao,tarefas,usuarios}
• Each domain folder holds [id]/route.ts and route.ts → standard CRUD routes
• auth.ts in src/lib handles token verification or session logic
c. Persistence Layer
• A database (e.g., PostgreSQL or MongoDB) storing tables/collections: Users, Teams, Tasks, Alerts, Notifications
• The API layer connects via an ORM/driver (not shown, but implied)
d. Static Assets & Styles
• public/imagens → images served by Next.js static serving
• Tailwind CSS & PostCSS → styling pipeline
e. External Services (optional)
• Email or push notification service for “notificação”
• Auth provider (if JWTs or OAuth used)
Important architectural patterns
• File-based routing for both UI and API.
• Separation of concerns:
• UI (pages, components)
• Business logic (src/lib)
• Data (API routes)
• Auth via HOC and lib
• Protected routes via withAuth → middleware pattern.
• RESTful domain-driven folder structure.
Final checklist for the engineer
• Related API routes into domain bundles.
• Technology stack near each component.
• Export in a high-resolution format for readability.