{"id":14969131,"url":"https://github.com/fastify/fastify-example-twitter","last_synced_at":"2025-10-04T07:55:56.734Z","repository":{"id":55454598,"uuid":"103755130","full_name":"fastify/fastify-example-twitter","owner":"fastify","description":"Fastify example - clone twitter","archived":false,"fork":false,"pushed_at":"2025-02-03T11:11:07.000Z","size":125,"stargazers_count":278,"open_issues_count":5,"forks_count":48,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-23T15:22:05.658Z","etag":null,"topics":["fastify"],"latest_commit_sha":null,"homepage":"","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/fastify.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},"funding":{"github":"fastify","open_collective":"fastify"}},"created_at":"2017-09-16T13:46:04.000Z","updated_at":"2025-05-10T13:53:33.000Z","dependencies_parsed_at":"2024-01-23T20:11:24.477Z","dependency_job_id":"79188306-e2f8-477f-94dd-193ffeff85e3","html_url":"https://github.com/fastify/fastify-example-twitter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fastify/fastify-example-twitter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-example-twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-example-twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-example-twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-example-twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","download_url":"https://codeload.github.com/fastify/fastify-example-twitter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Ffastify-example-twitter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278283453,"owners_count":25961311,"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-10-04T02:00:05.491Z","response_time":63,"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":["fastify"],"created_at":"2024-09-24T13:41:11.198Z","updated_at":"2025-10-04T07:55:56.722Z","avatar_url":"https://github.com/fastify.png","language":"JavaScript","readme":"\u003e [!TIP]\n\u003e This project is archived, check the new and updated [fastify demo](https://github.com/fastify/demo)!\n\n# Fastify twitter clone\n\nThe aim of this project is to show how `fastify` can be used.\n\n**NB:** This project should be considered WIP and it does not reflect the best way we think fastify should be used, but it's rather an experiment to help driving fastify.\n\n## Run\n\nFor running this project on your machine:\n```bash\n# terminal 1: Start frontend server\ncd frontend \u0026\u0026 npm start\n# terminal 2: start backend\nnpm start -- --log-level trace --port 3001\n```\n\nOpen your browser at [http://localhost:3000](http://localhost:3000)\n\n**NB** this project need to access a mongodb and a redis instance. If you haven't them, please consider to use docker.\n\n## Backend\n\n### Architecture\n\nFastify helps us to keep this segregation: the plugin system provides us a way to declare pieces of our business logic without exposing them to the whole application. If you looking for a guide to understand better how the plugin system works, please read this [Plugin Guide](https://fastify.dev/docs/latest/Plugins-Guide/)\n\nSo, the backend is splitted into plugins:\n- *user*: user authentication / user database\n- *tweet*: tweet storage\n- *follow*: follow storage\n- *timeline*: timeline for homepage\n\nThe last three modules have a `preHandler` hook to find which the user has made the request.\n\nEach plugin has almost the same structure:\n- `index.js` is the fastify binding\n- `service.js` is the business logic\n- `schemas.js` has the schemas used for http validation and serialization (See [`fastify` schemas](https://fastify.dev/docs/latest/Validation-and-Serialization/))\n\n### User plugin\n\nThis plugin registers some APIs in order to register, login, search and get a profile for an user.\n\nIt uses `mongodb` to save users and exports a `userClient` to allow other plugins to access to an user profile.\n\n### Tweet plugin\n\nThis plugin stores tweets and allows you to retrieve the tweets of an user.\n\nIt uses `mongodb` for storing the tweets and exports a client for tweets retrieving.\n\n### Follow plugin\n\nThis plugin tracks the following and the followers implementing the flow explained [here](https://redis.io/topics/twitter-clone).\n\nIt uses `redis` for tracking which users follow the other ones and vice versa.\n\n### Timeline plugin\n\nThis plugin aggregates informations from `tweet` and `follow` plugin in order to return the tweet timeline.\n\nThis plugin doesn't use any database to track that informations and uses tweetService and followService to build the response.\n\n## Frontend\n\nThe frontend side has been done only to show a simple UI for avoiding the manual CURLs.\n\nIt is built using `react` + `redux` stack.\n\nNo UX or UI study are made (please PR!)\n\n***Coming soon***\n\n## TODO\n\n- [x] Search users\n- [x] Timeline\n- [x] Follow microservices for following and unfollowing other users\n- [x] Better test\n- [ ] Better README.md\n- [x] Use Docker compose\n- [ ] Use `fastify-react` for react serve side rendering\n- [x] Better UI\n- [ ] Even better UI\n","funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffastify-example-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastify%2Ffastify-example-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Ffastify-example-twitter/lists"}