A comprehensive backend API for employee performance management and tracking
Built with Node.js, Express.js, and MongoDB
- π― About the Project
- π οΈ Built With
- π Getting Started
- π API Documentation
- π§ Usage
- π Project Structure
- πΊοΈ Roadmap
- π€ Contributing
- π License
- π₯ Authors
- π Acknowledgements
Inova PMS is a comprehensive Performance Management System backend API designed to align employees' individual goals and performance with organizational objectives. This system provides the foundational infrastructure for tracking, evaluating, and improving employee performance across teams and departments.
The backend serves as the core engine for a larger PMS platform being developed by innovaDigits, one of Egypt's leading software development companies.
π View Complete Project Documentation
β¨ Comprehensive Performance Tracking
- Employee performance evaluation and monitoring
- Goal setting and progress tracking
- Team performance analytics
- Competency-based assessments
π Robust Authentication & Authorization
- JWT-based authentication
- Role-based access control
- Secure password hashing with bcrypt
- Session management with cookies
π Advanced Feedback System
- Multi-directional feedback collection
- Performance review cycles
- Real-time feedback tracking
- Metadata-driven feedback forms
π’ Team & User Management
- Hierarchical team structures
- User role management
- Department organization
- Employee onboarding workflows
The project is architected around three primary modules:
- User registration, authentication, and profile management
- Team creation and member assignment
- Role-based permissions and access control
- User hierarchy and reporting structures
- Skill and competency framework management
- Competency assessments and ratings
- Performance level definitions
- Career development pathways
- 360-degree feedback collection
- Performance review workflows
- Feedback analytics and reporting
- Custom feedback forms and templates
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend App β β Mobile App β β Admin Panel β
βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ βββββββββββ¬ββββββββ
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
βββββββββββββββββββ
β REST API β
β (Express.js) β
βββββββββββ¬ββββββββ
β
βββββββββββββββββββ
β MongoDB β
β Database β
βββββββββββββββββββ
β οΈ Important Note: To utilize the Feedback or Competency modules, proper API calls must be made to the Users and Teams modules first to establish the necessary relationships and permissions.
This project is built using modern, industry-standard technologies:
- Node.js - JavaScript runtime environment
- Express.js - Fast, unopinionated web framework
- MongoDB - NoSQL database for flexible data storage
- Mongoose - MongoDB object modeling for Node.js
- JSON Web Tokens (JWT) - Secure authentication mechanism
- bcrypt - Password hashing and salt generation
- cookie-parser - Cookie parsing middleware
- Joi - Object schema validation
- UUID - Unique identifier generation
- http-status-codes - HTTP status code constants
- Nodemailer - Email sending capabilities
- SendGrid - Email delivery service integration
- Nodemon - Development server with auto-restart
- dotenv - Environment variable management
- CORS - Cross-Origin Resource Sharing
- RESTful API design principles
- JSON-based request/response format
- Comprehensive error handling
- Input validation and sanitization
- Role-based access control
- Pagination and filtering support
Follow these steps to get the Inova PMS backend running on your local machine for development and testing purposes.
Before you begin, ensure you have the following installed on your system:
- Node.js (v18.0 or higher)
- npm (v8.0 or higher) - comes with Node.js
- MongoDB (v6.0 or higher) - local installation or MongoDB Atlas account
- Git - for version control
Check your installations:
node --version
npm --version
git --version-
Clone the repository
git clone https://github.com/MN-987/innovaDigits-PMS-Backend.git cd innovaDigits-PMS-Backend -
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory:touch .env
Add the following environment variables to your
.envfile:# Server Configuration PORT=6000 NODE_ENV=development # Database Configuration DB_URL=mongodb://localhost:27017/inova-pms # For MongoDB Atlas: mongodb+srv://username:password@cluster.mongodb.net/inova-pms # JWT Configuration JWT_SECRET=your_super_secret_jwt_key_here JWT_EXPIRES_IN=7d # Email Configuration (Optional) SENDGRID_API_KEY=your_sendgrid_api_key FROM_EMAIL=noreply@innovapms.com # CORS Configuration FRONTEND_URL=http://localhost:3000
-
Start MongoDB
If using local MongoDB:
# On macOS with Homebrew brew services start mongodb-community # On Windows net start MongoDB # On Linux sudo systemctl start mongod
-
Run the application
# Development mode with auto-restart npm start # Or directly with node node app.js
-
Verify the installation
The server should start on
http://localhost:6000. You should see:Example app listening on port 6000! DB Connected ....
| Variable | Description | Example |
|---|---|---|
PORT |
Server port number | 6000 |
DB_URL |
MongoDB connection string | mongodb://localhost:27017/inova-pms |
JWT_SECRET |
Secret key for JWT signing | your_super_secret_key |
JWT_EXPIRES_IN |
JWT token expiration time | 7d |
| Variable | Description | Default |
|---|---|---|
NODE_ENV |
Environment mode | development |
SENDGRID_API_KEY |
SendGrid API key for emails | - |
FROM_EMAIL |
Default sender email | - |
FRONTEND_URL |
Frontend application URL | http://localhost:3000 |
The Inova PMS API follows RESTful principles and provides comprehensive endpoints for managing users, teams, competencies, and feedback.
http://localhost:6000/api/v1
Most endpoints require authentication using JWT tokens. Include the token in the Authorization header:
Authorization: Bearer <your_jwt_token>To obtain a token, use the authentication endpoints:
# Login
POST /api/v1/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "your_password"
}| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
POST |
/register |
Register new user | β |
POST |
/login |
User login | β |
POST |
/logout |
User logout | β |
POST |
/refresh |
Refresh JWT token | β |
POST |
/forgot-password |
Request password reset | β |
POST |
/reset-password |
Reset password | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all users | β |
GET |
/:id |
Get user by ID | β |
PUT |
/:id |
Update user | β |
DELETE |
/:id |
Delete user | β (Admin) |
GET |
/profile |
Get current user profile | β |
PUT |
/profile |
Update current user profile | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all teams | β |
POST |
/ |
Create new team | β (Admin) |
GET |
/:id |
Get team by ID | β |
PUT |
/:id |
Update team | β (Admin) |
DELETE |
/:id |
Delete team | β (Admin) |
POST |
/:id/members |
Add team member | β (Admin) |
DELETE |
/:id/members/:userId |
Remove team member | β (Admin) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all competencies | β |
POST |
/ |
Create competency | β (Admin) |
GET |
/:id |
Get competency by ID | β |
PUT |
/:id |
Update competency | β (Admin) |
DELETE |
/:id |
Delete competency | β (Admin) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all levels | β |
POST |
/ |
Create level | β (Admin) |
GET |
/:id |
Get level by ID | β |
PUT |
/:id |
Update level | β (Admin) |
DELETE |
/:id |
Delete level | β (Admin) |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all feedback | β |
POST |
/ |
Create feedback | β |
GET |
/:id |
Get feedback by ID | β |
PUT |
/:id |
Update feedback | β |
DELETE |
/:id |
Delete feedback | β |
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
GET |
/ |
Get all categories | β |
POST |
/ |
Create category | β (Admin) |
GET |
/:id |
Get category by ID | β |
PUT |
/:id |
Update category | β (Admin) |
DELETE |
/:id |
Delete category | β (Admin) |
curl -X POST http://localhost:6000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"password": "securePassword123",
"role": "employee"
}'curl -X POST http://localhost:6000/api/v1/teams \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_jwt_token>" \
-d '{
"name": "Development Team",
"description": "Software development team",
"department": "Engineering"
}'curl -X POST http://localhost:6000/api/v1/feedback \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_jwt_token>" \
-d '{
"receiverId": "user_id_here",
"competencyId": "competency_id_here",
"rating": 4,
"comments": "Great work on the project!",
"feedbackType": "peer"
}'-
Development Mode (with auto-restart)
npm start
-
Production Mode
NODE_ENV=production node app.js
You can test the API using various tools:
# Health check
curl http://localhost:6000/api/v1/auth/health
# Login
curl -X POST http://localhost:6000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "test@example.com", "password": "password123"}'- Import the API collection (if available)
- Set the base URL to
http://localhost:6000/api/v1 - Configure authentication with JWT tokens
- Install Thunder Client extension
- Create a new collection
- Add requests for each endpoint
// 1. Register user
POST /api/v1/auth/register
// 2. Assign to team
POST /api/v1/teams/:teamId/members
// 3. Set up competencies
GET /api/v1/competency
// 4. Initial performance assessment
POST /api/v1/feedback// 1. Get team members
GET /api/v1/teams/:teamId
// 2. Collect feedback for each member
POST /api/v1/feedback
// 3. Generate performance reports
GET /api/v1/feedback?receiverId=:userId
// 4. Update competency levels
PUT /api/v1/competency/:idinova-pms/
βββ π app.js # Application entry point
βββ π package.json # Dependencies and scripts
βββ π package-lock.json # Dependency lock file
βββ π .env # Environment variables (create this)
βββ π README.md # Project documentation
βββ π LICENSE # MIT License
β
βββ π config/ # Configuration files
β βββ π dbConnection.js # MongoDB connection setup
β
βββ π routes/ # API route definitions
β βββ π index.routes.js # Main router and middleware setup
β βββ π auth.routes.js # Authentication routes
β βββ π user.routes.js # User management routes
β βββ π team.routes.js # Team management routes
β βββ π competency.routes.js # Competency routes
β βββ π feedback.routes.js # Feedback routes
β βββ π category.routes.js # Category routes
β βββ π level.routes.js # Level routes
β
βββ π controller/ # Business logic controllers
β βββ π auth.controller.js # Authentication logic
β βββ π user.controller.js # User management logic
β βββ π team.controller.js # Team management logic
β βββ π competency.controller.js # Competency logic
β βββ π feedback.controller.js # Feedback logic
β βββ π category.controller.js # Category logic
β βββ π level.controller.js # Level logic
β
βββ π service/ # Service layer (business logic)
β βββ π auth.service.js # Authentication services
β βββ π user.service.js # User services
β βββ π team.service.js # Team services
β βββ π competency.service.js # Competency services
β βββ π feedback.service.js # Feedback services
β βββ π category.service.js # Category services
β βββ π level.service.js # Level services
β
βββ π data/ # Database models (Mongoose schemas)
β βββ π user.model.js # User schema
β βββ π team.model.js # Team schema
β βββ π competency.model.js # Competency schema
β βββ π feedback.model.js # Feedback schema
β βββ π feedback.metadata.model.js # Feedback metadata schema
β βββ π category.model.js # Category schema
β βββ π level.model.js # Level schema
β
βββ π middleware/ # Custom middleware
β βββ π auth/ # Authentication middleware
β β βββ π isAuthenticated.js # JWT verification
β β βββ π isSuperAdmin.js # Admin role verification
β βββ π validator/ # Input validation middleware
β βββ π validation.js # General validation utilities
β βββ π user.validator.js # User input validation
β βββ π team.validator.js # Team input validation
β βββ π competency.validator.js # Competency validation
β βββ π feedback.validator.js # Feedback validation
β βββ π category.validator.js # Category validation
β βββ π level.validators.js # Level validation
β
βββ π util/ # Utility functions
βββ π errorClass.js # Custom error classes
βββ π errorHandling.js # Global error handling
βββ π feedbackTest.js # Feedback testing utilities
Contains Express.js route definitions that map HTTP requests to controller functions. Each module has its own route file for better organization.
Contains the main business logic for handling HTTP requests. Controllers process the request, call appropriate services, and return responses.
Contains the core business logic separated from HTTP concerns. Services handle data processing, validation, and communication with the database.
Contains Mongoose schemas that define the structure of documents in MongoDB collections. These models handle data validation and relationships.
Contains reusable middleware functions for authentication, authorization, and input validation that can be applied to routes.
Contains helper functions, error handling utilities, and other reusable code that doesn't fit into other categories.
- β User authentication and authorization
- β Team management system
- β Competency framework
- β Feedback collection and management
- β Role-based access control
- β Input validation and error handling
- β RESTful API design
-
Performance Analytics Dashboard
- Comprehensive performance metrics
- Visual charts and reports
- Trend analysis over time
-
Advanced Reporting System
- Custom report generation
- PDF export functionality
- Scheduled reports via email
-
Notification System
- Real-time notifications
- Email alerts for performance reviews
- Custom notification preferences
-
Goal Setting & Tracking
- SMART goals framework
- Progress tracking
- Goal alignment with company objectives
-
360-Degree Feedback Enhancement
- Multi-source feedback collection
- Anonymous feedback options
- Peer nomination system
-
Performance Review Workflows
- Automated review cycles
- Approval workflows
- Performance improvement plans
-
Third-party Integrations
- HR Information Systems (HRIS)
- Single Sign-On (SSO)
- Calendar applications
-
Advanced Analytics
- Machine learning insights
- Predictive analytics
- Performance forecasting
-
Mobile Application
- Native iOS/Android apps
- Offline functionality
- Push notifications
-
Multi-tenant Architecture
- Organization isolation
- Custom branding
- Configurable workflows
-
Advanced Security
- Two-factor authentication
- Audit logging
- Data encryption at rest
-
API Rate Limiting & Monitoring
- Request throttling
- API usage analytics
- Performance monitoring
See the open issues for a list of known bugs and feature requests.
Have ideas for new features? We'd love to hear from you!
- π‘ Request a feature
- π Report a bug
- π¬ Join the discussion
We welcome contributions from the community! Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
π Report Bugs
- Use our bug report template
- Include detailed steps to reproduce the issue
- Provide environment information
π‘ Suggest Features
- Use our feature request template
- Explain the feature and its benefits
- Consider the impact on existing functionality
π Improve Documentation
- Fix typos and grammatical errors
- Add examples and clarifications
- Translate documentation
π§ Submit Code
- Fix bugs and implement features
- Improve performance and security
- Add tests and improve coverage
- Follow JavaScript ES6+ standards
- Use meaningful variable and function names
- Add comments for complex logic
- Maintain consistent indentation (2 spaces)
Follow the Conventional Commits specification:
feat: add user profile update endpoint
fix: resolve JWT token validation issue
docs: update API documentation
test: add unit tests for auth service
refactor: improve error handling structure
- Write unit tests for new features
- Ensure all existing tests pass
- Test API endpoints with various inputs
- Verify error handling scenarios
-
Fork the Project
git clone https://github.com/your-username/innovaDigits-PMS-Backend.git cd innovaDigits-PMS-Backend -
Create your Feature Branch
git checkout -b feature/amazing-feature # or for bug fixes git checkout -b fix/bug-description -
Set up development environment
npm install cp .env.example .env # Configure your environment -
Make your changes
- Write your code following the style guidelines
- Add tests for new functionality
- Update documentation as needed
-
Test your changes
npm test npm start # Verify the server runs correctly
-
Commit your Changes
git add . git commit -m 'feat: add amazing feature'
-
Push to the Branch
git push origin feature/amazing-feature
-
Open a Pull Request
- Use our pull request template
- Provide a clear description of changes
- Link related issues
- Request reviews from maintainers
β Before submitting:
- Code follows the project's style guidelines
- Self-review of your code has been performed
- Comments have been added to hard-to-understand areas
- Documentation has been updated accordingly
- Tests have been added/updated and pass
- No new warnings or errors are introduced
π Pull Request checklist:
- Clear, descriptive title
- Detailed description of changes
- Screenshots/GIFs for UI changes
- Breaking changes are documented
- Related issues are linked
This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold this code.
- π¬ Start a discussion
- π§ Contact the maintainers
- π Check existing documentation and issues
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Mostafa Nasser & innovaDigits Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
[Full license text in LICENSE file]
What this means:
- β Commercial use allowed
- β Modification allowed
- β Distribution allowed
- β Private use allowed
- β No liability or warranty provided
Mostafa Nasser - Lead Developer & Project Maintainer
- π GitHub: @MN-987
- πΌ LinkedIn: Connect with Mostafa
- π§ Email: Contact
innovaDigits - Software Development Company
- π Website: innovaDigits
- πΌ LinkedIn: innovaDigits Company
- π’ Location: Egypt
We appreciate all contributors who have helped make this project better! π
Want to see your name here? Check out our Contributing Guidelines and submit your first pull request!
We'd like to thank the following resources and communities that made this project possible:
- Express.js - Fast, unopinionated web framework for Node.js
- MongoDB - The database for modern applications
- Mongoose - Elegant MongoDB object modeling for Node.js
- JSON Web Tokens - Industry standard for secure authentication
- Node.js - JavaScript runtime built on Chrome's V8 engine
- Nodemon - Utility that monitors for changes and restarts server
- Postman - API development and testing platform
- Visual Studio Code - Source code editor
- MDN Web Docs - Comprehensive web development documentation
- Node.js Documentation - Official Node.js documentation
- MongoDB University - Free online courses for MongoDB
- GitHub - Development platform and version control
- npm - Package manager for Node.js
- Stack Overflow - Developer community and Q&A platform
- REST API Design - Best practices for RESTful API design
- The Twelve-Factor App - Methodology for building SaaS applications
- Semantic Versioning - Versioning scheme for software
- innovaDigits Team - For providing the vision and requirements for this project
- Open Source Contributors - For their valuable contributions and feedback
- Developer Community - For continuous learning and knowledge sharing
Made with β€οΈ by the innovaDigits Team
Building the future of performance management, one commit at a time.
