How srm-ist-ktr/githubsrmv1 works
Main Components
• Frontend (User Interface):
• Components: Divide into subcomponents such as “About”, “Contact”, “Events”, “Home”, “OurStory”, “Recruitment”, “Team”, and shared ones (like Navbar and Footer).
• Pages: In the “pages” folder, where pages like index.js, about.js, team.js, etc. dynamically load these components.
• Static Assets: Represent the “public” folder for static resources (e.g., fonts, videos, images, CSS).
• Backend/API:
• API Endpoints: Under “pages/api/v1”, create segments for certificates, contact, events, recruitment, sponsors, team, etc. Note that API routes follow Next.js file-based routing.
• Health Check: Include the healthcheck.js endpoint for monitoring purposes.
• Utilities & Data Models:
• Utilities: “utils/db” for database interactions, “utils/email” for sending registration emails and related templates.
• Models: “utils/models” that define data schemas for contact, events, recruitment, sponsors, tasks, and team.
• Configuration & Development Tools:
• Configuration files: next.config.mjs, tailwind.config.js, postcss.config.js, and others (like jsconfig.json, Dockerfile, .env.example).
• CI/CD and Git Hooks: .github folder (ISSUE_TEMPLATE) and Husky hooks.
• Deployment Configurations: Dockerfile and environment files.
Relationships & Interactions
• API endpoints then utilize the “utils” modules to process data. For example, endpoints for recruitment might call functions from “utils/email” (to send notifications) and “utils/models/recruitment.model.js” for data schema handling.
• The API interfaces with the underlying database (abstracted via “utils/db”) and sends responses back to the client.
• In addition, static assets are served from the “public” folder and styled via the “styles” folder and Tailwind CSS configurations.
Architectural Patterns and Design Principles
• File-based Routing: Use Next.js conventions for mapping URLs to components and API endpoints.
• MVC-like Separation: Although Next.js doesn’t enforce a full MVC pattern, note how the “components” (View), “pages/api” (Controller/Backend Logic), and “utils/models” (Model) together establish a separation of concerns.
• Modular Component Design: Each feature (e.g., Recruitment, Events) is encapsulated into its own set of components and API routes.
Relevant Technologies and Frameworks
• Next.js for the full-stack framework.
• React for building UI components.
• Tailwind CSS & PostCSS for styling.
• Docker for containerization and deployment.
• GitHub Actions / Husky for CI/CD tasks.
• Utility libraries (like jimp in utils/certificates/jimpOverlay.js) for image processing and other operations.