{"id":18770618,"url":"https://github.com/nishant-sethi/confusion-nodejs","last_synced_at":"2026-04-12T00:39:12.312Z","repository":{"id":51899306,"uuid":"228464264","full_name":"nishant-sethi/conFusion-Nodejs","owner":"nishant-sethi","description":"This is the backend server for a restaurant named Con Fusion, a practice project to learn javascript backend development.","archived":false,"fork":false,"pushed_at":"2022-12-22T13:30:11.000Z","size":149,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-29T07:42:10.493Z","etag":null,"topics":["backend-server","coursera-assignment","expressjs","fullstack-javascript","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/nishant-sethi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-16T19:54:26.000Z","updated_at":"2024-11-06T01:35:54.000Z","dependencies_parsed_at":"2023-01-30T10:00:31.673Z","dependency_job_id":null,"html_url":"https://github.com/nishant-sethi/conFusion-Nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishant-sethi%2FconFusion-Nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishant-sethi%2FconFusion-Nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishant-sethi%2FconFusion-Nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nishant-sethi%2FconFusion-Nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nishant-sethi","download_url":"https://codeload.github.com/nishant-sethi/conFusion-Nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239677430,"owners_count":19679050,"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":["backend-server","coursera-assignment","expressjs","fullstack-javascript","mongodb","nodejs"],"created_at":"2024-11-07T19:20:19.058Z","updated_at":"2025-12-11T23:30:16.672Z","avatar_url":"https://github.com/nishant-sethi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Con Fusion Server\n\nThis is the backend server for a restaurant named _Con Fusion_,\na practice project to learn javascript backend development.\n\nIt is written using\n[Node.js](https://nodejs.org) as runtime,\n[Express.js](https://expressjs.com) as application framework.\nThe project structure is generated by\n[Express Generator](https://expressjs.com/en/starter/generator.html)\nIt uses [MongoDB](https://mongodb.com) as the persistent data store,\nand [Mongoose](https://mongoosejs.com) ODM (object-document mapper).\n\n## Requirements\n\n- [Node.js](https://nodejs.org) (and [npm](https://npmjs.com))\n- [MongoDB](https://mongodb.com)\n\n## How to see it in action\n\nFirst of all, start a MongoDB server at port 54321. For example:\n\n    mongod --dbpath=/tmp/data --port=54321\n\nThen just clone and run:\n\n1. Clone the repo, and `cd` into it\n\n        git clone https://github.com/nishant-sethi/coursera-nodejs-confusion\n        cd coursera-nodejs-confusion\n\n2. Initall npm dependencies\n\n        npm install\n\n3. Start the server\n\n        npm start\n\n4. Send requests to [http://localhost:3000](http://localhost:3000)\n\n### Authentication\n\nRight now, it uses simple JWT-based authenticationUse the following API for authentication:\n\nOperation | Method | URL | Body\n--- | --- | --- | ---\nSignup | POST | /users/signup | `{ \"username\": \"abc\", \"password\": \"xyz\" }`\nLogin | POST | /users/login | `{ \"username\": \"abc\", \"password\": \"xyz\" }`\nLogout (_not used_) | GET | /users/logout |\n\nWhen you login, you'll receive a _`token`_ in the response body.\nPut that token in the request header as `Authentication: Bearer \u003ctoken\u003e` to\naccess restricted endpoints. The default expiration time of the tokens in 1 hour.\nYou'll have to relogin and obtain new token when the current token expires.\n\n## API Endpoints\n\nEndpoint | Supported methods\n--- | ---\n`/dishes` | GET, POST, DELETE\n`/dishes/\u003cdishId\u003e` | GET, PUT, DELETE\n`/dishes/\u003cdishId\u003e/comments` | GET, POST, DELETE\n`/dishes/\u003cdishId\u003e/comments/\u003ccommentId\u003e` | GET, PUT, DELETE\n`/promotions` | GET, POST, DELETE\n`/promotions/\u003cpromoId\u003e` | GET, PUT, DELETE\n`/leader` | GET, POST, DELETE\n`/leader/\u003cleaderId\u003e` | GET, PUT, DELETE\n`/users` | GET\n\n### Method documentation\n\nMethod | Description | Access Control\n--- | --- | ---\nGET | Retrieve record(s) | Usually public\nPOST | Insert new record in the collection | Requires authentication\nPUT | Modify a record | Requires authentication\nDELETE | Delete record(s) | Requires authentication\n\n## Reference\n\n- [Server-side Development with NodeJS, Express and MongoDB, Coursera](https://www.coursera.org/learn/server-side-nodejs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishant-sethi%2Fconfusion-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishant-sethi%2Fconfusion-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishant-sethi%2Fconfusion-nodejs/lists"}