{"id":25009236,"url":"https://github.com/nodeninjar/nexus-tech-server","last_synced_at":"2026-04-13T04:05:03.538Z","repository":{"id":275819800,"uuid":"926063380","full_name":"nodeNINJAr/nexus-tech-server","owner":"nodeNINJAr","description":"Nexus Tech (employee management website)- server side code","archived":false,"fork":false,"pushed_at":"2025-02-18T23:09:22.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T01:45:52.026Z","etag":null,"topics":["express-js","gemini","gemini-api","jwt-authentication","mongodb","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nodeNINJAr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-02T13:16:50.000Z","updated_at":"2025-02-18T23:09:25.000Z","dependencies_parsed_at":"2025-02-04T19:25:42.204Z","dependency_job_id":"f8d71e6b-f0bd-4ce9-802b-3683bf1745fa","html_url":"https://github.com/nodeNINJAr/nexus-tech-server","commit_stats":null,"previous_names":["nodeninjar/nexus-tech-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeNINJAr%2Fnexus-tech-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeNINJAr%2Fnexus-tech-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeNINJAr%2Fnexus-tech-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nodeNINJAr%2Fnexus-tech-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nodeNINJAr","download_url":"https://codeload.github.com/nodeNINJAr/nexus-tech-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246266247,"owners_count":20749754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-js","gemini","gemini-api","jwt-authentication","mongodb","nodejs"],"created_at":"2025-02-05T04:38:56.906Z","updated_at":"2026-04-13T04:05:03.470Z","avatar_url":"https://github.com/nodeNINJAr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# **Nexus Tech – Server**  \n\n## 🚀 Introduction  \n\nThe **Nexus Tech Server** is the backend for the **Nexus Tech Employee Management System (EMS)**. It provides robust APIs for managing employees, handling authentication, processing payments, and interacting with the database.  \n\nThis backend is built using **Node.js** and **Express**, with **MongoDB** as the database. It ensures **secure authentication** with **JWT**, manages **real-time data**, and integrates **Stripe** for payment processing.  \n\n---\n\n## 📑 Table of Contents  \n\n- [**Nexus Tech – Server**](#nexus-tech--server)\n  - [🚀 Introduction](#-introduction)\n  - [📑 Table of Contents](#-table-of-contents)\n  - [🌟 Features](#-features)\n  - [🛠 Tech Stack](#-tech-stack)\n  - [📥 Installation](#-installation)\n    - [**Prerequisites**](#prerequisites)\n    - [**Steps**](#steps)\n  - [▶️ Usage](#️-usage)\n  - [📜 Available Scripts](#-available-scripts)\n  - [⚙️ Environment Variables](#️-environment-variables)\n    - [**MongoDB Connection**](#mongodb-connection)\n  - [🔗 API Endpoints](#-api-endpoints)\n    - [**Authentication**](#authentication)\n    - [**Employee Management**](#employee-management)\n    - [**Payment Processing**](#payment-processing)\n    - [**AI-Powered Features**](#ai-powered-features)\n  - [🛠 Troubleshooting](#-troubleshooting)\n\n---\n\n## 🌟 Features  \n\n✅ **User Authentication** – Secure login \u0026 signup with JWT-based authentication.  \n✅ **Employee Management** – Manage employee records, attendance, and HR-related data.  \n✅ **Role-Based Access Control (RBAC)** – Secure different access levels for admins, HR, and employees.  \n✅ **Database Management** – Uses MongoDB for efficient and scalable data storage.  \n✅ **Secure API Communication** – Implements CORS, cookie-parser, and dotenv for secure data flow.  \n✅ **Payment Integration** – Processes transactions securely using **Stripe**.  \n✅ **Google Gemini AI Integration** – Leverages **Google AI API** for smart automation.  \n✅ **Logging \u0026 Monitoring** – Uses **Morgan** for detailed request logging.  \n\n---\n\n## 🛠 Tech Stack  \n\n| Technology  | Purpose |\n|-------------|---------|\n| **Node.js**   | JavaScript Runtime |\n| **Express.js** | Web Framework |\n| **MongoDB** | NoSQL Database |\n| **JWT (jsonwebtoken)** | Authentication |\n| **Stripe API** | Payment Processing |\n| **Google Gemini AI API** | AI-powered automation |\n| **Dotenv** | Environment Configuration |\n| **Morgan** | HTTP Request Logging |\n| **CORS** | Cross-Origin Requests Handling |\n\n---\n\n## 📥 Installation  \n\n### **Prerequisites**  \n\n- **Node.js (\u003e=16.0.0)**  \n- **MongoDB Atlas or Local MongoDB Instance**  \n\n### **Steps**  \n\n1. Clone the repository:  \n   ```sh\n   git clone https://github.com/nodeNINJAr/nexus-tech-server\n   cd nexus-tech-server\n   ```  \n2. Install dependencies:  \n   ```sh\n   npm install\n   ```  \n3. Create a `.env` file and configure the environment variables (see [Environment Variables](#-environment-variables)).  \n4. Start the development server:  \n   ```sh\n   npm run dev\n   ```  \n\n---\n\n## ▶️ Usage  \n\n- **Start the production server:**  \n  ```sh\n  npm start\n  ```  \n- **Start the development server with live reload:**  \n  ```sh\n  npm run dev\n  ```  \n\n---\n\n## 📜 Available Scripts  \n\n| Command | Description |\n|---------|-------------|\n| `npm start` | Start the production server |\n| `npm run dev` | Start the server with Nodemon for live reload |\n\n---\n\n## ⚙️ Environment Variables  \n\nCreate a `.env` file in the root directory and configure the following:  \n\n```env\nPORT=5000\n\n# MongoDB Database\nDB_USER=your-db-username\nDB_PASS=your-db-password\nMONGODB_URI=mongodb+srv://$(DB_USER):$(DB_PASS)@cluster.mongodb.net/nexus-tech?retryWrites=true\u0026w=majority\n\n# Authentication\nJWT_SECRET_KEY=your-secret-key\n\n# Stripe Payment Integration\nSTRIPE_SECRET=your-stripe-secret-key\n\n# Google Gemini AI API\nGEMINI_API_KEY=your-google-gemini-api-key\n```\n\n### **MongoDB Connection**  \n\nEnsure your **MongoDB URI** is correctly configured in your `.env` file.  \nFor local MongoDB, use:  \n```env\nMONGODB_URI=mongodb://localhost:27017/nexus-tech\n```\n\nFor **MongoDB Atlas**, replace it with your cloud connection string.\n\n---\n\n## 🔗 API Endpoints  \n\n### **Authentication**  \n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/auth/register` | Register a new user |\n| `POST` | `/api/auth/login` | Login user \u0026 generate JWT |\n| `GET` | `/api/auth/user` | Get user profile |\n\n### **Employee Management**  \n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/api/employees` | Get all employees |\n| `POST` | `/api/employees` | Add a new employee |\n| `PUT` | `/api/employees/:id` | Update employee details |\n| `DELETE` | `/api/employees/:id` | Remove an employee |\n\n### **Payment Processing**  \n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/payments/create` | Create a new payment session |\n| `GET` | `/api/payments/status` | Check payment status |\n\n### **AI-Powered Features**  \n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/ai/generate-summary` | Generate employee performance summary using Gemini AI |\n| `POST` | `/api/ai/automate-tasks` | AI-powered HR task automation |\n\nFor full API documentation, refer to `api-docs.md` (if available).\n\n---\n\n## 🛠 Troubleshooting  \n\n- **Server Not Starting?**  \n  Ensure **MongoDB** is running and your `.env` variables are set up correctly.  \n\n- **CORS Issues?**  \n  Update your `cors` configuration in `index.js`:  \n  ```js\n  app.use(cors({\n    origin: \"http://localhost:5173\",\n    credentials: true\n  }));\n  ```  \n\n- **Invalid JWT Token?**  \n  - Make sure the token is correctly passed in the Authorization header.  \n  - Check if `JWT_SECRET_KEY` is correctly set in `.env`.  \n\n- **Google Gemini API Not Working?**  \n  - Ensure `GEMINI_API_KEY` is correctly set in `.env`.  \n  - Verify that your Google AI API quota is not exceeded.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeninjar%2Fnexus-tech-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnodeninjar%2Fnexus-tech-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnodeninjar%2Fnexus-tech-server/lists"}