How khoa-cntt/xdwdttdt2164 works
Project Type and Purpose
• This is a full-stack web application that supports job posting, candidate applications, and an automated CV screening mechanism. Its purpose is to connect candidates with employers while providing functionalities like registration/login (with OTP verification), job search/application, posting and management of job adverts, and handling payment through a wallet system.
• The README also highlights that the project is built with Node.js/Express (backend) and Vue.js (frontend), using Docker for containerization along with services such as Redis and a SQL database.
Analyzing the File Structure to Identify Components
• Backend:
• Located in the /backend directory.
• Follows an MVC-like structure with separate folders for controllers, services, routes, models, migrations, validations, and middlewares. This separation indicates a well-defined layer separation for handling business logic, data models, routing, and error handling.
• Contains configuration files for third-party services like Cloudinary, Redis, and email settings.
• Utilizes Sequelize for ORM tasks and includes migration scripts to manage database schema changes.
• Frontend:
• Located in the /frontend directory.
• Uses Vue (with Vue Router and Vuex) to structure the UI components and views, split into role-based segments (admin, candidate, employer, common) which reflects the multi-role functionality.
• Contains static assets, configuration files, and a clear separation between reusable components and view layers.
• Root and Containerization:
• The top-level directory contains the docker-compose.yml file that orchestrates running of both frontend and backend services as well as database and Redis containers.
• The presence of Dockerfiles in both frontend and backend further confirms the containerized deployment setup.
Key Components
• Frontend Client:
• Represented by the Vue.js application.
• Includes sub-modules like components (admin, candidate, employer, common), views, router, and global state management (Vuex).
• Backend API:
• Represented by the Node.js/Express server.
• Break this into sub-components:
▪ Controllers – handling HTTP request logic.
▪ Services – encapsulating business logic.
▪ Routes – defining API endpoints.
▪ Middlewares – for authentication (JWT, OTP verification), validation, and error handling.
▪ Models and Migrations – defining the database schema and data operations via Sequelize.
• Utility libraries (sending emails, generating OTPs, password hashing, etc.) supporting various operations.
• Database:
• A SQL database (MySQL/PostgreSQL) that is managed via Sequelize.
• External & Supporting Services:
• Redis: For temporary data storage such as OTPs and token management.
• Cloudinary: For handling file uploads (images, PDFs) when applicable.
• Email Service (ex: Gmail): For sending OTP emails and password reset links.
• Docker & Infrastructure:
• Docker containers for each service.
• Docker Compose as the orchestrator to connect backend, frontend, database, and Redis.
Details on Relationships and Interactions
• How the Frontend communicates with the Backend via API calls (using Axios).
• How Backend controllers invoke services and interact with the database using models.
• Middleware processes that occur before and after API calls (authentication, validation, error handling).
Emphasizing Architectural Patterns and Technologies
• MVC pattern used within the backend (Controllers, Models, Services).
• Layered architecture with separate concerns (routing, business logic, data access).
• Differences in responsibilities in client vs. server sides.
• Use of containerization and orchestration using Docker and Docker Compose.
• Technologies (Node.js, Express, Sequelize, Vue.js, Vue Router, Vuex/Pinia, Docker, Redis, MySQL/PostgreSQL, Cloudinary, JWT, and nodemailer).