{"id":13461989,"url":"https://github.com/antirez/retwis","last_synced_at":"2025-03-25T01:31:28.252Z","repository":{"id":17477223,"uuid":"20251515","full_name":"antirez/retwis","owner":"antirez","description":"A Twitter-toy clone written in PHP and Redis, used in the early days to introduce Redis data types.","archived":false,"fork":false,"pushed_at":"2018-05-18T06:02:27.000Z","size":284,"stargazers_count":367,"open_issues_count":6,"forks_count":139,"subscribers_count":26,"default_branch":"master","last_synced_at":"2024-10-29T11:10:32.264Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antirez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-28T09:09:45.000Z","updated_at":"2024-08-30T22:14:02.000Z","dependencies_parsed_at":"2022-09-02T11:01:21.640Z","dependency_job_id":null,"html_url":"https://github.com/antirez/retwis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fretwis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fretwis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fretwis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fretwis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antirez","download_url":"https://codeload.github.com/antirez/retwis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245381629,"owners_count":20606066,"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":"2024-07-31T12:00:36.945Z","updated_at":"2025-03-25T01:31:27.964Z","avatar_url":"https://github.com/antirez.png","language":"PHP","readme":"Retwis is the Redis Hello World. A minimal Twitter-style social network clone\nwritten using Redis and PHP. The source code is designed to be very simple and\nat the same time to show different Redis data structures.\n\nYou can find a tutorial explaining step by step how the example was created\nin the [Twitter clone tutorial of the Redis documentation](http://redis.io/topics/twitter-clone).\n\nThis code was written back in 2009 when Redis was initially published, in order\nto expose interested developers to the Redis concepts and data types.\nLater, in May 2014, it was reworked in order to update it to *modern Redis*,\nsince when the example was introduced Redis lacked sorted sets, hashes,\nand many other features.\n\nThe following is a description of the data layout.\n\nUsers\n---\n\nUser IDs are generated sequencially via increments:\n\n    INCR next_user_id =\u003e 1000\n\n(We'll use the example user ID 1000 in the next examples)\n\nUsers are stored into Redis hashes, the key name of the hash representing a\ngiven user is `user:1000`. Every hash has the following fields:\n\n    username (the username of the user)\n    password (password of course)\n    auth 9458sd893448dfd\n\nThere are additional keys for following, followers, and posts:\n\n    following:1000 (sorted set of user ids)\n    followers:1000 (sorted set of user ids)\n    posts:1000 (list of posts ids)\n\nIn order to reverse lookup the user ID from the authentication toke or\nusername we have the following two additional keys:\n\n    The key `auths` is an hash mapping auth tokens to user IDs.\n    Example of field and value: 9458sd893448dfd =\u003e 1000\n\n    The key `users` is an hash mapping usernames to user IDs.\n    Example of field and value: antirez =\u003e 1000\n\nAdditionally we take a sorted set with usernames indexed by registration\ntime (the score is the unix time the user joined), so that we can populate\nour \"latest users\" view. The key is called `users_by_time`.\n\nPosts\n---\n\nPosts also have sequencial IDs, generated by incrementing the following key:\n\n    INCR next_post_id =\u003e 134\n\nEvery post is stored into an hash named `post:134` with the following\nfields:\n\n    user_id\n    time\n    body\n\nTimeline\n---\n\nJust a list of post IDs in the `timeline` key.\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantirez%2Fretwis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantirez%2Fretwis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantirez%2Fretwis/lists"}