How tpenha05/regula-front works
Project Type and Purpose
• This is a front-end single-page application (SPA) built with React and TypeScript, bundled by Vite and deployed (via Vercel).
• It provides a public marketing site, user-facing app, and admin console, communicating with a separate backend via RESTful endpoints (e.g. auth, user, contact, profile, “sinister”).
File Structure Analysis
• Top level
• index.html, package.json, vite.config.* → Vite-powered React app
• public/landing_page & public/about → static assets for marketing pages
• src/
– components/ui/… → design-system primitives (buttons, dialogs, menus, toasts, etc.)
– lib/utils.ts, config/config.ts → shared utilities & environment configuration
– main.tsx, App.tsx, router.tsx → application entry, React Router setup
– pages/ → feature modules organized by audience (public, user, admin)
· public/auth & public/main → login, password reset, landing, about, contact
· user/auth, user/dashboard → protected user flows (logout, token check, dashboard sub-routes)
· admin/auth, admin/dashboard → admin-only auth and dashboard
– each “api” folder under pages invokes external HTTP endpoints (login, logout, CheckToken, contact, users, profile, sinister).
• Config files: tsconfig*, eslint.config.js, vercel.json
Component Relationships & Interactions
• Browser loads index.html → main.tsx → App.tsx
• Router directs to Public, User, or Admin feature modules
• Pages import design-system UI components to render forms/pages
• On user action (e.g. login, fetch dashboard data), page calls its local “api” module → issues HTTP request to corresponding backend service
• Auth tokens persisted (cookie or localStorage) and sent with requests
• Responses update React state, drive UI
• Vercel serves static assets, rewrites API paths (if any serverless functions exist)
Architectural Patterns & Principles
• Modular feature structure: pages grouped by domain/role
• Design-system driven UI for consistent look & feel
• Clear separation: Presentation (UI components) vs. Routing (router.tsx) vs. Business logic (api modules)
• Thin client: relies on backend for data, only handles rendering & state management
• Environment-based configuration via src/config/config.ts
Technologies & Frameworks
• React (tsx), React Router
• TypeScript, Vite (bundler & dev server)
• CSS (index.css), utility classes?
• ESLint for linting
• Vercel for deployment