{"id":16231812,"url":"https://github.com/smakosh/rest-api-boilerplate-v2","last_synced_at":"2025-03-19T14:30:49.143Z","repository":{"id":51822329,"uuid":"141059797","full_name":"smakosh/rest-api-boilerplate-v2","owner":"smakosh","description":"Boilerplate of a RESTful API","archived":false,"fork":false,"pushed_at":"2021-05-09T19:13:07.000Z","size":291,"stargazers_count":31,"open_issues_count":5,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T19:16:46.065Z","etag":null,"topics":["express","mongoose","nodejs","rest-api"],"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/smakosh.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}},"created_at":"2018-07-15T21:31:04.000Z","updated_at":"2024-01-16T14:09:30.000Z","dependencies_parsed_at":"2022-08-23T09:01:32.797Z","dependency_job_id":null,"html_url":"https://github.com/smakosh/rest-api-boilerplate-v2","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/smakosh%2Frest-api-boilerplate-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakosh%2Frest-api-boilerplate-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakosh%2Frest-api-boilerplate-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smakosh%2Frest-api-boilerplate-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smakosh","download_url":"https://codeload.github.com/smakosh/rest-api-boilerplate-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997087,"owners_count":20380980,"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","mongoose","nodejs","rest-api"],"created_at":"2024-10-10T13:06:52.322Z","updated_at":"2025-03-19T14:30:48.890Z","avatar_url":"https://github.com/smakosh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Setup\n\n    npm i\n\nBefore running anything locally, create a `.env` file and initialize your env variable like so:\n\n    DB=mongodb://localhost:27017/boilerplate\n    SECRET_KEY=NSA\n    REACT_APP_URL=http://localhost:3000 // when cors is enabled, this will be the only origin to send requests\n\nPS: if you're deploying to a VPS/VPC u should have another `.env.production` file and add some logic to handle that on the `./config/config.js` file.\n\nStart the db locally\n\n    npm run database\n\nPS: replace `mongo-data` with the name of the folder your data is stored.\n\nstart dev server\n\n    npm run dev\n\nstart prod server\n\n    npm start\n\n## Models\n\nUser\n\n- firstName\n- lastName\n- username\n- email\n- password\n- tokens\n\nProfile\n\n- user\n- type\n- handle\n- date\n\nPost\n\n- title\n- description\n- date\n- _creator\n\n## Routes\n\n- User\n\n        POST /api/user/register\n        // Register a new user and returns user data with the generated token\n        // Public\n\n        POST /api/user/login\n        // Login user and returns user data with the generated token\n        // Public\n\n        GET /api/user/verify\n        // Verifies token and returns current user data\n        // Private\n\n        DELETE /api/user/logout\n        // Logout\n        // Private\n\n- Profile\n\n        GET /api/profile\n        // GET current user profile\n        // Private\n\n        POST /api/profile\n        // create or Edit user profile\n        // Private\n\n        DELETE /api/profile\n        // Delete user and profile\n        // Private\n\n        GET /api/profile/all // Not available yet\n        // Get all profiles\n\n        GET /api/profile/handle/:handle // Not available yet\n        // Get profile by handle\n\n- Post\n\n        POST /api/post\n        // Create a new post\n        // Private\n\n        GET /api/post/all\n        // Get all the posts\n\n        GET /api/post/:id\n        // Get Post by ID\n        // Private\n\n        DELETE /api/post/:id\n        // Delete Post by ID\n        // Private\n\n        PATCH /api/post/:id\n        // Update a post\n        // Private\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakosh%2Frest-api-boilerplate-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmakosh%2Frest-api-boilerplate-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmakosh%2Frest-api-boilerplate-v2/lists"}