{"id":21763305,"url":"https://github.com/techjmi/deals_front","last_synced_at":"2026-04-12T15:02:14.946Z","repository":{"id":264369874,"uuid":"893171056","full_name":"techjmi/Deals_front","owner":"techjmi","description":"Employee Management","archived":false,"fork":false,"pushed_at":"2024-12-08T19:09:54.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T04:44:07.141Z","etag":null,"topics":["authentication","bcryptjs","express","jwt-authentication","mern-stack","mongodb","nodejs","reactjs","vite"],"latest_commit_sha":null,"homepage":"https://deals-front.onrender.com","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/techjmi.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":"2024-11-23T18:09:05.000Z","updated_at":"2024-12-08T19:09:57.000Z","dependencies_parsed_at":"2024-11-23T21:04:10.260Z","dependency_job_id":null,"html_url":"https://github.com/techjmi/Deals_front","commit_stats":null,"previous_names":["techjmi/deals_front"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/techjmi/Deals_front","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjmi%2FDeals_front","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjmi%2FDeals_front/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjmi%2FDeals_front/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjmi%2FDeals_front/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/techjmi","download_url":"https://codeload.github.com/techjmi/Deals_front/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/techjmi%2FDeals_front/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274100775,"owners_count":25222443,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["authentication","bcryptjs","express","jwt-authentication","mern-stack","mongodb","nodejs","reactjs","vite"],"created_at":"2024-11-26T12:14:57.107Z","updated_at":"2026-04-12T15:02:09.882Z","avatar_url":"https://github.com/techjmi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Employee Management System (MERN Stack)  \nwarning if you are facing any issue try to refersh it after login\nAn authenticated MERN-based Employee Management System to **Create**, **Read**, **Update**, and **Delete** employee records. It includes user authentication and role-based access, built with **Vite**, **TailwindCSS**, and **Node.js**.  \n\n---\n\n## Project Overview  \n\n- **Frontend Repository**: [GitHub](https://github.com/techjmi/Deals_front)  \n- **Frontend Deployed URL**: [deals-front.onrender.com](https://deals-front.onrender.com/)  \n- **Backend Repository**: [GitHub](https://github.com/techjmi/Deals_Dray_Backend)  \n- **Backend Deployed URL**: [deals-dray-backend.onrender.com](https://deals-dray-backend.onrender.com/)  \n\n---\n\n## Features  \n\n1. **User Authentication**:\n   - **Signup** with additional fields: `userName`, `fullName`, `email`, `password`, and `profile_pic` (stored in Firebase).\n   - **Login** using `userName` and `password`.\n   - Passwords are hashed using **bcryptjs** for security.\n   - Protected routes with JWT for secure access.\n2. **Employee Management**:\n   - Create, View, Update, and Delete employee records.\n   - Fields required for creating an employee:\n     - `fullName`, `email`, `MobileNo`, `Designation`, `Gender`, `course` (array), and `image` (stored in Firebase).\n   - List all employees with role-based restrictions.\n3. **Frontend**:\n   - Built with **Vite** and **TailwindCSS** for fast development and beautiful UI.\n4. **Backend**:\n   - Node.js and Express.js for API handling.\n   - MongoDB for database management.\n\n---\n\n## Folder Structure  \n\n### **Frontend** (client)\n```\nclient/\n├── src/\n│   ├── components/    # Reusable UI components\n│   ├── pages/         # Application pages (e.g., Login, Dashboard, etc.)\n│   ├── services/      # API service functions\n│   ├── context/       # Context API for global state management\n│   └── main.jsx       # Main entry point for React\n├── tailwind.config.js # TailwindCSS configuration\n└── vite.config.js     # Vite configuration\n```\n\n### **Backend** (server)\n```\nserver/\n├── controller/        # Logic for authentication and employee operations\n├── model/             # Mongoose schemas for User and Employee\n├── routes/            # API route definitions\n├── database/          # MongoDB connection setup\n├── utils/             # Utility functions (e.g., auth.js for JWT verification)\n├── middleware/        # Middleware (e.g., for authentication)\n├── .env               # Environment variables (JWT_SECRET, MONGO_URI)\n└── index.js           # Entry point for the server\n```\n\n---\n\n## Installation Guide  \n\n### Prerequisites  \n- Node.js (v16+ recommended)  \n- MongoDB (local or cloud, e.g., MongoDB Atlas)  \n- Git  \n\n---\n\n### 1. Clone Repositories  \n\n```bash\n# Clone Frontend\ngit clone https://github.com/techjmi/Deals_front.git\ncd Deals_front\n\n# Clone Backend\ngit clone https://github.com/techjmi/Deals_Dray_Backend.git\ncd Deals_Dray_Backend\n```\n\n---\n\n### 2. Setup Backend  \n\n#### Install Dependencies:  \n```bash\ncd server\nnpm install\n```\n\n#### Create `.env` File:  \n```env\nMONGO_URI=\u003cyour-mongodb-connection-string\u003e\nJWT_SECRET=\u003cyour-jwt-secret-key\u003e\nFIREBASE_API_KEY=\u003cyour-firebase-api-key\u003e\nFIREBASE_PROJECT_ID=\u003cyour-firebase-project-id\u003e\nFIREBASE_STORAGE_BUCKET=\u003cyour-firebase-storage-bucket\u003e\n```\n\n#### Run Backend:  \n```bash\nnode server/index.js\n```\n\nThe backend will run on `http://localhost:8000` (or your defined port).\n\n---\n\n### 3. Setup Frontend  \n\n#### Install Dependencies:  \n```bash\ncd client\nnpm install\n```\n\n#### Start Development Server:  \n```bash\nnpm run dev\n```\n\nThe frontend will run on `http://localhost:5173`.\n\n---\n\n## API Documentation  \n\n### **Base URL**\n- Local: `http://localhost:8000/api`\n- Deployed: [deals-dray-backend.onrender.com/api](https://deals-dray-backend.onrender.com/api)\n\n---\n\n### **Authentication Endpoints**  \n\n#### **POST /api/auth/signup**  \nCreate a new user.  \n\n**Request Body**:  \n```json\n{\n  \"userName\": \"john_doe\",\n  \"fullName\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"securepassword\",\n  \"profile_pic\": \"\u003cFirebase_URL\u003e\"\n}\n```\n\n**Response**:  \n```json\n{\n  \"success\": true,\n  \"message\": \"User registered successfully!\"\n}\n```\n\n---\n\n#### **POST /api/auth/login**  \nAuthenticate a user.  \n\n**Request Body**:  \n```json\n{\n  \"userName\": \"john_doe\",\n  \"password\": \"securepassword\"\n}\n```\n\n**Response**:  \n```json\n{\n  \"success\": true,\n  \"token\": \"\u003cJWT_Token\u003e\",\n  \"user\": {\n    \"id\": \"user_id\",\n    \"userName\": \"john_doe\",\n    \"fullName\": \"John Doe\"\n  }\n}\n```\n\n---\n\n### **Employee Endpoints**  \n\n#### **POST /api/employee/create**  \nCreate a new employee.  \n\n**Headers**:  \n`Authorization: Bearer \u003cJWT_Token\u003e`  \n\n**Request Body**:  \n```json\n{\n  \"fullName\": \"Jane Doe\",\n  \"email\": \"jane@example.com\",\n  \"MobileNo\": \"1234567890\",\n  \"Designation\": \"Software Engineer\",\n  \"Gender\": \"Female\",\n  \"course\": [\"React\", \"Node.js\"],\n  \"image\": \"\u003cFirebase_URL\u003e\"\n}\n```\n\n**Response**:  \n```json\n{\n  \"success\": true,\n  \"message\": \"Employee created successfully!\",\n  \"employee\": {\n    \"id\": \"employee_id\",\n    \"fullName\": \"Jane Doe\",\n    \"email\": \"jane@example.com\",\n    \"MobileNo\": \"1234567890\",\n    \"Designation\": \"Software Engineer\",\n    \"Gender\": \"Female\",\n    \"course\": [\"React\", \"Node.js\"],\n    \"image\": \"\u003cFirebase_URL\u003e\"\n  }\n}\n```\n\n---\n\n#### **GET /api/employee/emp_list**  \nGet all employees.  \n\n**Headers**:  \n`Authorization: Bearer \u003cJWT_Token\u003e`  \n\n**Response**:  \n```json\n{\n  \"success\": true,\n  \"employees\": [\n    {\n      \"id\": \"employee_id\",\n      \"fullName\": \"Jane Doe\",\n      \"email\": \"jane@example.com\",\n      \"MobileNo\": \"1234567890\",\n      \"Designation\": \"Software Engineer\",\n      \"Gender\": \"Female\",\n      \"course\": [\"React\", \"Node.js\"],\n      \"image\": \"\u003cFirebase_URL\u003e\"\n    }\n  ]\n}\n```\n\n---\n\n## Testing with Postman  \n\n1. **Setup Authorization**:  \n   - For protected routes, include the JWT token in the headers:  \n     `Authorization: Bearer \u003cJWT_Token\u003e`.  \n\n2. **API Collection**:  \n   - Import the provided Postman collection file (if available) for faster testing.  \n\n---\n\n## Technologies Used  \n\n- **Frontend**: React, Vite, TailwindCSS  \n- **Backend**: Node.js, Express.js  \n- **Database**: MongoDB (Mongoose ORM)  \n- **Authentication**: JWT and bcryptjs  \n- **Storage**: Firebase for images  \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjmi%2Fdeals_front","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechjmi%2Fdeals_front","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechjmi%2Fdeals_front/lists"}