{"id":28226585,"url":"https://github.com/chronosgit/events-api","last_synced_at":"2025-06-25T08:34:07.777Z","repository":{"id":238880236,"uuid":"797832355","full_name":"chronosgit/events-api","owner":"chronosgit","description":"Small REST API application for KBTU IOS Swift final exam","archived":false,"fork":false,"pushed_at":"2024-05-09T14:29:01.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T12:09:05.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/chronosgit.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-05-08T15:51:11.000Z","updated_at":"2024-05-09T14:29:05.000Z","dependencies_parsed_at":"2024-05-08T17:26:23.660Z","dependency_job_id":"4903af92-78ec-46d7-8765-8255fead20cc","html_url":"https://github.com/chronosgit/events-api","commit_stats":null,"previous_names":["chronosgit/events-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chronosgit/events-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronosgit%2Fevents-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronosgit%2Fevents-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronosgit%2Fevents-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronosgit%2Fevents-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chronosgit","download_url":"https://codeload.github.com/chronosgit/events-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chronosgit%2Fevents-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259610095,"owners_count":22884191,"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":[],"created_at":"2025-05-18T12:09:06.834Z","updated_at":"2025-06-13T08:32:34.376Z","avatar_url":"https://github.com/chronosgit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to run this application locally?\n\n1. Download [MongoDB.](https://www.mongodb.com/try/download/community)\n\n2. Download **Node.js**.\n\n3. Clone or pull repository.\n\n4. Download **mongosh** *(optional)*.\n\n5. Run `npm install` in root directory of the project.\n\n6. Run `Node app.js`.\n\n7. You can also use **Nodemon** instead of Node for life-reloads on changes. You need to install it globally using **npm**.\n\n8. Setup **.env** file. There is `.env example` file for guiding this process.\n\n# Routes\n\n### Base url\n\n```\nhttp://localhost:3001\n```\n\n### GET /api/v1/healthcheck/public/\n\n**Public healthcheck to test application**\n\n**Response 200 (JSON)**\n```js\n{\n\t\"message\": \"Events API is working correctly\"\n}\n```\n\n### POST /api/v1/auth/register/\n\n**Register**\n\n**Request body**\n```js\n{\n\t\"username\": USERNAME,\n\t\"password\": PASSWORD\n}\n```\n\n**Response 201 example (JSON)**\n```js\n{\n\t\"id\": \"663c5e2fa3708a9482fd87d5\",\n\t\"username\": \"User\",\n\t\"secret\": \"dXlLCZFIVf\"\n}\n```\n\n### POST /api/v1/auth/login/\n\n**Login**\n\n**Request body**\n```js\n{\n\t\"username\": USERNAME, // string\n\t\"password\": PASSWORD // string\n}\n```\n\n**Response 200 example (JSON)**\n```js\n{\n\t\"id\": \"663c5e2fa3708a9482fd87d5\",\n\t\"username\": \"User\",\n\t\"secret\": \"dXlLCZFIVf\"\n}\n```\n\n### GET /api/v1/healthcheck/private/\n\n**Private healthcheck to check credentials manager**\n\n**Request body**\n```js\n{\n\t\"username\": USERNAME, // string\n\t\"secret\": SECRET // string\n}\n```\n\n**Response 200 (JSON)**\n```js\n{\n\t\"message\": \"Events API credentials middleware is working correctly\"\n}\n```\n\n### POST /internal/event/\n\n**Creating event, for internal purpose only**\n\n**Request body**\n```js\n{\n\t\"name\": NAME, // string\n\t\"type\": TYPE, // string, must be 'concert', 'sport' or 'exhibition'\n\t\"location\": LOCATION, // string\n\t\"date\":  DATE, // string\n\t\"price\": PRICE // number\n}\n```\n\n**Response 201 (JSON)**\n```js\n{\n\t\"name\": \"Weissnat, Greenfelder and Pacocha\",\n\t\"type\": \"sport\",\n\t\"price\": 1337,\n\t\"location\": \"419 Walsh Brooks\",\n\t\"date\": \"2024-11-02T20:50:08.000Z\",\n\t\"image\": BASE64 // large base64 string\n}\n```\n\n### GET /api/v1/events/all/\n\n**Getting all events**\n\n**Response 200 example (JSON)**\n```js\n{\n\t\"events\": [\n\t\t{\n\t\t\t\"defaultImage\": {\n\t\t\t\t\"data\": {\n\t\t\t\t\t\"type\":\"Buffer\",\"data\": [BYTE ARRAY]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"_id\": \"663c5d5ca3708a9482fd87d2\",\n\t\t\t\"hasImage\": false,\n\t\t\t\"name\": \"Weissnat, Greenfelder and Pacocha\",\n\t\t\t\"type\": \"sport\",\n\t\t\t\"location\": \"419 Walsh Brooks\",\"date\":\"2024-11-02T20:50:08.000Z\",\n\t\t\t\"price\": 1337,\n\t\t\t\"__v\": 0\n\t\t}\n\t]\n}\n```\n\n### GET /api/v1/events/sport/\n\n**Getting sport events**\n\n**Response 200 example (JSON)**\n```js\n{\n\t\"events\": [\n\t\t{\n\t\t\t\"defaultImage\": {\n\t\t\t\t\"data\": {\n\t\t\t\t\t\"type\":\"Buffer\",\"data\": [BYTE ARRAY]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"_id\": \"663c5d5ca3708a9482fd87d2\",\n\t\t\t\"hasImage\": false,\n\t\t\t\"name\": \"Weissnat, Greenfelder and Pacocha\",\n\t\t\t\"type\": \"sport\",\n\t\t\t\"location\": \"419 Walsh Brooks\",\"date\":\"2024-11-02T20:50:08.000Z\",\n\t\t\t\"price\": 1337,\n\t\t\t\"__v\": 0\n\t\t}\n\t]\n}\n```\n\n### GET /api/v1/events/concert/\n\n**Getting concert events**\n\n**Response 200 example (JSON)**\n```js\n{\n\t\"events\": [\n\t\t{\n\t\t\t\"defaultImage\": {\n\t\t\t\t\"data\": {\n\t\t\t\t\t\"type\":\"Buffer\",\"data\": [BYTE ARRAY]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"_id\": \"663c5d5ca3708a9482fd87d2\",\n\t\t\t\"hasImage\": false,\n\t\t\t\"name\": \"Weissnat, Greenfelder and Pacocha\",\n\t\t\t\"type\": \"sport\",\n\t\t\t\"location\": \"419 Walsh Brooks\",\"date\":\"2024-11-02T20:50:08.000Z\",\n\t\t\t\"price\": 1337,\n\t\t\t\"__v\": 0\n\t\t}\n\t]\n}\n```\n\n### GET /api/v1/events/exhibition/\n\n**Getting exhibition events**\n\n**Response 200 example (JSON)**\n```js\n{\n\t\"events\": [\n\t\t{\n\t\t\t\"defaultImage\": {\n\t\t\t\t\"data\": {\n\t\t\t\t\t\"type\":\"Buffer\",\"data\": [BYTE ARRAY]\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"_id\": \"663c5d5ca3708a9482fd87d2\",\n\t\t\t\"hasImage\": false,\n\t\t\t\"name\": \"Weissnat, Greenfelder and Pacocha\",\n\t\t\t\"type\": \"sport\",\n\t\t\t\"location\": \"419 Walsh Brooks\",\"date\":\"2024-11-02T20:50:08.000Z\",\n\t\t\t\"price\": 1337,\n\t\t\t\"__v\": 0\n\t\t}\n\t]\n}\n```\n\n### POST /api/v1/tickets/?eventId={{EVENT_ID}}\n\n**Creating ticket for certain event**\n\n**Request body**\n```js\n{\n\t\"quantity\": QUANTITY, // number\n\t\"price\": PRICE, // number\n\t\"username\": USERNAME, // string\n\t\"secret\": SECRET // string\n}\n```\n\n**Response 201 example (JSON)**\n```js\n{\n\t\"quantity\": 1,\n\t\"price\": 4,\n\t\"isArchived\": false,\n\t\"event\": [\n\t\t\"663bd29bd2d1a07681577ca9\"\n\t],\n\t\"user\": [\n\t\t\"663c5e2fa3708a9482fd87d5\"\n\t],\n\t\"_id\": \"663c5fe2a3708a9482fd87dd\",\n\t\"__v\": 0\n}\n```\n\n### GET /api/v1/tickets/all/\n\n**Getting user's all tickets**\n\n**Request body**\n```js\n{\n\t\"username\": USERNAME, // string\n\t\"secret\": SECRET // string\n}\n```\n\n**Response 200 example (JSON)**\n```js\n[\n\t{\n\t\t\"_id\": \"663c5fe2a3708a9482fd87dd\",\n\t\t\"quantity\": 1,\n\t\t\"price\": 4,\n\t\t\"isArchived\": false,\n\t\t\"event\": [\n\t\t\t\"663bd29bd2d1a07681577ca9\"\n\t\t],\n\t\t\"user\": [\n\t\t\t\"663c5e2fa3708a9482fd87d5\"\n\t\t],\n\t\t\"__v\": 0\n\t}\n]\n```\n\n### GET /api/v1/tickets/archived/\n\n**Getting user's archived tickets**\n\n**Request body**\n```js\n{\n\t\"username\": USERNAME, // string\n\t\"secret\": SECRET // string\n}\n```\n\n**Response 200 example (JSON)**\n```js\n[\n\t{\n\t\t\"_id\": \"663c5fe2a3708a9482fd87dd\",\n\t\t\"quantity\": 1,\n\t\t\"price\": 4,\n\t\t\"isArchived\": true,\n\t\t\"event\": [\n\t\t\t\"663bd29bd2d1a07681577ca9\"\n\t\t],\n\t\t\"user\": [\n\t\t\t\"663c5e2fa3708a9482fd87d5\"\n\t\t],\n\t\t\"__v\": 0\n\t}\n]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronosgit%2Fevents-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchronosgit%2Fevents-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchronosgit%2Fevents-api/lists"}