How pankajtanwarbanna/placementmnit works
Project type and purpose
• This is a full-stack MEAN (MongoDB, Express.js, AngularJS, Node.js) single-page application: an online placement & internship automation portal.
• The frontend is a client-side AngularJS app (HTML/CSS/JS under public/app and assets), and the backend is an Express/Node.js REST API (app/ directory) persisting data in MongoDB.
File structure
• Top-level server.js boots the Express app, serves static assets and mounts API routes from app/routes.
• app/
• routes/ – defines REST endpoints (e.g., auth.router.js, user.router.js, placement.router.js)
• controllers/ – business logic per endpoint
• services/ – helper modules (MongoDB connection, mailer, SMS, JWT handling, file upload via Multer, CSV/Excel export, templates, utilities)
• middlewares/ – Express middleware for authentication and JWT validation
• models/ – Mongoose schemas for entities (User, Company, Interview, Notification, etc.)
• public/
• app/ – AngularJS modules: controllers, services, directives, filters, routing config (routes.js), main entry (app.js)
• views/ – HTML templates organized by feature (authentication, company, placements, profile, management, etc.)
Extract additional insights from README
• The system uses JWT for stateless auth, environment variables for credentials (email, SMS API keys, secret).
• It integrates with an SMTP server and an SMS gateway.
• It supports file uploads (resumes, CSV exports) with Multer.
a. Main components
• Client Layer: Browser running AngularJS SPA
• API Layer: Express.js server (server.js + routes + middleware)
• Business Logic Layer: Controllers ➔ Services ➔ Utilities
• Data Layer: Mongoose models ➔ MongoDB database
• External Services: SMTP Email provider, SMS gateway
• File Store: local filesystem (via Multer) for uploads & exports
b. Relationships & interactions
1. Browser loads index.html and AngularJS app.js
2. Angular services initiate HTTP/HTTPS requests to REST endpoints on Express server
3. Express middleware (JWT, auth) intercepts requests, validates tokens
4. Route handlers delegate to controllers
5. Controllers call services (e.g., mailer, SMS, export, MongoDBService)
6. Services interact with Mongoose models to CRUD data in MongoDB
7. Services also call SMTP or SMS gateway APIs or write files to disk via Multer/Export service
8. Responses propagate back up: Service ➔ Controller ➔ Route ➔ Client
c. Architectural patterns & design principles
• Layered MVC-style separation (Routes → Controllers → Services → Models)
• Stateless JWT authentication (middleware pipeline)
• Single-Page Application (AngularJS) for dynamic client behavior
• RESTful API endpoints
• Modular design grouping by feature
• Environment-based config for secrets
d. Key technologies
• Frontend: AngularJS, HTML5, CSS3, Bootstrap
• Backend: Node.js, Express.js, Mongoose (MongoDB)
• Auth: JSON Web Tokens
• File handling: Multer
• Email: nodemailer (via mailer.service)
• SMS: custom sms.service calling SMS_BASE_URI
• Data export: CSV/Excel services
Detailed checklist
• API endpoints grouping (auth, user, placement, interview, etc.) in the routing layer
• Middleware chain (auth.middleware → jwt.middleware) ahead of controller invocation
• Mongoose models as the boundary to the MongoDB database
• Environment configuration feeding secrets into JWT and external-service connectors