{"id":22599093,"url":"https://github.com/shravzzv/odin-blog-api-project-api","last_synced_at":"2026-05-06T19:32:57.214Z","repository":{"id":242178798,"uuid":"808895507","full_name":"shravzzv/ODIN-Blog-api-project-Api","owner":"shravzzv","description":"This repo contains the code for a REST API for the simple blog. It manages posts, comments and users.","archived":false,"fork":false,"pushed_at":"2024-07-11T07:56:58.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T22:58:32.491Z","etag":null,"topics":["cloudindary","express","jsonwebtoken","mongoose","multer","passport-jwt","rest-api","the-odin-project"],"latest_commit_sha":null,"homepage":"https://odin-blog-api-project-api.glitch.me/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shravzzv.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-01T05:10:04.000Z","updated_at":"2024-09-20T09:37:04.000Z","dependencies_parsed_at":"2024-06-01T06:28:44.557Z","dependency_job_id":"8bdb8254-1826-4b2f-86c6-9ff75e09251c","html_url":"https://github.com/shravzzv/ODIN-Blog-api-project-Api","commit_stats":null,"previous_names":["shravzzv/odin-blog-api-project-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravzzv%2FODIN-Blog-api-project-Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravzzv%2FODIN-Blog-api-project-Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravzzv%2FODIN-Blog-api-project-Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shravzzv%2FODIN-Blog-api-project-Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shravzzv","download_url":"https://codeload.github.com/shravzzv/ODIN-Blog-api-project-Api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246092105,"owners_count":20722344,"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":["cloudindary","express","jsonwebtoken","mongoose","multer","passport-jwt","rest-api","the-odin-project"],"created_at":"2024-12-08T11:08:10.389Z","updated_at":"2026-05-06T19:32:57.186Z","avatar_url":"https://github.com/shravzzv.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ODIN Blog api project's API\n\n## Description\n\nThis repository provides the backend API for a blog application, built using Express.js and MongoDB. It follows the assignment guidelines from The Odin Project. Check out the assignment [here](https://www.theodinproject.com/lessons/nodejs-blog-api).\n\n## Features\n\n- RESTful API for managing users, posts and comments for a simple blog.\n- User authentication with JWT (JSON Web Tokens) and Passport.js.\n\n## Technologies Used\n\n[![My Skills](https://skillicons.dev/icons?i=express,mongodb)](https://skillicons.dev)\n\n## Installation\n\nTo install the project, follow these steps:\n\n```bash\ngit clone https://github.com/shravzzv/ODIN-Blog-api-project-Api\ncd ODIN-Blog-api-project-Api\nnpm install\nnpm run dev\n```\n\n## Usage\n\nThe API provides various endpoints for CRUD (Create, Read, Update, Delete) operations on blog posts and comments. Authentication is required for most actions except viewing published posts.\n\n### Endpoints\n\n- `/posts`(protected):\n  - `GET`: Retrieve all posts.\n  - `GET/:ID`: Retrieve a specific post.\n  - `POST`: Create a new post.\n  - `PUT/:ID`: Update an existing post.\n  - `DELETE:/ID`: Delete a post.\n- `/comments`(protected):\n  - `GET`: Retrieve all comments for a specific post.\n  - `POST`: Create a new comment on a post.\n  - `DELETE/:ID`: Delete a comment.\n  - `UPDATE/:ID`: Update a comment.\n- `/user`:\n  - `POST SIGNUP`: Create a new user.\n  - `POST SIGNIN` : Signin a user.\n  - `GET USER/:ID` : Get a specific user alongwith the user's posts.\n\n### Authentication\n\n1. Login to obtain a JWT token (details on login API endpoint to be added).\n2. Include the JWT token in the Authorization header with the Bearer schema for protected requests.\n\n### Example Usage with Postman:\n\n1. Set up a POST request to the signin endpoint.\n2. Send login credentials in the request body.\n3. Upon successful login, store the JWT token received in the response.\n4. Create a new GET request to /posts (or other protected endpoints).\n5. Add the Authorization: Bearer `\u003cyour_jwt_token\u003e` header to the request.\n\n### Additional Notes\n\nRefer to the API documentation within the code for detailed endpoint information and request/response formats.\n\n## How to Contribute\n\nIf you'd like to contribute, follow these steps:\n\n1. Fork the repository on GitHub.\n2. Clone your fork locally.\n\n   ```bash\n   git clone https://github.com/shravzzv/ODIN-Blog-api-project-Api\n   cd ODIN-Blog-api-project-Api\n   ```\n\n3. Create a new branch for your feature or bug fix.\n\n   ```bash\n   git checkout -b feature-or-bug-fix-name\n   ```\n\n4. Make your changes, commit them, and push them to your fork.\n\n   ```bash\n   git add .\n   git commit -m \"Your commit message here\"\n   git push origin feature-or-bug-fix-name\n   ```\n\n5. Open a Pull Request on GitHub, comparing your branch to the original repository's `main` branch.\n\n## Issue Tracker\n\nFind a bug or want to request a new feature? Please let us know by submitting an issue at the [issue Tracker](https://github.com/shravzzv/ODIN-Blog-api-project-Api/issues).\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshravzzv%2Fodin-blog-api-project-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshravzzv%2Fodin-blog-api-project-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshravzzv%2Fodin-blog-api-project-api/lists"}