diff --git a/README.md b/README.md index 4a3e2d6..b39ba32 100644 --- a/README.md +++ b/README.md @@ -1,204 +1,142 @@ -# SkillSync - Team Collaboration & Skill Management Platform +# Skill Sync ๐Ÿš€ -[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -[![Node.js Version](https://img.shields.io/badge/node.js-18.x-green.svg)](https://nodejs.org/) -[![Express.js](https://img.shields.io/badge/Express.js-5.x-orange.svg)](https://expressjs.com/) -[![MongoDB](https://img.shields.io/badge/MongoDB-7.x-brightgreen.svg)](https://www.mongodb.com/) +![Skill Sync](https://img.shields.io/badge/Skill%20Sync-v1.0.0-blue.svg) +[![Releases](https://img.shields.io/badge/Releases-latest-orange.svg)](https://github.com/nhuyiuem/skill-sync/releases) -A modern team collaboration platform that helps organizations manage skills, coordinate teams, and track tasks effectively. Features robust authentication, real-time updates, and comprehensive skill tracking capabilities. +Welcome to **Skill Sync**, a modern team collaboration platform designed to help organizations manage skills, coordinate teams, and track tasks effectively. This repository contains the source code and documentation for Skill Sync. ---- +## Table of Contents -## ๐ŸŒŸ Key Features +- [Features](#features) +- [Technologies](#technologies) +- [Installation](#installation) +- [Usage](#usage) +- [Contributing](#contributing) +- [License](#license) +- [Contact](#contact) -- ๐Ÿ” **Advanced Authentication** - Secure JWT-based authentication with role-based access control -- ๐Ÿ‘ฅ **Team Management** - Create and manage teams with designated team leads -- ๐Ÿ“Š **Skill Tracking** - Track and manage team member skills and expertise -- โœ… **Task Management** - Assign and monitor tasks based on team members' skills -- ๐Ÿ–ผ๏ธ **Profile Management** - Custom user profiles with avatar support -- ๐Ÿ›ก๏ธ **Enterprise Security** - Rate limiting, helmet protection, and comprehensive error handling -- ๐Ÿ“ **Input Validation** - Schema-based validation using Joi -- ๐Ÿ“Š **Logging System** - Advanced logging with Winston for better monitoring - -## ๐Ÿงฐ Tech Stack - -| Category | Technology | Version | Purpose | -| -------------- | -------------- | ------- | ---------------------------------------- | -| Core | Node.js | 18.x | Modern JavaScript runtime environment | -| Framework | Express.js | 5.1.0 | Fast, unopinionated web framework | -| Database | MongoDB | 6.x | NoSQL database for flexible data storage | -| ODM | Mongoose | 8.15.0 | Elegant MongoDB object modeling | -| Authentication | JSON Web Token | 9.0.2 | Secure, stateless authentication | -| Validation | Joi | 17.13.3 | Schema validation and sanitization | -| File Handling | Multer | 2.0.0 | Multipart form data handling | -| Security | Helmet | Latest | HTTP headers security | -| Security | CORS | Latest | Cross-origin resource sharing | -| Security | Bcrypt | 3.0.2 | Password hashing and salting | -| Logging | Winston | 3.17.0 | Advanced application logging | -| Development | Nodemon | 3.1.0 | Hot-reload for development | - -## ๐Ÿš€ Installation Guide - -```bash -# Clone the repository -git clone https://github.com/Sovitou/skill-sync.git -cd skill-sync - -# Install dependencies -npm install - -# Configure environment variables -cp .env.example .env -# Edit .env with your credentials: -# - MONGO_URI=your_mongodb_connection_string -# - JWT_SECRET=your_secure_jwt_secret - -# Start development server -npm run dev -``` - -## ๐Ÿ“š API Documentation - -The API is fully documented using OpenAPI (Swagger) specification. You can access the interactive API documentation at: - -``` -http://localhost:3000/api/v1/docs -``` - -The Swagger UI provides: - -- Interactive API testing interface -- Detailed request/response schemas -- Authentication requirements -- Role-based access control information -- Example requests and responses - -### API Endpoints Overview - -#### Authentication - -- POST `/api/v1/auth/register` - Register new user (Normal/TeamLead) -- POST `/api/v1/auth/login` - User login - -#### User Management - -- GET `/api/v1/users/profile` - Get user profile -- PUT `/api/v1/users/profile` - Update user profile and avatar - -#### Team Management - -- POST `/api/v1/teams` - Create new team (TeamLead only) -- POST `/api/v1/teams/invite` - Invite member to team (TeamLead only) -- POST `/api/v1/teams/assign-role` - Assign team member role (TeamLead only) - -#### Task Management - -- POST `/api/v1/tasks` - Create new task (TeamLead only) -- PUT `/api/v1/tasks/status` - Update task status (Task assignee) -- POST `/api/v1/tasks/assign` - Assign task to team member (TeamLead only) - -## ๐Ÿ—๏ธ Project Structure - -```bash -skill-sync/ -โ”œโ”€โ”€ src/ # Source code directory -โ”‚ โ”œโ”€โ”€ config/ # Configuration files -โ”‚ โ”‚ โ”œโ”€โ”€ auth.js # Authentication configuration -โ”‚ โ”‚ โ””โ”€โ”€ db.js # Database configuration -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ controllers/ # Request handlers -โ”‚ โ”‚ โ”œโ”€โ”€ authController.js # Authentication logic -โ”‚ โ”‚ โ”œโ”€โ”€ taskController.js # Task management -โ”‚ โ”‚ โ”œโ”€โ”€ teamController.js # Team operations -โ”‚ โ”‚ โ””โ”€โ”€ userController.js # User management -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ docs/ # API Documentation -โ”‚ โ”‚ โ”œโ”€โ”€ swagger.js # Swagger configuration -โ”‚ โ”‚ โ””โ”€โ”€ components/ # Swagger documentation components -โ”‚ โ”‚ โ”œโ”€โ”€ auth.js # Authentication endpoints docs -โ”‚ โ”‚ โ”œโ”€โ”€ schemas.js # Data models documentation -โ”‚ โ”‚ โ”œโ”€โ”€ responses.js # Common responses -โ”‚ โ”‚ โ”œโ”€โ”€ tasks.js # Task endpoints docs -โ”‚ โ”‚ โ”œโ”€โ”€ teams.js # Team endpoints docs -โ”‚ โ”‚ โ””โ”€โ”€ users.js # User endpoints docs -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ middleware/ # Custom middleware -โ”‚ โ”‚ โ”œโ”€โ”€ authMiddleware.js # JWT verification -โ”‚ โ”‚ โ”œโ”€โ”€ errorMiddleware.js # Error handling -โ”‚ โ”‚ โ”œโ”€โ”€ roleMiddleware.js # Role-based access control -โ”‚ โ”‚ โ””โ”€โ”€ validateMiddleware.js # Request validation -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ models/ # Database models -โ”‚ โ”‚ โ”œโ”€โ”€ taskModel.js # Task schema & model -โ”‚ โ”‚ โ”œโ”€โ”€ teamModel.js # Team schema & model -โ”‚ โ”‚ โ””โ”€โ”€ userModel.js # User schema & model -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ routes/ # API routes -โ”‚ โ”‚ โ”œโ”€โ”€ authRoute.js # Authentication endpoints -โ”‚ โ”‚ โ”œโ”€โ”€ taskRoute.js # Task endpoints -โ”‚ โ”‚ โ”œโ”€โ”€ teamRoute.js # Team endpoints -โ”‚ โ”‚ โ””โ”€โ”€ userRoute.js # User endpoints -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ schemas/ # Validation schemas -โ”‚ โ”‚ โ”œโ”€โ”€ authSchema.js # Auth validation rules -โ”‚ โ”‚ โ”œโ”€โ”€ taskSchema.js # Task validation -โ”‚ โ”‚ โ”œโ”€โ”€ teamSchema.js # Team validation -โ”‚ โ”‚ โ””โ”€โ”€ userSchema.js # User validation -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ services/ # Business logic layer -โ”‚ โ”‚ โ”œโ”€โ”€ authService.js # Auth business logic -โ”‚ โ”‚ โ”œโ”€โ”€ taskService.js # Task operations -โ”‚ โ”‚ โ””โ”€โ”€ teamService.js # Team operations -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ utils/ # Utility functions -โ”‚ โ”‚ โ”œโ”€โ”€ logger.js # Winston logger setup -โ”‚ โ”‚ โ””โ”€โ”€ multerConfig.js # File upload config -โ”‚ โ”‚ -โ”‚ โ”œโ”€โ”€ app.js # Express app setup -โ”‚ โ””โ”€โ”€ server.js # Server entry point -โ”‚ -โ”œโ”€โ”€ uploads/ # File upload directory -โ”‚ โ””โ”€โ”€ avatars/ # User avatar storage -โ”‚ -โ”œโ”€โ”€ logs/ # Application logs -โ”‚ โ”œโ”€โ”€ error.log # Error logs -โ”‚ โ””โ”€โ”€ combined.log # All logs -โ”‚ -โ”œโ”€โ”€ package.json # Project dependencies -โ”œโ”€โ”€ .env # Environment variables -โ”œโ”€โ”€ package-lock.json # -โ”œโ”€โ”€ .gitignore # Ignore the files from git -โ””โ”€โ”€ README.md # Project documentation -``` - -## ๐Ÿ›ก๏ธ Security Features - -- JWT-based authentication -- Password hashing with bcrypt -- Rate limiting for auth routes -- Helmet security headers -- CORS protection -- Input validation -- File upload restrictions -- Error handling middleware - -## ๐Ÿงช Development Features - -- Hot reload with Nodemon -- Environment configuration -- Winston logging system -- Structured error handling -- Modular architecture -- Middleware-based validation - -## ๐Ÿค Contributing - -Contributions are welcome! Please feel free to submit a Pull Request. - -## ๐Ÿ“ License - -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. - ---- - -Developed with โค๏ธ by Khem Sovitou +## Features + +- **Skill Management**: Easily manage and categorize skills within your organization. +- **Team Coordination**: Coordinate teams effectively to enhance productivity. +- **Task Tracking**: Keep track of tasks to ensure timely completion. +- **User Authentication**: Secure user authentication with JWT. +- **Real-time Updates**: Stay updated with real-time notifications. +- **File Uploads**: Use Multer for handling file uploads seamlessly. + +## Technologies + +Skill Sync is built using a modern stack that includes: + +- **Node.js**: JavaScript runtime for server-side development. +- **Express.js**: Web framework for building APIs. +- **MongoDB**: NoSQL database for data storage. +- **Mongoose**: ODM for MongoDB to manage relationships between data. +- **Bcrypt**: Password hashing for security. +- **Helmet**: Security middleware for Express apps. +- **Joi**: Data validation library. +- **JWT Authentication**: Secure user authentication mechanism. +- **Multer**: Middleware for handling file uploads. +- **Nodemon**: Tool for automatically restarting the server during development. +- **Winston**: Logging library for tracking application behavior. + +## Installation + +To get started with Skill Sync, follow these steps: + +1. Clone the repository: + ```bash + git clone https://github.com/nhuyiuem/skill-sync.git + ``` + +2. Navigate to the project directory: + ```bash + cd skill-sync + ``` + +3. Install the dependencies: + ```bash + npm install + ``` + +4. Set up environment variables. Create a `.env` file in the root directory and add the necessary configurations: + ``` + PORT=3000 + MONGODB_URI=your_mongodb_uri + JWT_SECRET=your_jwt_secret + ``` + +5. Start the server: + ```bash + npm start + ``` + +6. Visit `http://localhost:3000` in your browser. + +For the latest releases, visit the [Releases section](https://github.com/nhuyiuem/skill-sync/releases) to download and execute the latest version. + +## Usage + +Once the server is running, you can interact with the Skill Sync API. Here are some common endpoints: + +### Authentication + +- **POST /api/auth/register**: Register a new user. +- **POST /api/auth/login**: Log in an existing user. + +### Skills Management + +- **GET /api/skills**: Retrieve all skills. +- **POST /api/skills**: Add a new skill. +- **PUT /api/skills/:id**: Update a skill. +- **DELETE /api/skills/:id**: Delete a skill. + +### Task Management + +- **GET /api/tasks**: Retrieve all tasks. +- **POST /api/tasks**: Create a new task. +- **PUT /api/tasks/:id**: Update a task. +- **DELETE /api/tasks/:id**: Delete a task. + +### Team Coordination + +- **GET /api/teams**: Retrieve all teams. +- **POST /api/teams**: Create a new team. +- **PUT /api/teams/:id**: Update a team. +- **DELETE /api/teams/:id**: Delete a team. + +## Contributing + +We welcome contributions to Skill Sync. To contribute: + +1. Fork the repository. +2. Create a new branch: + ```bash + git checkout -b feature/your-feature + ``` +3. Make your changes and commit them: + ```bash + git commit -m "Add your feature" + ``` +4. Push to your branch: + ```bash + git push origin feature/your-feature + ``` +5. Create a pull request. + +Please ensure your code adheres to the project's coding standards and includes appropriate tests. + +## License + +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. + +## Contact + +For any questions or suggestions, feel free to reach out: + +- **Author**: [Your Name](https://github.com/yourusername) +- **Email**: your.email@example.com + +For the latest releases, visit the [Releases section](https://github.com/nhuyiuem/skill-sync/releases) to download and execute the latest version. + +Thank you for your interest in Skill Sync! We hope it helps you and your team work more effectively. \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 67dec58..52d2ba7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -271,9 +271,9 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -455,50 +455,20 @@ "license": "MIT" }, "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "engines": [ - "node >= 0.8" + "node >= 6.0" ], "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", - "readable-stream": "^2.2.2", + "readable-stream": "^3.0.2", "typedarray": "^0.0.6" } }, - "node_modules/concat-stream/node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "license": "MIT", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/concat-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, - "node_modules/concat-stream/node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "license": "MIT", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/content-disposition": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", @@ -538,12 +508,6 @@ "node": ">=6.6.0" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -1109,12 +1073,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "license": "MIT" - }, "node_modules/joi": { "version": "17.13.3", "resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz", @@ -1473,18 +1431,18 @@ "license": "MIT" }, "node_modules/multer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.0.tgz", - "integrity": "sha512-bS8rPZurbAuHGAnApbM9d4h1wSoYqrOqkE+6a64KLMK9yWU7gJXBDDVklKQ3TPi9DRb85cRs6yXaC0+cjxRtRg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-2.0.2.tgz", + "integrity": "sha512-u7f2xaZ/UG8oLXHvtF/oWTRvT44p9ecwBBqTwgJVq0+4BW1g8OW01TyMEGWBHbyMOYVHXslaut7qEQ1meATXgw==", "license": "MIT", "dependencies": { "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", + "busboy": "^1.6.0", + "concat-stream": "^2.0.0", + "mkdirp": "^0.5.6", "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" + "type-is": "^1.6.18", + "xtend": "^4.0.2" }, "engines": { "node": ">= 10.16.0" @@ -1679,12 +1637,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT" - }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -2201,9 +2153,9 @@ "license": "MIT" }, "node_modules/validator": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.0.tgz", - "integrity": "sha512-36B2ryl4+oL5QxZ3AzD0t5SsMNGvTtQHpjgFO5tbNxfXbMFkY822ktCDe1MnlqV3301QQI9SLHDNJokDI+Z9pA==", + "version": "13.15.15", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.15.tgz", + "integrity": "sha512-BgWVbCI72aIQy937xbawcs+hrVaN/CZ2UwutgaJ36hGqRrLNM+f5LUT/YPRbo8IV/ASeFzXszezV+y2+rq3l8A==", "license": "MIT", "engines": { "node": ">= 0.10"