{"id":22553587,"url":"https://github.com/jetsup/express-api","last_synced_at":"2025-03-28T10:25:45.962Z","repository":{"id":266723999,"uuid":"872117382","full_name":"jetsup/Express-API","owner":"jetsup","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-17T06:28:15.000Z","size":77,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T11:13:43.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://express-api-pearl.vercel.app","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/jetsup.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-10-13T20:24:02.000Z","updated_at":"2024-12-05T18:36:20.000Z","dependencies_parsed_at":"2024-12-05T19:41:02.435Z","dependency_job_id":null,"html_url":"https://github.com/jetsup/Express-API","commit_stats":null,"previous_names":["jetsup/express-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetsup%2FExpress-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetsup%2FExpress-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetsup%2FExpress-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jetsup%2FExpress-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jetsup","download_url":"https://codeload.github.com/jetsup/Express-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246010994,"owners_count":20709191,"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":[],"created_at":"2024-12-07T18:10:00.184Z","updated_at":"2025-03-28T10:25:45.919Z","avatar_url":"https://github.com/jetsup.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Express-API\n\n## Description\n\nThis is a simple API built with ExpressJS. It has the following endpoints:\n\nUser Management:\n\n-   POST `/api/v1/users/signup` - To register a user\n-   GET `/api/v1/users/login` - To login a user\n\nEmployee Management:\n\n-   GET `/api/v1/employees` - To get all employees\n-   POST `/api/v1/employees` - To add an employee\n-   GET `/api/v1/employees/:eid` - To get an employee by ID\n-   PUT `/api/v1/employees/:eid` - To update an employee by ID\n-   DELETE `/api/v1/employees/xxx` - To delete an employee by ID\n\n## Prerequisites\n\n-   [Node.js](https://nodejs.org/en/download/)\n-   [MongoDB](https://www.mongodb.com/try/download/community)\n-   [Postman](https://www.postman.com/downloads/)\n\n## Installation\n\n1. Clone the repository\n2. Run `npm install` to install dependencies\n3. Copy the [`.env.example`](.env.example) file to `.env` and set the environment variables\n4. Run `nodemon` to start the development server\n\n## Usage\n\nYou can use [Postman](https://www.postman.com/downloads/) to test the API. The base URL is `http://localhost:PORT/api/v1/`. The PORT is the port number set in your [`.env`](.env#L1) file.\n\nFirst time users should register a user by sending a POST request to `/users/signup` with the following payload:\n\n```json\n{\n    \"username\": \"someone\",\n    \"email\": \"someone@example.com\",\n    \"password\": \"password123\"\n}\n```\n\nAfter registering, you can login by sending a GET request to `/users/login` with the following payload:\n\n```json\n{\n    \"email\": \"someone@example.com\",\n    \"password\": \"password123\"\n}\n```\n\nYou will receive a token which you can use to access the other endpoints.\n\nSet the token in the `Authorization` header, type `Bearer Token`.\n\n### Employee Management - CRUD Operations\n\n1.  To `CREATE` an employee, send a POST request to `/employees` with the following payload:\n\n    ```json\n    {\n        \"first_name\": \"Alice\",\n        \"last_name\": \"Johnson\",\n        \"email\": \"alice.johnson@example.com\",\n        \"position\": \"Designer\",\n        \"salary\": 85000,\n        \"date_of_joining\": \"2023-08-10\",\n        \"department\": \"Design\"\n    }\n    ```\n\n2.  To get(`READ`) all employees, send a GET request to `/employees`.\n\n    -   To get an employee by ID, send a GET request to `/employees/:eid`. Replace `:eid` with the employee ID.\n\n3.  To `UPDATE` an employee by ID, send a PUT request to `/employees/:eid`. Replace `:eid` with the employee ID. e.g.\n\n    method: PUT\n    url: http://localhost:PORT/api/v1/emp/employees/64c9e5a3d9f3c1a5c9b4e8a4\n\n    ```json\n    {\n        \"position\": \"Senior Designer\",\n        \"salary\": 95000\n    }\n    ```\n\n4.  To `DELETE` an employee by ID, send a DELETE request to `/employees/:eid`. Replace `:eid` with the employee ID. e.g.\n\n        method: DELETE\n        url: http://localhost:PORT/api/v1/employees/64c9e5a3d9f3c1a5c9b4e8a4\n\n## Author\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetsup%2Fexpress-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetsup%2Fexpress-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetsup%2Fexpress-api/lists"}