How prasannashrestha011/portal-ui works
Purpose and Runtime
This is a Next.js App Router frontend for student and employer account/profile workflows, including authentication, employer profiles, student profiles, resume documents, and job/company service integration. It runs as a TypeScript React application under Next.js, with global styling and root layout defined in app/layout.tsx and app/globals.css.
Route Entry Points
App Router pages establish the user-facing flow:
• Landing page: app/page.tsx
• Authentication: app/login/page.tsx, app/register/page.tsx
• Employer profile: app/employer/profile/page.tsx
• Student profile lifecycle: app/student/profile/page.tsx, app/student/profile/upsert/page.tsx
• Student document/resume area: app/student/profile/document/page.tsx
middleware.ts is the cross-route boundary likely used for request-time access control, redirects, or session-aware routing.
Authentication Boundary
Authentication UI is separated from API and state concerns:
• UI components: src/components/Login.tsx, src/components/Register.tsx
• Authentication state/context: src/context/useAuth.ts
• Remote operations: src/services/auth.ts
• Auth contracts: src/types/auth.ts
Pages consume the components/context, while service code centralizes calls to the external backend rather than embedding HTTP behavior in route components.
HTTP and Service Layer
src/api/client.tsx is the shared API-client boundary. Domain services organize remote operations by business capability:
• src/services/studentProfile.ts
• src/services/employerProfile.ts
• src/services/company.ts
• src/services/job.ts
Typed request/response models in src/types/http.ts, src/types/studentProfile.ts, src/types/employerProfile.ts, src/types/company.ts, and src/types/job.ts constrain data crossing the frontend/backend boundary. The backend/API host and its infrastructure are not represented in the repository tree.
Student Profile Flow
The student flow supports viewing, editing/creating, and document handling:
• Presentation: src/components/StudentProfile/DisplayStudentProfile.tsx
• Edit form composition: src/components/StudentProfile/StudentProfileForm.tsx, src/components/StudentProfile/FormContent.tsx
• Resume upload: src/components/StudentProfile/UploadResume.tsx
• State access: src/context/useStudentProfile.ts
Data flows from profile pages into form/display components, through student-profile context and service calls, then returns as typed student-profile data. Resume upload is a distinct document boundary, likely requiring multipart or file-oriented API behavior.
Employer and Company Flow
Employer profile editing/display is encapsulated separately from student concerns:
• Employer UI: src/components/EmployerProfile/ProfileCard.tsx, src/components/EmployerProfile/ProfileForm.tsx
• Employer state: src/context/useEmployerProfile.ts
• Company state: src/context/useCompanyStore.ts
• Remote domains: src/services/employerProfile.ts, src/services/company.ts
This separation suggests employer identity/profile data and company data may be independently loaded and persisted, while sharing the common API client and auth context.
Shared UI and Deployment
Shared form primitives reside in src/components/Form/common.tsx, allowing profile and authentication screens to use consistent input behavior. Next.js configuration is in next.config.ts; the application is suitable for standard Node/Next.js hosting, including Vercel as indicated by the project scaffold. No server-side API routes, database implementation, or external storage provider are present in this repository.
Components 21
Next.js app
- Root layout & styles
app/layout.tsx - App Router pages · Landing, authentication, and profile lifecycle pages.
app/page.tsx - Route middleware · Applies request-time access control or redirects.
middleware.ts - Login & registration UI
src/components/Login.tsx - Auth context
src/context/useAuth.ts - Shared form primitives
src/components/Form/common.tsx
Student profile
- Student profile pages · View, edit/create, and document routes.
app/student/profile/page.tsx - Student profile UI · Display and form composition for profile data.
src/components/StudentProfile/StudentProfileForm.tsx - Resume upload · Handles file-oriented resume submission.
src/components/StudentProfile/UploadResume.tsx - Student profile context
src/context/useStudentProfile.ts
Employer & company
- Employer profile page
app/employer/profile/page.tsx - Employer profile UI · Profile card and editing form.
src/components/EmployerProfile/ProfileForm.tsx - Employer profile context
src/context/useEmployerProfile.ts - Company store
src/context/useCompanyStore.ts
API integration
- API client · Shared client for all remote service calls.
src/api/client.tsx - Auth service
src/services/auth.ts - Student profile service
src/services/studentProfile.ts - Employer profile service
src/services/employerProfile.ts - Company & job services · Loads company and job-domain data.
src/services/company.ts - Typed API contracts · Constrains authentication, HTTP, profile, company, and job payloads.
src/types/http.ts - External backend API · API host and infrastructure are outside this repository.
Connections 27
- Root layout & styles → App Router pages: hosts
- Route middleware → App Router pages: guards
- App Router pages → Login & registration UI: renders
- Login & registration UI → Auth context: uses
- Auth context → Auth service: auth operations
- Student profile pages → Student profile UI: renders
- Student profile pages → Resume upload: renders
- Student profile UI → Student profile context: reads and updates
- Resume upload → Student profile context: submits document
- Student profile context → Student profile service: profile operations
- Employer profile page → Employer profile UI: renders
- Employer profile UI → Employer profile context: reads and updates
- Employer profile context → Employer profile service: profile operations
- Employer profile context → Company store: uses company data
- Company store → Company & job services: loads domain data
- Login & registration UI → Shared form primitives: uses
- Student profile UI → Shared form primitives: uses
- Employer profile UI → Shared form primitives: uses
- Auth service → API client: uses
- Student profile service → API client: uses
- Employer profile service → API client: uses
- Company & job services → API client: uses
- API client → External backend API: HTTP requests
- Auth service → Typed API contracts: typed payloads
- Student profile service → Typed API contracts: typed payloads
- Employer profile service → Typed API contracts: typed payloads
- Company & job services → Typed API contracts: typed payloads