{"id":20949529,"url":"https://github.com/nhathvv/backend-nodejs-api-twitter","last_synced_at":"2026-04-14T05:31:30.434Z","repository":{"id":240429438,"uuid":"775820578","full_name":"nhathvv/backend-nodejs-api-twitter","owner":"nhathvv","description":"This project is an API I developed inspired by Twitter","archived":false,"fork":false,"pushed_at":"2024-09-09T03:59:29.000Z","size":1241,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T02:46:49.098Z","etag":null,"topics":["aws","expressjs","mongodb","socket-io","typescript"],"latest_commit_sha":null,"homepage":"https://backend-nodejs-api-twitter.onrender.com/api-docs","language":"TypeScript","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/nhathvv.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-03-22T05:28:17.000Z","updated_at":"2024-11-28T07:41:15.000Z","dependencies_parsed_at":"2024-05-18T20:26:40.346Z","dependency_job_id":"1f1f0553-4b2e-41dd-9b30-10c959c24fba","html_url":"https://github.com/nhathvv/backend-nodejs-api-twitter","commit_stats":null,"previous_names":["nhathvv/backend-twitter-api","nhathvv/backend-nodejs-api-twitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nhathvv/backend-nodejs-api-twitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhathvv%2Fbackend-nodejs-api-twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhathvv%2Fbackend-nodejs-api-twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhathvv%2Fbackend-nodejs-api-twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhathvv%2Fbackend-nodejs-api-twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nhathvv","download_url":"https://codeload.github.com/nhathvv/backend-nodejs-api-twitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nhathvv%2Fbackend-nodejs-api-twitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: 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":["aws","expressjs","mongodb","socket-io","typescript"],"created_at":"2024-11-19T00:38:10.510Z","updated_at":"2026-04-14T05:31:30.417Z","avatar_url":"https://github.com/nhathvv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README.md\n\nThis project is an API I developed inspired by Twitter, featuring the reconstruction of various functionalities such as managing user information, tweets, media, bookmarks, likes, and followers\n\n## Acknowledgements\n\n- [Desgin database](https://twitter-nhathv.s3.ap-southeast-1.amazonaws.com/images/design-db.jpg)\n- [Swagger API Docs](https://nhat-dev-twitter.onrender.com/api-docs/)\n\n## Installation\n\nInstall my-project with npm:\n\n```bash\n  npm install\n  npm run dev\n```\n\nThen, navigate to http://localhost:4000 in your browser to view the project.\n\n## API Reference\n\n### User\n\n#### Login\n\n```\n  POST /users/login\n```\n\n| Body       | Type     | Description                         |\n| :--------- | :------- | :---------------------------------- |\n| `email`    | `string` | **Required**. User's email address. |\n| `password` | `string` | **Required**. User's password.      |\n\n#### Register\n\n```\n  POST /users/register\n```\n\n| Body               | Type     | Description                              |\n| :----------------- | :------- | :--------------------------------------- |\n| `name`             | `string` | **Required**. User's full name.          |\n| `email`            | `string` | **Required**. User's email address.      |\n| `password`         | `string` | **Required**. User's password.           |\n| `confirm_password` | `string` | **Required**. Confirm user's password.   |\n| `date_of_birth`    | `string` | User's date of birth in ISO 8601 format. |\n\n#### Get User Profile (Me)\n\n```\n  GET /users/me\n```\n\n| Authorization  | Type     | Description                      |\n| :------------- | :------- | :------------------------------- |\n| `access_token` | `string` | **Required**. The accesss token. |\n\n#### Update User Profile\n\n```\n  PATCH /users/me\n```\n\n| Authorization  | Type     | Description                      |\n| :------------- | :------- | :------------------------------- |\n| `access_token` | `string` | **Required**. The accesss token. |\n\n#### Logout\n\n```\n  POST /users/logout\n```\n\n| Body            | Type     | Description                      |\n| :-------------- | :------- | :------------------------------- |\n| `refresh_token` | `string` | **Required**. The refresh token. |\n\n#### Get access token\n\n```\n  POST /users/refresh-token\n```\n\n| Body            | Type     | Description                      |\n| :-------------- | :------- | :------------------------------- |\n| `refresh_token` | `string` | **Required**. The refresh token. |\n\n#### Resend verify email\n\n```\n  POST /users/resend-verify-email\n```\n\n| Authorization  | Type     | Description                      |\n| :------------- | :------- | :------------------------------- |\n| `access_token` | `string` | **Required**. The accesss token. |\n\n#### Forgot password\n\n```\n  POST /users/forgot-password\n```\n\n| Body    | Type     | Description                         |\n| :------ | :------- | :---------------------------------- |\n| `email` | `string` | **Required**. User's email address. |\n\n#### Verify forgot password\n\n```\n  POST /users/verify-forgot-password\n```\n\n| Body                    | Type     | Description                              |\n| :---------------------- | :------- | :--------------------------------------- |\n| `forgot_password_token` | `string` | **Required**. The forgot password token. |\n\n#### Reset password\n\n```\n  POST /users/forgot-password\n```\n\n| Body                    | Type     | Description                            |\n| :---------------------- | :------- | :------------------------------------- |\n| `forgot_password_token` | `string` | **Required**. The forgot password      |\n| `password`              | `string` | **Required**. User's password.         |\n| `confirm_password`      | `string` | **Required**. Confirm user's password. |\n\n#### Get username\n\n```\n  GET /users/{username}\n```\n\n| Parameters | Type     | Description                                                         |\n| :--------- | :------- | :------------------------------------------------------------------ |\n| `username` | `string` | **Required**. The username of the user to retrieve information for. |\n\n#### Follow users\n\n```\n  POST /users/follow\n```\n\n| Body               | Type     | Description                                  |\n| :----------------- | :------- | :------------------------------------------- |\n| `followed_user_id` | `string` | **Required**. TThe ID of the user to follow. |\n\n#### Unfollow users\n\n```\n  DELETE /users/{user_id}\n```\n\n| Parameters | Type     | Description                                    |\n| :--------- | :------- | :--------------------------------------------- |\n| `user_id`  | `string` | **Required**. TThe ID of the user to unfollow. |\n\n#### Change password\n\n```\n  PUT /users/change-password\n```\n\n| Parameters         | Type     | Description                             |\n| :----------------- | :------- | :-------------------------------------- |\n| `old_password`     | `string` | **Required**. The current password.     |\n| `password`         | `string` | **Required**. The new password.         |\n| `confirm_password` | `string` | **Required**. Confirm the new password. |\n\n### Tweets\n\n#### Create Tweet\n\n```\n  POST /tweets\n```\n\n| Body        | Type     | Description                                   |\n| :---------- | :------- | :-------------------------------------------- |\n| `type`      | `number\t` | **Required**. The type of the tweet.          |\n| `audience`  | `number` | **Required**. The audience of the tweet.      |\n| `content`   | `string` | **Required**. The content of the tweet.       |\n| `parent_id` | `string` | The ID of the parent tweet (if applicable).   |\n| `hashtags`  | `array`  | An array of hashtags included in the tweet.   |\n| `mentions`  | `array`  | An array of user IDs mentioned in the tweet.  |\n| `medias`    | `array`  | An array of media URLs attached to the tweet. |\n\n#### Get Tweets\n\n```\n  GET /tweets\n```\n\n| Parameters | Type     | Description                                     |\n| :--------- | :------- | :---------------------------------------------- |\n| `limit`    | `number\t` | **Required**. The number of tweets to retrieve. |\n| `page`     | `number` | **Required**. The page number of the results.   |\n\n#### Get Tweets by ID\n\n```\n  GET /tweets/{tweet_id}\n```\n\n| Parameters | Type     | Description                                     |\n| :--------- | :------- | :---------------------------------------------- |\n| `limit`    | `number\t` | **Required**. The number of tweets to retrieve. |\n| `page`     | `number` | **Required**. The page number of the results.   |\n| `tweet_id` | `number\t` | **Required**. The ID of the tweet to retrieve.  |\n\n#### Get Tweets Children by Tweet ID\n\n```\n  GET /tweets/{tweet_id}/children\n```\n\n| Parameters   | Type     | Description                                                            |\n| :----------- | :------- | :--------------------------------------------------------------------- |\n| `limit`      | `number\t` | **Required**. The number of tweets to retrieve.                        |\n| `page`       | `number` | **Required**. The page number of the results.                          |\n| `tweet_id`   | `number\t` | **Required**. The ID of the tweet to retrieve.                         |\n| `tweet_type` | `number` | **Required**. Type of the tweet (Tweet, Retweet, QuoteTweet, Comment). |\n\n### Medias\n\n#### Upload Image\n\n```\n  POST /medias/upload-image\n```\n\n| Body    | Type   | Description                             |\n| :------ | :----- | :-------------------------------------- |\n| `image` | `file\t` | **Required**. The image file to upload. |\n\n#### Upload Video\n\n```\n  POST /medias/upload-video\n```\n\n| Body    | Type   | Description                             |\n| :------ | :----- | :-------------------------------------- |\n| `video` | `file\t` | **Required**. The video file to upload. |\n\n### Static\n\n#### Stream video\n\n```\n  GET /statics/video-stream/{video_name}\n```\n\n| Parameters   | Type     | Description                                    |\n| :----------- | :------- | :--------------------------------------------- |\n| `video_name` | `string\t` | **Required**. The name of the video to stream. |\n\n#### Stream video HLS\n\n```\n  GET /statics/video-hls/{id}/master.m3u8\n```\n\n| Parameters | Type     | Description                |\n| :--------- | :------- | :------------------------- |\n| `id`       | `string\t` | **Required**. The video ID |\n\n#### Stream video HLS segment\n\n```\n  GET /statics/video-hls/{id}/{v}/{segment}\n```\n\n| Parameters | Type     | Description                      |\n| :--------- | :------- | :------------------------------- |\n| `id`       | `string\t` | **Required**. The video ID       |\n| `v`        | `string\t` | **Required**. The video version. |\n| `segment`  | `string\t` | **Required**. The video segment. |\n\n### Search\n\n#### Search Tweet\n\n```\n  GET /search\n```\n\n| Parameters | Type     | Description                                     |\n| :--------- | :------- | :---------------------------------------------- |\n| `keyword`  | `string\t` | **Required**. The keyword to search for.        |\n| `limit`    | `number\t` | **Required**. The number of tweets to retrieve. |\n| `page`     | `number` | **Required**. The page number of the results.   |\n\n### Likes\n\n#### Like tweet\n\n```\n  POST /likes\n```\n\n| Body       | Type     | Description                                |\n| :--------- | :------- | :----------------------------------------- |\n| `tweet_id` | `string\t` | **Required**. The ID of the tweet to like. |\n\n#### Unlike tweet\n\n```\n  DELETE /likes/tweets/{tweet_id}\n```\n\n| Parameters | Type     | Description                                  |\n| :--------- | :------- | :------------------------------------------- |\n| `tweet_id` | `string\t` | **Required**. The ID of the tweet to unlike. |\n\n### Bookmarks\n\n#### Bookmark tweet\n\n```\n  POST /bookmarks\n```\n\n| Body       | Type     | Description                                    |\n| :--------- | :------- | :--------------------------------------------- |\n| `tweet_id` | `string\t` | **Required**. The ID of the tweet to bookmark. |\n\n#### Unbookmark tweet\n\n```\n  DELETE /bookmarks/tweets/{tweet_id}\n```\n\n| Parameters | Type     | Description                                      |\n| :--------- | :------- | :----------------------------------------------- |\n| `tweet_id` | `string\t` | **Required**. The ID of the tweet to unbookmark. |\n\n### Conversations\n\n#### Get conversations by receiver ID\n\n```\n  GET /conversations/receiver/{receiver_id}\n```\n\n| Parameters    | Type     | Description                                               |\n| :------------ | :------- | :-------------------------------------------------------- |\n| `receiver_id` | `string\t` | **Required**. The ID of the receiver in the conversation. |\n\n## Environment Variables\n\nTo run this project, you will need to add the following environment variables to your **.env.example** file\n\n## Authors\n\n- [@nhathvv](https://www.github.com/nhathvv)\n\n## 🔗 Links\n\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/hoang-van-nhat/)\n[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge\u0026logo=twitter\u0026logoColor=white)](https://x.com/Nhathvvv)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhathvv%2Fbackend-nodejs-api-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnhathvv%2Fbackend-nodejs-api-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnhathvv%2Fbackend-nodejs-api-twitter/lists"}