{"id":27979317,"url":"https://github.com/shubhamch95/activity-booking-backend","last_synced_at":"2026-05-05T14:33:20.411Z","repository":{"id":291943853,"uuid":"979291154","full_name":"shubhamch95/activity-booking-backend","owner":"shubhamch95","description":"This is a backend API for an activity booking application built with Node.js, Express, and MongoDB. It allows users to register, log in, view available activities, book activities, and view their bookings. The API uses JWT for authentication and bcrypt for password hashing.","archived":false,"fork":false,"pushed_at":"2025-05-07T11:08:42.000Z","size":4836,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T02:52:09.593Z","etag":null,"topics":["bcryptjs","express-validator","expressjs","javascript","mongodb","nodejs"],"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/shubhamch95.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-05-07T09:35:37.000Z","updated_at":"2025-05-07T11:08:46.000Z","dependencies_parsed_at":"2025-05-08T02:52:10.242Z","dependency_job_id":"f4f55e3d-e317-46f8-b757-7a902d53aceb","html_url":"https://github.com/shubhamch95/activity-booking-backend","commit_stats":null,"previous_names":["shubhamch95/activity-booking-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shubhamch95/activity-booking-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamch95%2Factivity-booking-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamch95%2Factivity-booking-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamch95%2Factivity-booking-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamch95%2Factivity-booking-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shubhamch95","download_url":"https://codeload.github.com/shubhamch95/activity-booking-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shubhamch95%2Factivity-booking-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32653559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bcryptjs","express-validator","expressjs","javascript","mongodb","nodejs"],"created_at":"2025-05-08T02:52:05.947Z","updated_at":"2026-05-05T14:33:20.393Z","avatar_url":"https://github.com/shubhamch95.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏃‍♂️ Activity Booking API\n\nA simple backend API for user registration, login, listing activities, and booking them — built with **Node.js**, **Express**, and **MongoDB**.\n\n---\n\n## 📦 Tech Stack\n\n- **Node.js**\n- **Express.js**\n- **MongoDB** with Mongoose\n- **JWT Authentication**\n- **bcrypt** for password hashing\n- **express-validator** for input validation\n\n---\n\n## ⚙️ Setup Instructions\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/your-username/activity-booking-api.git\ncd activity-booking-api\n```\n\n### 2. Install Dependencies\n\n```bash\nnpm install\n```\n\n### 3. Configure Environment Variables\n\nCreate a `.env` file in the root directory with the following content:\n\n```env\nPORT=5000\nMONGO_URI=your_mongodb_connection_string\nJWT_SECRET=your_super_secret_key\n```\n\n### 4. Start the Server\n\n```bash\nnpm run dev\n```\n\nServer will be running at:  \n📍 `http://localhost:5000`\n\n---\n\n## 🧪 API Endpoints\n\n### ✅ Auth\n\n#### `POST /api/auth/register`  \nRegister a user  \n**Body:**\n```json\n{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"phone\": \"1234567890\",\n  \"password\": \"your_password\"\n}\n```\n\n#### `POST /api/auth/login`  \nLogin and get a token  \n**Body:**\n```json\n{\n  \"email\": \"john@example.com\",\n  \"password\": \"your_password\"\n}\n```\n\n---\n\n### 📅 Activities\n\n#### `GET /api/activity/getActivities`  \nGet a list of all public activities\n\n#### `POST /api/activity/createActivity`  \nCreate a new activity (authorized users only)  \n**Headers:**  \n`Authorization: Bearer \u003ctoken\u003e`  \n**Body:**\n```json\n{\n  \"title\": \"Yoga Session\",\n  \"description\": \"A relaxing yoga class\",\n  \"location\": \"Community Center\",\n  \"date\": \"2025-06-01\",\n  \"time\": \"10:00 AM\"\n}\n```\n\n---\n\n### 📖 Bookings\n\n#### `POST /api/booking/book/:activityId`  \nBook an activity  \n**Headers:**  \n`Authorization: Bearer \u003ctoken\u003e`\n\n#### `GET /api/booking/myBookings`  \nList the user's booked activities  \n**Headers:**  \n`Authorization: Bearer \u003ctoken\u003e`\n\n---\n\n## ✅ Bonus Features\n\n- 🔐 Passwords securely hashed with **bcrypt**\n- 🛡 JWT token-based authentication\n- 📥 Input validation via **express-validator**\n- 🧹 Clean, modular code structure\n\n---\n\n## 📁 Folder Structure\n\n```\n📦 project-root\n├── controllers/\n├── models/\n├── routes/\n├── middleware/\n├── validators/\n├── config/\n├── server.js\n├── .env\n└── README.md\n```\n## Contributing\n🚀 Contributions are welcome! Follow these steps:\n1. **Fork the repository.**\n2. **Create a new feature branch.**\n3. **Commit your changes.**\n4. **Push to your branch and submit a Pull Request (PR).**\n\n## License\n📜 **MIT License** - Free to use and modify!\n\n---\nMade with ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamch95%2Factivity-booking-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhamch95%2Factivity-booking-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhamch95%2Factivity-booking-backend/lists"}