How inter-iit-prepathon-thesloths/frontend works
Purpose and runtime
This is a Vite-built React + TypeScript single-page application, structured as an authenticated company/dashboard portal rather than a server-rendered app. Browser execution starts at src/main.tsx, mounts the root application in src/App.tsx, and produces deployable static assets in dist/.
Application composition and routing
src/App.tsx is the likely route/orchestration boundary for public authentication, onboarding, dashboard, search, and settings pages. Primary screens include src/pages/Dashboard/Company.tsx, src/pages/Search.tsx, src/pages/Settings.tsx, and authentication flows under src/pages/Authentication/. src/pages/BackendRedirection.tsx is a callback/transition point for backend-driven navigation, likely OAuth or post-auth redirects.
Authentication and access control
Authentication is represented as a multi-stage client flow: sign-in/sign-up/reset, password setup, OTP verification, and 2FA challenge. Relevant boundaries are src/pages/Authentication/SignIn.tsx, src/pages/OtpVerification.tsx, src/pages/AskTwofa.tsx, and src/components/ProtectedRoute.tsx. OAuth-specific UI is isolated in src/components/Oauth.tsx; password collection is separated in src/components/AskForPassword.tsx and src/pages/CreatePassword.tsx.
Shared state and API boundary
Global application state is centralized in src/context/context.tsx, providing a cross-page boundary for session or application data. Remote HTTP access is expected to pass through src/utils/axiosInstance.ts, rather than being embedded in individual screens. Environment-specific backend configuration is supplied through .env.sample, making the external API endpoint/configuration a deployment concern.
Authenticated shell and navigation
Authenticated pages are composed through reusable layout and navigation primitives: src/layout/Layout.tsx, src/components/Layout.tsx, src/components/Header/index.tsx, and src/components/Sidebar/index.tsx. This layer owns persistent chrome, navigation grouping, user/notification UI, and theme controls, while route pages supply the main content area.
Dashboard, company data, and visual presentation
The main domain-facing experience centers on company/dashboard information in src/pages/Dashboard/Company.tsx. Reusable representations include summary/stat cards, charts, tables, breadcrumbing, and search: src/components/CardDataNormal.tsx, src/components/Charts/ChartOne.tsx, src/components/Tables/Table.tsx, and src/components/SearchBar.tsx. Domain payload shapes are explicitly modeled in src/types/company.ts, src/types/product.ts, src/types/package.ts, and related type files.
Deployment and frontend infrastructure
Vite configuration resides in vite.config.ts; Tailwind/PostCSS styling is configured by tailwind.config.cjs and postcss.config.js, with global styles in src/index.css and src/css/style.css. Client-side SPA fallback/redirect behavior is provisioned for static hosting through vercel.json, public/_redirects, and dist/_redirects. docker-compose.yml supplies a containerized local/runtime infrastructure path.
Main entry points: App.tsx App router · Company.tsx Company dashboard · SignIn.tsx Sign-in flow · Layout.tsx Authenticated layout
Components 17
Browser App
- Browser entry
src/main.tsx - App router · Coordinates public, onboarding, and authenticated routes.
src/App.tsx - Global state · Cross-page session and application state.
src/context/context.tsx - HTTP client · Centralized remote HTTP access.
src/utils/axiosInstance.ts
Authentication
- Protected routes
src/components/ProtectedRoute.tsx - Sign-in flow
src/pages/Authentication/SignIn.tsx - OTP & 2FA
src/pages/OtpVerification.tsx - OAuth UI
src/components/Oauth.tsx - Backend callback · Handles backend-driven post-auth navigation.
src/pages/BackendRedirection.tsx
Authenticated UI
- Authenticated layout · Persistent chrome around routed content.
src/layout/Layout.tsx - Header & sidebar
src/components/Sidebar/index.tsx
Dashboard & Data
- Company dashboard
src/pages/Dashboard/Company.tsx - Dashboard widgets
src/components/Charts/ChartOne.tsx - Company models
src/types/company.ts
Build & Deployment
- Vite build · Builds static SPA assets to dist/.
vite.config.ts - SPA fallback
vercel.json - Container runtime
docker-compose.yml
Connections 18
- Browser entry → App router: mounts
- App router → Global state: uses
- App router → Sign-in flow: public auth routes
- App router → Backend callback: callback route
- Sign-in flow → OTP & 2FA: verification
- Sign-in flow → OAuth UI: OAuth option
- Backend callback → Global state: updates session
- App router → Protected routes: guards private routes
- Protected routes → Authenticated layout: permits
- Authenticated layout → Header & sidebar: contains
- Authenticated layout → Company dashboard: renders route content
- Company dashboard → Dashboard widgets: composes
- Company dashboard → Company models: uses
- Company dashboard → HTTP client: loads data
- HTTP client → Global state: session-aware requests
- Vite build → Browser entry: builds
- Vite build → SPA fallback: deploys with
- Container runtime → Vite build: runs