{"id":29313810,"url":"https://github.com/mahir-deves/roommatch-server-","last_synced_at":"2026-04-13T17:31:56.956Z","repository":{"id":301108008,"uuid":"1008177668","full_name":"MAHIR-DEVES/RoomMatch-Server-","owner":"MAHIR-DEVES","description":"⚡ RESTful API built with Express.js and MongoDB Atlas 📌 Endpoints for post management, user content, and engagement features 🔗 Ready to connect with frontend applications for room-sharing platforms","archived":false,"fork":false,"pushed_at":"2025-06-26T18:00:31.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T10:24:57.010Z","etag":null,"topics":["cross","dotenv","express-js","mondodb","nodejs"],"latest_commit_sha":null,"homepage":"http://many-stick.surge.sh/","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/MAHIR-DEVES.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-25T06:36:44.000Z","updated_at":"2025-06-26T18:00:34.000Z","dependencies_parsed_at":"2025-06-25T07:40:01.659Z","dependency_job_id":null,"html_url":"https://github.com/MAHIR-DEVES/RoomMatch-Server-","commit_stats":null,"previous_names":["mahir-deves/roommatch-server-"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MAHIR-DEVES/RoomMatch-Server-","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHIR-DEVES%2FRoomMatch-Server-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHIR-DEVES%2FRoomMatch-Server-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHIR-DEVES%2FRoomMatch-Server-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHIR-DEVES%2FRoomMatch-Server-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAHIR-DEVES","download_url":"https://codeload.github.com/MAHIR-DEVES/RoomMatch-Server-/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAHIR-DEVES%2FRoomMatch-Server-/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270579683,"owners_count":24610051,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"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":["cross","dotenv","express-js","mondodb","nodejs"],"created_at":"2025-07-07T10:21:25.885Z","updated_at":"2026-04-13T17:31:56.909Z","avatar_url":"https://github.com/MAHIR-DEVES.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RoomMatch API Server Documentation\n\n# Live Link\n\n🏠 live link : [many-stick.surge.sh](http://many-stick.surge.sh/)\n\n## 📌 Table of Contents\n\n- [Technologies Used](#-technologies-used)\n- [API Endpoints](#-api-endpoints)\n- [Setup Instructions](#-setup-instructions)\n- [Database Structure](#-database-structure)\n- [Environment Variables](#-environment-variables)\n- [How It Works](#-how-it-works)\n\n## 🛠 Technologies Used\n\n### Core Stack\n\n- **Node.js** - JavaScript runtime\n- **Express.js** - Web framework\n- **MongoDB** - NoSQL database (Atlas)\n\n### Key Dependencies\n\n- `cors` - Cross-Origin Resource Sharing\n- `dotenv` - Environment variables\n- `mongodb` - Official MongoDB driver\n\n## 🌐 API Endpoints\n\n### Posts Management\n\n| Method | Endpoint           | Description               |\n| ------ | ------------------ | ------------------------- |\n| POST   | `/posts`           | Create new post           |\n| GET    | `/posts`           | Get 6 available posts     |\n| GET    | `/AllPosts`        | Get all posts             |\n| GET    | `/posts/:id`       | Get single post by ID     |\n| GET    | `/my-posts/:email` | Get posts by user email   |\n| PUT    | `/posts/:id`       | Update post               |\n| PATCH  | `/posts/like/:id`  | Increment post like count |\n| DELETE | `/posts/:id`       | Delete post               |\n\n## 🚀 Setup Instructions\n\n### Prerequisites\n\n- Node.js (v14+)\n- MongoDB Atlas account\n- Git (optional)\n\n### Step-by-Step Setup\n\n1. **Clone repository** (if available)\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd project-folder\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Create `.env` file**\n\n   ```\n   PORT=3000\n   DB_USER=your_mongodb_username\n   DB_PASS=your_mongodb_password\n   ```\n\n4. **Run the server**\n\n   ```bash\n   npm start\n   ```\n\n   or for development with auto-restart:\n\n   ```bash\n   npm run dev\n   ```\n\n5. **Verify server is running** Visit in your browser or use Postman:\n   ```\n   http://localhost:3000\n   ```\n\n## 🗃 Database Structure\n\n### Collections\n\n1. **posts**\n   ```javascript\n   {\n     _id: ObjectId,\n     title: String,\n     description: String,\n     image: String,\n     availability: String, // 'available' or other status\n     likeCount: Number,\n     email: String, // owner's email\n     createdAt: Date,\n     // ... other post fields\n   }\n   ```\n\n## 🔐 Environment Variables\n\n| Variable  | Required | Description                 |\n| --------- | -------- | --------------------------- |\n| `PORT`    | No       | Server port (default: 3000) |\n| `DB_USER` | Yes      | MongoDB Atlas username      |\n| `DB_PASS` | Yes      | MongoDB Atlas password      |\n\n## 🔄 How It Works\n\n### Flow Overview\n\n1. **Client makes request** to API endpoint\n2. **Server processes request**:\n   - Validates input\n   - Interacts with MongoDB\n   - Returns JSON response\n3. **Database operations**:\n   - CRUD operations via MongoDB driver\n   - Special operations like `$inc` for likes\n\n### Key Features\n\n- **Post Management**: Full CRUD functionality\n- **Like System**: Atomic increment counter\n- **Filtering**: By availability and user email\n- **Pagination**: Default limit of 6 posts for `/posts` endpoint\n\n## 💻 Development Commands\n\n| Command       | Description                             |\n| ------------- | --------------------------------------- |\n| `npm start`   | Start production server                 |\n| `npm run dev` | Start development server (with nodemon) |\n| `npm test`    | Run tests (if configured)               |\n\n## 🚨 Troubleshooting\n\nCommon issues and solutions:\n\n1. **Connection failed to MongoDB**\n\n   - Verify Atlas IP whitelisting\n   - Check credentials in `.env`\n\n2. **CORS errors**\n\n   - Ensure client origin is allowed\n   - Check server CORS configuration\n\n3. **Environment variables not loading**\n   - Confirm `.env` file is in root directory\n   - Restart server after changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahir-deves%2Froommatch-server-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahir-deves%2Froommatch-server-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahir-deves%2Froommatch-server-/lists"}