{"id":28501717,"url":"https://github.com/nish340/blog-backend","last_synced_at":"2026-04-17T07:32:13.247Z","repository":{"id":297559314,"uuid":"997163168","full_name":"nish340/blog-backend","owner":"nish340","description":"A full-featured backend for a Medium-style blog platform built with Node.js, Express, and MongoDB. Includes user authentication, post creation, comments, likes, and more. Ideal for learning or building a blog app.","archived":false,"fork":false,"pushed_at":"2025-06-06T04:41:31.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-05T03:08:52.278Z","etag":null,"topics":["blog-backend","blog-writing-project","express","mongodb","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"https://nishchay.online/projects","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/nish340.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,"zenodo":null}},"created_at":"2025-06-06T04:12:53.000Z","updated_at":"2025-06-06T04:41:33.000Z","dependencies_parsed_at":"2025-06-06T05:26:25.348Z","dependency_job_id":"25e6e7ca-ddcd-4a09-8011-35dce6a54c7f","html_url":"https://github.com/nish340/blog-backend","commit_stats":null,"previous_names":["nish340/blog-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nish340/blog-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nish340%2Fblog-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nish340%2Fblog-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nish340%2Fblog-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nish340%2Fblog-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nish340","download_url":"https://codeload.github.com/nish340/blog-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nish340%2Fblog-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31919951,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"online","status_checked_at":"2026-04-17T02:00:06.879Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["blog-backend","blog-writing-project","express","mongodb","nodejs","rest-api"],"created_at":"2025-06-08T16:07:36.869Z","updated_at":"2026-04-17T07:32:13.222Z","avatar_url":"https://github.com/nish340.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blog Writing Website Backend\n\nA robust backend API for a blog writing platform similar to Medium. This RESTful API provides all the necessary endpoints to create, manage, and interact with blog content.\n\n## Features\n\n- **User Authentication**: Secure signup and login with JWT\n- **Blog Management**: Create, read, update, and delete blog posts\n- **Comments \u0026 Replies**: Nested comment system for blog posts\n- **User Profiles**: User management with different roles (user, admin)\n- **Content Categorization**: Tag and categorize blog posts\n- **Media Storage**: AWS S3 integration for image uploads\n- **SEO Optimization**: Metadata management for blog posts\n- **Analytics**: Track view counts and reading time\n\n## Tech Stack\n\n- **Node.js** - JavaScript runtime\n- **Express** - Web framework\n- **MongoDB** - NoSQL database\n- **Mongoose** - MongoDB object modeling\n- **JWT** - Authentication\n- **AWS SDK** - S3 integration for media storage\n- **bcrypt** - Password hashing\n\n## API Endpoints\n\n### User Routes\n- `POST /api/users/register` - Register a new user\n- `POST /api/users/login` - User login\n- `GET /api/users/profile` - Get user profile\n\n### Blog Routes\n- `GET /api/blogs` - Get all blogs\n- `GET /api/blogs/:id` - Get a specific blog\n- `POST /api/blogs` - Create a new blog (auth required)\n- `PUT /api/blogs/:id` - Update a blog (auth required)\n- `DELETE /api/blogs/:id` - Delete a blog (auth required)\n- `POST /api/blogs/:id/like` - Like/unlike a blog (auth required)\n\n### Comment Routes\n- `GET /api/blogs/:blogId/comments` - Get all comments for a blog\n- `POST /api/blogs/:blogId/comments` - Add a comment (auth required)\n- `PUT /api/comments/:id` - Update a comment (auth required)\n- `DELETE /api/comments/:id` - Delete a comment (auth required)\n\n### Reply Routes\n- `POST /api/comments/:commentId/replies` - Add a reply to a comment (auth required)\n- `PUT /api/replies/:id` - Update a reply (auth required)\n- `DELETE /api/replies/:id` - Delete a reply (auth required)\n\n## Getting Started\n\n### Prerequisites\n- Node.js (v14 or higher)\n- MongoDB\n- AWS account (for S3 storage)\n\n### Installation\n\n1. Clone the repository\n   ```\n   git clone https://github.com/nish340/blog-backend.git\n   cd blogs-backend\n   ```\n\n2. Install dependencies\n   ```\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory with the following variables:\n   ```\n   PORT=5000\n   MONGODB_URI=your_mongodb_connection_string\n   JWT_SECRET=your_jwt_secret\n   AWS_ACCESS_KEY_ID=your_aws_access_key\n   AWS_SECRET_ACCESS_KEY=your_aws_secret_key\n   AWS_REGION=your_aws_region\n   S3_BUCKET_NAME=your_s3_bucket_name\n   ```\n\n4. Start the server\n   ```\n   npm start\n   ```\n\n   For development with auto-reload:\n   ```\n   npm run dev\n   ```\n\n## Project Structure\n\n```\nblogs-backend/\n├── controllers/       # Request handlers\n├── middleware/        # Custom middleware functions\n├── models/            # Database models\n├── routes/            # API routes\n├── services/          # External service integrations\n├── .env               # Environment variables\n├── server.js          # Entry point\n└── package.json       # Project dependencies\n```\n\n## Data Models\n\n### User\n- name\n- email\n- password (hashed)\n- role (user, admin)\n- profile information\n\n### Blog\n- title\n- slug\n- content\n- excerpt\n- coverImage\n- author (reference to User)\n- category\n- tags\n- status (draft, published, archived)\n- seoMetadata\n- readingTime\n- viewCount\n- likes\n\n### Comment\n- content\n- author (reference to User)\n- blog (reference to Blog)\n\n### Reply\n- content\n- author (reference to User)\n- comment (reference to Comment)\n\n## License\n\nThis project is licensed under the ISC License - see the LICENSE file for details.\n\n## Author\n\nNishchay Sharma\n\n---\n\n© 2024 Nishchay Sharma. All Rights Reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnish340%2Fblog-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnish340%2Fblog-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnish340%2Fblog-backend/lists"}