{"id":15068239,"url":"https://github.com/abdallahrdf/blogging-platform-api","last_synced_at":"2026-01-02T08:35:43.774Z","repository":{"id":253690445,"uuid":"844103971","full_name":"AbdallahRdf/blogging-platform-api","owner":"AbdallahRdf","description":"Blogging platform API","archived":false,"fork":false,"pushed_at":"2025-02-23T21:56:02.000Z","size":219,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T22:29:16.111Z","etag":null,"topics":["backend","blog","express-js","mongodb-atlas","nodejs","rest"],"latest_commit_sha":null,"homepage":"https://blogging-platform-api-uhuy.onrender.com/","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/AbdallahRdf.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-08-18T11:54:14.000Z","updated_at":"2025-02-23T21:56:05.000Z","dependencies_parsed_at":"2024-11-18T19:32:53.830Z","dependency_job_id":"ddf6e51a-387e-446e-8316-4e1779fed972","html_url":"https://github.com/AbdallahRdf/blogging-platform-api","commit_stats":null,"previous_names":["abdallahrdf/blogging-platform-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdallahRdf%2Fblogging-platform-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdallahRdf%2Fblogging-platform-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdallahRdf%2Fblogging-platform-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdallahRdf%2Fblogging-platform-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbdallahRdf","download_url":"https://codeload.github.com/AbdallahRdf/blogging-platform-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243833460,"owners_count":20355278,"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","blog","express-js","mongodb-atlas","nodejs","rest"],"created_at":"2024-09-25T01:32:44.892Z","updated_at":"2026-01-02T08:35:43.769Z","avatar_url":"https://github.com/AbdallahRdf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blogging Platform API\n\nThis is the backend API for a personal blog built using **Node.js**, **Express.js**, and **TypeScript**, with **MongoDB Atlas** as the database. The API includes JWT-based authentication and role-based authorization, supporting three roles: **Admin**, **Moderator**, and **User**.\n\n**Hosted on Render:** [Blogging Platform API](https://blogging-platform-api-uhuy.onrender.com)\n\n---\n\n## 🛠️ Technologies Used\n\n- **Backend:**\n  - Node.js + Express.js\n  - TypeScript\n  - MongoDB Atlas (NoSQL, cloud-hosted)\n- **Authentication \u0026 Authorization:**\n  - JSON Web Tokens (JWT)\n- **Email Services:**\n  - Nodemailer (password reset emails)\n- **Deployment:**\n  - Render\n\n---\n\n## ✨ Features\n\n### 🔓 Unauthenticated Users\n\n- Can view posts and comments\n- Cannot like, dislike, or comment\n\n### 🔐 Authenticated Users\n\n- Can like/dislike posts, comments, and replies\n- Can comment on posts and reply to comments\n- Can manage their own account (update/delete)\n- Can view their profile and other users' profiles\n\n### 🔑 Authentication\n\n- JWT-based secure login and route protection\n- Password reset via email\n\n---\n\n## 📚 API Documentation\n\nThe API is documented using OpenAPI/Swagger.\n\n- Local Swagger UI: Once the server is running, visit http://localhost:5000/api-docs to explore the API interactively.\n\n- The raw OpenAPI spec is available at: [swagger.yaml](src/doc/swagger.yaml)\n\n---\n\n## 🚀 Running the Project Locally\n\n\u003e ⚠️ **MongoDB must be cloud-hosted (e.g., Atlas)**. Local MongoDB will not work because this project uses **sessions and transactions**, which are not supported by standalone instances.\n\n### ✅ Prerequisites\n\n- Node.js (v14+)\n- MongoDB Atlas account\n\n### 📦 Installation Steps\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/AbdallahRdf/blogging-platform-api.git\n   cd blogging-platform-api\n   ```\n\n2. Install dependencies:\n\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file with the following variables:\n\n   ```env\n   PORT=5000\n   JWT_SECRET_KEY=your_jwt_secret\n   MONGODB_CONNECTION_STRING=your_mongodb_atlas_uri\n   FRONTEND_URL=http://localhost:3000\n   EMAIL_USER=your_email@example.com\n   EMAIL_APP_PASSWORD=your_email_app_password\n   NODE_ENV=development\n   GLOBAL_RATE_LIMITER_MAX=number_of_requests_allowed_per_minute_globally\n   AUTH_RATE_LIMITER_MAX=number_of_auth_requests_allowed_per_minute\n   SEND_EMAIL_RATE_LIMITER_MAX=number_of_emails_allowed_to_be_sent_per_minute\n   ```\n\n4. Create an initial admin user:\n\n   ```bash\n   npm run create-admin\n   ```\n\n5. Start the development server:\n\n   ```bash\n   npm run dev\n   ```\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Feel free to fork the repo and submit a pull request.\n\n---\n\n## 📝 License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdallahrdf%2Fblogging-platform-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdallahrdf%2Fblogging-platform-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdallahrdf%2Fblogging-platform-api/lists"}