{"id":15132530,"url":"https://github.com/elyasprba/backend-with-mongodb","last_synced_at":"2026-01-18T17:33:30.392Z","repository":{"id":255990199,"uuid":"854021499","full_name":"elyasprba/backend-with-mongodb","owner":"elyasprba","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-20T05:49:57.000Z","size":226,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T21:43:15.428Z","etag":null,"topics":["claudinary","docker-compose","express","midtrans-nodejs","mongodb","nodemailer","payment-gateway","redis","typescript","vercel-deployment"],"latest_commit_sha":null,"homepage":"https://backend-mongodb-app.vercel.app/","language":"TypeScript","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/elyasprba.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-09-08T07:28:32.000Z","updated_at":"2024-10-20T05:50:01.000Z","dependencies_parsed_at":"2024-09-08T11:50:32.571Z","dependency_job_id":"0056a9ef-9802-4b9d-b7cf-84a7cfab6060","html_url":"https://github.com/elyasprba/backend-with-mongodb","commit_stats":null,"previous_names":["elyasprba/backend-with-mongodb"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elyasprba/backend-with-mongodb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elyasprba%2Fbackend-with-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elyasprba%2Fbackend-with-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elyasprba%2Fbackend-with-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elyasprba%2Fbackend-with-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elyasprba","download_url":"https://codeload.github.com/elyasprba/backend-with-mongodb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elyasprba%2Fbackend-with-mongodb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28544901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["claudinary","docker-compose","express","midtrans-nodejs","mongodb","nodemailer","payment-gateway","redis","typescript","vercel-deployment"],"created_at":"2024-09-26T04:20:34.022Z","updated_at":"2026-01-18T17:33:30.363Z","avatar_url":"https://github.com/elyasprba.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eExample backend with mongodb\u003c/h1\u003e\n\nThis is an example authentication and authorization of a backend project with Express and Mongodb\n\n## ⛏️ Tech Stack\n\n**Server:** express, mongodb, redis, nodemailer, zod, jsonwebtoken, bcrypt\n\n## ✍️ Environment Variables\n\nTo run this project, you will need to add the following environment variables to your .env file\n\n```\nPORT = \"\"\n\nMONGO_URI = \"\"\n\nCLIENT_URL = \"\"\n\nJWT_ACCESS_SECRET = \"\"\nJWT_REFRESH_SECRET = \"\"\nJWT_ACCESS_SECRET_CONFIRM = \"\"\nJWT_ACCESS_EXPIRES_TIME = \"\"\nJWT_REFRESH_EXPIRES_TIME = \"\"\nJWT_ACCESS_EXPIRES_TIME_CONFIRM = \"\"\n\nREDIS_PASSWORD = \"\"\nREDIS_HOST = \"\"\nREDIS_PORT = \"\"\n\nOAUTH_TYPE = \"\"\nOAUTH_EMAIL = \"\"\nOAUTH_CLIENTID = \"\"\nOAUTH_CLIENT_SECRET = \"\"\nOAUTH_REFRESH_TOKEN = \"\"\n\nYOUR_MIDTRANS_CLIENT_KEY = \"\"\nYOUR_MIDTRANS_SERVER_KEY = \"\"\n\nCLOUD_NAME = \"\"\nCLOUD_API = \"\"\nCLOUD_SECRET = \"\"\n```\n\n## 📍 Run Locally\n\nClone the project\n\n```bash\n  git clone https://github.com/elyasprba/backend-with-mongodb.git\n```\n\nGo to the project directory\n\n```bash\n  cd backend-with-mongodb\n```\n\nInstall dependencies\n\n```bash\n  npm install\n```\n\nStart the server\n\n```bash\n  npm run start\n```\n\nStart Docker Compoes \n```bash\n  docker-compose up\n```\n\n## 🖇 API Reference\n\n#### Welcome Endpoint\n\n```http\n  GET /\n```\n\n| Parameter | Type  | Description                                    |\n| :-------- | :---- | :--------------------------------------------- |\n| `NONE`    | `N/A` | Returns a welcome message for the application. |\n\n#### Ping Endpoint\n\n```http\n  GET /ping\n```\n\n| Parameter | Type  | Description                                                |\n| :-------- | :---- | :--------------------------------------------------------- |\n| `NONE`    | `N/A` | Returns a 'pong' message to confirm the server is running. |\n\n#### Auth Routes\n\n#### Register\n\n```http\n  POST /api/auth/register\n```\n\n| Parameter  | Type     | Description                                      |\n| :--------- | :------- | :----------------------------------------------- |\n| body       | `object` | Required. JSON object with the following fields: |\n| `username` | `string` | Required. The username of the user.              |\n| `email`    | `sting`  | Required. The email address of the user.         |\n| `password` | `string` | Required. The password for the user account.     |\n\n- `Description`: Registers a new user. Validates the request data, checks for duplicate users, and then creates a new user account.\n\n#### Response :\n\n```\n    {\n        \"message\": \"Register Success, Please Check your email for verification\"\n    }\n```\n\n#### Confirm Email\n\n```http\n GET /api/auth/confirm/:token\n```\n\n| Parameter | Type     | Description                                                   |\n| :-------- | :------- | :------------------------------------------------------------ |\n| token     | `string` | Required. The token used to confirm the user's email address. |\n\n- `Description`: Confirms a user's email address using the provided token. Validates the token and activates the user account if the token is valid.\n\n#### Response :\n\n```\n    {\n        \"message\": \"Confirm Success\"\n    }\n```\n\n#### Login\n\n```http\n  POST /api/auth/login\n```\n\n| Parameter  | Type     | Description                                      |\n| :--------- | :------- | :----------------------------------------------- |\n| body       | `object` | Required. JSON object with the following fields: |\n| `email`    | `sting`  | Required. The email address of the user.         |\n| `password` | `string` | Required. The password for the user account.     |\n\n- `Description`: Logs in a user by validating credentials and generating an authentication token.\n\n#### Response :\n\n```\n    {\n        \"message\": \"Login success\",\n        \"data\": {\n            \"id\": \"123abc456\",\n            \"email\": \"email@gmail.com\",\n            \"username\": \"username\",\n            \"role\": \"user || admin\"\n            },\n        \"accessToken\": \"\",\n        \"refreshToken\": \"\"\n    }\n```\n\n#### Logout\n\n```http\n POST /api/auth/logout\n```\n\n| Parameter | Type     | Description                                     |\n| :-------- | :------- | :---------------------------------------------- |\n| body      | `object` | Required. JSON object with the following field: |\n| token     | `string` | Required. The token to be invalidated.          |\n\n- `Description`: Logs out a user by invalidating the provided authentication token.\n\n#### Response :\n\n```\n    {\n        \"message\": \"Logout success\"\n    }\n```\n\n## 📄 Documentation\n\n[Link Deploy to Vercel](https://backend-mongodb-app.vercel.app/)\n\n[Documentation Postman](https://documenter.getpostman.com/view/20120165/2sAXqngjwe)\n\n### Thank You !!!!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felyasprba%2Fbackend-with-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felyasprba%2Fbackend-with-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felyasprba%2Fbackend-with-mongodb/lists"}