{"id":23616902,"url":"https://github.com/sgc109/mockstagram","last_synced_at":"2025-05-13T00:16:52.023Z","repository":{"id":266316023,"uuid":"895171051","full_name":"sgc109/mockstagram","owner":"sgc109","description":"Mockstagram - Instagram clone web service project built on a microservices architecture.","archived":false,"fork":false,"pushed_at":"2025-01-12T17:14:02.000Z","size":56305,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T00:16:06.551Z","etag":null,"topics":["armeria","debezium","elasticsearch","grpc","instagram-clone","kafka","kafka-connect","kotlin","microservices","microservices-architecture","mongodb","msa","mysql","nodejs","protobuf","react","redis","social-media","spring-boot","typescript"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgc109.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-11-27T17:28:40.000Z","updated_at":"2025-01-12T17:14:05.000Z","dependencies_parsed_at":"2024-12-25T19:38:23.145Z","dependency_job_id":null,"html_url":"https://github.com/sgc109/mockstagram","commit_stats":null,"previous_names":["sgc109/mockstagram-msa","sgc109/mockstagram"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgc109%2Fmockstagram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgc109%2Fmockstagram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgc109%2Fmockstagram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgc109%2Fmockstagram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgc109","download_url":"https://codeload.github.com/sgc109/mockstagram/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253843225,"owners_count":21972874,"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":["armeria","debezium","elasticsearch","grpc","instagram-clone","kafka","kafka-connect","kotlin","microservices","microservices-architecture","mongodb","msa","mysql","nodejs","protobuf","react","redis","social-media","spring-boot","typescript"],"created_at":"2024-12-27T18:14:56.493Z","updated_at":"2025-05-13T00:16:51.955Z","avatar_url":"https://github.com/sgc109.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mockstagram\n\nInstagram clone web service project built on a microservices architecture.\n\n## Target Architecture\n![Architecture](https://github.com/user-attachments/assets/beef331c-372d-4233-a4b6-d72446b1f72e)\n\n## How to run\n\n* Run `./start.sh` script to run all services with docker compose.\n  * It will ask permission once to add domains(`mockstagram.com` and `image.mockstagramcdn.com`) on `/etc/hosts` file.\n* Open Browser and type `mockstagram.com` on address bar. Then, the site will open.\n\n![image](https://github.com/user-attachments/assets/69b9f333-71ba-4550-9315-1d1b812d7111)\n\n## Directory Structure\n\nThe directories are organized by domain, and each microservice’s directory may include subdirectories named api, batch, consumer, and domain (with exceptions for admin, web, and media-server).\n\n* `/admin`\n  * Back-office service (backend \u0026 frontend)\n* `/chat`\n  * Chat service\n* `/comment`\n  * Service responsible for managing comments\n* `/content`\n  * Service handling content uploads and retrieval\n* `/media-server`\n  * Service for image and video uploads, encoding, and related tasks\n* `/notification`\n  * Service for in-app notifications\n* `/push`\n  * Service for push notifications and scheduling\n* `/reaction`\n  * Service managing user reactions (e.g., likes, saves)\n* `/recommend`\n  * Service providing APIs for recommendation feeds\n* `/search`\n  * Service responsible for search functionality\n* `/user`\n  * Service managing accounts and user-related features\n* `/web`\n  * React-based web client and web BFF\n\n## Assumptions\n* Given that Instagram is a global service used by users worldwide, each type of database has a **primary DB in one region, with replica DBs in several other regions**. Servers handling user requests are assumed to be geographically distant from the primary DB. To simulate this, I plan to introduce **intentional network latency and design and implement the system with these considerations in mind**.\n \n## QnA\n* Why aren't all the microservices based on Spring Boot and Gradle managed within the same gradle project?\n  * According to Conway’s Law, the structure of a system tends to mirror the structure of the organization and the services used here will be managed by multiple teams in the real world. If a mono-repo is not being used, each service will be located in a separate remote repository managed by its respective team. Some teams may manage multiple services within a single repository within a same gradle project. This can vary depending on the organizational structure and ownership, so I'd rather assume that each service is stored in a separate remote repository.\n* Why is BFF (Backend For Frontend) developed using Typescript and Node.js?\n  * The concept of BFF (Backend For Frontend) originally emerged to be managed by the team developing and operating a specific client application, which is why it uses the same technology stack as the web client.\n* Why do all the microservices share a single database even though it's a microservices architecture?\n  * For the sake of simplicity and convenience in development and testing, the databases used by each microservice were configured as **separate logical DBs within a single physical DB**. However, each service was assigned a unique account, **granting access permissions exclusively to its own logical DB**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgc109%2Fmockstagram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgc109%2Fmockstagram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgc109%2Fmockstagram/lists"}