{"id":35105879,"url":"https://github.com/kriogenia/allforone-service","last_synced_at":"2026-04-29T03:01:38.069Z","repository":{"id":44673451,"uuid":"384712457","full_name":"kriogenia/AllForOne-Service","owner":"kriogenia","description":"Repository of the service for the 4l1 (AllForOne) project","archived":false,"fork":false,"pushed_at":"2022-02-11T17:53:36.000Z","size":1254,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-06T05:06:39.879Z","etag":null,"topics":["alzheimers-disease","hacktoberfest","nodejs","rest-api","tfg","typescript","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriogenia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-10T14:06:16.000Z","updated_at":"2022-02-22T18:42:51.000Z","dependencies_parsed_at":"2022-09-03T10:22:36.380Z","dependency_job_id":null,"html_url":"https://github.com/kriogenia/AllForOne-Service","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/kriogenia/AllForOne-Service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriogenia%2FAllForOne-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriogenia%2FAllForOne-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriogenia%2FAllForOne-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriogenia%2FAllForOne-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriogenia","download_url":"https://codeload.github.com/kriogenia/AllForOne-Service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriogenia%2FAllForOne-Service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32408446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"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":["alzheimers-disease","hacktoberfest","nodejs","rest-api","tfg","typescript","websocket"],"created_at":"2025-12-27T18:10:10.940Z","updated_at":"2026-04-29T03:01:38.064Z","avatar_url":"https://github.com/kriogenia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AllForOne Service\nThis service is in charge of managing all the back-end operations of the 4l1 project.\nThe service provides a RESTful API to handle the user logic and a WebSocket server\nfor the location and feed features using Socket.io. \n\n## Deployment\nThis service has only been deployed on local on a WSL2 of a Windows machine.\nIt should work on different environments, specially Linux-based, but it has not been tested.\nTo deploy this service do the following:\n\n* Clone the repository on your directory of choice\n* Run the following commands:\n```sh\ncd 4l1-service\nyarn run dev\n```\n\nThis will deploy the server on the 3000 port, you can check it browsing to http://127.0.0.1:3000 (*yarn must be installed in the environment of choice to work*)\n\n## REST Endpoints\n\n### Authentication\n\n| Sign In\t| GET        \t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t| /auth/signin/:token\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Params    | token: string\t\t\t| Google Id Token of the user \t\t\t\t|\n| Response\t| session: object\t\t| Tokens and expiration time\t\t\t\t|\n|\t\t\t| user: object\t\t\t| Logged in user details\t\t\t\t\t|\n\n| Refresh\t| POST\t\t\t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t| /auth/refresh\t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Body\t    | auth: string\t\t\t| Authentication token of the user\t\t\t|\n| \t    \t| refresh: string\t\t| Refresh token of the user \t\t\t\t|\n| Response\t| session: object\t\t| New tokens and expiration time\t\t\t|\n\n### User\n\n| Update user\t| PUT         \t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /user/update\t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Body\t    \t| user: object\t\t\t| New data of the user to update\t\t\t|\n| Response\t\t| message: string\t\t| Success confirmation message\t\t\t\t|\n\n| Cared\t\t\t| GET           \t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /user/cared\t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Response\t\t| cared: object\t\t\t| User data of the cared user\t\t\t\t|\n\n#### Bonding\n\n| Bonds list\t| GET           \t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /user/bond/list\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Response\t\t| bonds: object[]\t\t| List of user data of bonds\t\t\t\t|\n\n| Establish bond| POST           \t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /user/bond/establish\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Body\t    \t| code: string\t\t\t| Read bonding code\t\t\t\t\t\t\t|\n| Response\t\t| message: string\t\t| Success confirmation message\t\t\t\t|\n\n| Generate bond\t| GET           \t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /user/bond/generate\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Response\t\t| code: string\t\t\t| New bonding code\t\t\t\t\t\t\t|\n\n### Feed\n\n| Message batch\t| GET           \t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t\t| /feed/messages/:page\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Params    \t| page: int\t\t\t\t| \\\u003cOptional\\\u003e Page to retrieve  \t\t\t|\n| Response\t\t| messages: object[]\t| Batch of messages retrieved\t\t\t\t|\n\n## Socket Events\n\n### Global Room\n\n* SUBSCRIBE, global:subscribe\n\t* Server event\n\t* Subscribes the user to the specified Global Room if they can\n\t* Message\n\t\t* id: string. ID of the user joining the room.\n\t\t* owner: string. ID of the user owner of the room.\n\t* Emmits\n\t\t* SUBSCRIPTION to all the users in the room\t\n\n* SUBSCRIPTION, global:subscription\n\t* Client event\n\t* Notifies to users in a Global Room about the new subscriber\n\t* Message\n\t\t* id: string. ID of the user joining the room.\n\t\t* room: string. ID of the room.\t\n\n* SHARE LOCATION, global:share_location\n\t* Client event\n\t* Notifies to users in the same Global Room that the requester is sharing their location\n\t* Message\n\t\t* id: string. ID of the user sharing the location.\n\t\t* displayName: string. Display name of the user sharing the location.\t\n\n* JOINING FEED, global:joining_feed\n\t* Client event\n\t* Notifies to users in the same Global Room that the requester joined the Feed Room\n\t* Message\n\t\t* id: string. ID of the user sharing the location.\n\t\t* displayName: string. Display name of the user sharing the location.\t\n\n\n### Location\n\n* SHARE, location:share\n\t* Server event\n\t* Subscribes the user to a Location room and notifies their peers\n\t* Message\n\t\t* id: string. ID of the user sharing the location.\n\t\t* displayName: string. Display name of the user sharing the location.\n\t* Emmits\n\t\t* SHARE LOCATION to the rest of users in the same Global Room\t\n\n* UPDATE, location:update\n\t* Broadcast event\n\t* Shares the location of the user with all their peers\n\t* Message\n\t\t* id: string. ID of the user sharing the location.\n\t\t* displayName: string. Display name of the user sharing the location.\n\t\t* position: coordinates. Geoposition of the user sharing the location.\t\n\t* Emmits\n\t\t* UPDATE to the rest of users in the same Location Room\t\n\n* STOP, location:stop\n\t* Broadcast event\n\t* Leaves the Location Room and notifies the rest of users on it\n\t* Message\n\t\t* id: string. ID of the user leaving the room.\n\t\t* displayName: string. Display name of the user leaving the room.\n\t* Emmits\n\t\t* STOP to the rest of users in the Location Room\t\n\n\n| Sign In\t|              \t\t\t|\t\t\t\t\t\t\t\t\t\t\t|\n|:-:\t\t| :-:\t\t\t\t\t|:-:\t\t\t\t\t\t\t\t\t\t|\n| URL     \t| /auth/signin/:token\t|\t\t\t\t\t\t\t\t\t\t\t|\n| Params    | token: string\t\t\t| Google Id Token of the user \t\t\t\t|\n| Response\t| auth: string\t\t\t| Auth token\t\t\t\t\t\t\t\t|\n|\t\t\t| refresh: string\t\t| Refresh token\t\t\t\t\t\t\t\t|\n|\t\t\t| expiration: number\t| Expiration timestamp of the auth token\t|\n|\t\t\t| user: object\t\t\t| Logged in user details\t\t\t\t\t|\n\n\n## Dependencies\n* [**Command Line Args**](https://www.npmjs.com/package/command-line-args)\n* [**dotenv**](https://www.npmjs.com/package/dotenv)\n* [**Express**](https://www.npmjs.com/package/express)\n* [**Google Auth Library**](https://www.npmjs.com/package/google-auth-library)\n* [**Helmet**](https://www.npmjs.com/package/helmet)\n* [**Http Status Codes**](https://www.npmjs.com/package/http-status-codes)\n* [**Jet-Logger**](https://www.npmjs.com/package/jet-logger)\n* [**jsonwebtoken**](https://www.npmjs.com/package/jsonwebtoken)\n* [**mongoose**](https://www.npmjs.com/package/mongoose)\n* [**Morgan**](https://www.npmjs.com/package/morgan)\n* [**Socket.io**](https://www.npmjs.com/package/socket.io)\n* [**Typegoose**](https://www.npmjs.com/package/@typegoose/typegoose)\n* [**Typescript**](https://www.npmjs.com/package/typescript)\n\n### Testing\n* [**Jest**](https://www.npmjs.com/package/jest) \n* [**mongodb-memory-server**](https://www.npmjs.com/package/mongodb-memory-server)\n* [**SuperTest**](https://www.npmjs.com/package/supertest)\n* [**TS-Jest**](https://www.npmjs.com/package/ts-jest)\n\n### Linting\n* [**eslint**](https://www.npmjs.com/package/eslint)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriogenia%2Fallforone-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriogenia%2Fallforone-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriogenia%2Fallforone-service/lists"}