How aryan-2511/placement_portal_nie works
Project Overview
• The portal consists of a frontend (React with Vite, Tailwind CSS, and supporting tools like ESLint) and a backend (written in Go).
• The backend handles business logic related to student applications, authentication, notifications, scheduling, and administrative functions.
• There is an implied database layer (the backend/db folder contains connection logic) and integration with external services (email and notifications utilities).
Main Components
a. Frontend:
• User Interface: includes pages for students and administrators.
• Components: React components for layout (NavBar, Sidebar, MainLayout), shared components (forms, tables, stat cards), and feature-specific components (applications, authentication, dashboard graphs, events, opportunities).
• Routing and Context: Route components like PrivateRoute, StudentRoutes, CoordinatorRoutes; global state management using UserContext and DarkModeContext.
• Services Integration: API service modules such as apiAuth, apiApplications, etc.
b. Backend:
• Controllers: A variety of handlers (e.g., authentication, student details, placements, events, scheduling) that map to API endpoints.
• Models: Data structures for core entities such as user, admin, applications, opportunities, placed students, etc.
• Database Connection: Code within the db folder managing connectivity (likely to an SQL or NoSQL database).
• Utilities: Helpers for tasks including JWT handling, email sending, password hashing, CORS, and token validation.
• Executable: Main entry point (main.go) and built binary (Placement_NIE.exe).
c. Supporting Components:
• External Services: Email notification services (send_email, sendBulkEmail in utils) indicate integration with an external email service.
• Middleware / Security: Authentication middleware and token validation logic (jwt.go, validateToken.go, authMiddleware.go).
Relationships and Interactions
• Users interact with the frontend (web browser) to view dashboards, apply for opportunities, etc.
• The frontend calls REST API endpoints on the backend for authentication, CRUD operations on opportunities, applications, scheduling, etc.
• The backend middleware handles authentication and authorization before directing requests to the appropriate controller.
• Backend controllers interact with the database through the connection module to persist or retrieve data.
• Utility functions facilitate processes such as email notifications and hashing passwords, linking to external services and ensuring secure data transactions.
Architectural Patterns / Design Principles
• Separation of Concerns: Clear division of responsibilities between frontend UI components, API controllers, data models, and utility functions.
• MVC-like Structure: The backend follows a pattern where controllers manage business logic, models represent data structures, and utilities provide cross-cutting support.
• Modular and Extensible Design: Both frontend and backend directories are organized into modules that allow for scalability and ease of maintenance.