{"id":15159664,"url":"https://github.com/apexkv/facebook-clone","last_synced_at":"2026-02-16T17:04:58.162Z","repository":{"id":254401698,"uuid":"846349066","full_name":"apexkv/facebook-clone","owner":"apexkv","description":"This is a clone project of facebook platform in microservies architecture","archived":false,"fork":false,"pushed_at":"2025-01-09T21:11:20.000Z","size":30441,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T03:55:38.090Z","etag":null,"topics":["clone-project","django","djanogo-rest-framework","facebook-clone","microservices","microservices-architecture","mongodb","mysql","neo4j","nextjs","nodejs","rabbitmq","reactjs","redis","socket-io"],"latest_commit_sha":null,"homepage":"","language":"Python","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/apexkv.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}},"created_at":"2024-08-23T02:49:13.000Z","updated_at":"2025-03-18T11:43:30.000Z","dependencies_parsed_at":"2024-09-22T09:01:19.942Z","dependency_job_id":"56f9fe2a-9c0f-4d0a-8a89-cfc8903eec63","html_url":"https://github.com/apexkv/facebook-clone","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"ed60514c53235c7ac902a9e13cf8c9d380782938"},"previous_names":["kavi97-boss/facebook-clone","apexkv/facebook-clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apexkv/facebook-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexkv%2Ffacebook-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexkv%2Ffacebook-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexkv%2Ffacebook-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexkv%2Ffacebook-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apexkv","download_url":"https://codeload.github.com/apexkv/facebook-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apexkv%2Ffacebook-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276778322,"owners_count":25703152,"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-09-24T02:00:09.776Z","response_time":97,"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":["clone-project","django","djanogo-rest-framework","facebook-clone","microservices","microservices-architecture","mongodb","mysql","neo4j","nextjs","nodejs","rabbitmq","reactjs","redis","socket-io"],"created_at":"2024-09-26T21:41:16.507Z","updated_at":"2025-09-24T15:55:54.546Z","avatar_url":"https://github.com/apexkv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Facebook-Clone Project**\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [High-Level Architecture](#high-level-architecture)\n3. [Folder Structure](#folder-structure)\n4. [Key Features](#key-features)\n5. [System Architecture](#system-architecture)\n6. [Technologies Used](#technologies-used)\n7. [Advantages of the Architecture](#advantages-of-the-architecture)\n8. [Getting Started](#getting-started)\n9. [References](#references)\n10. [License](#license)\n11. [Finally](#finally)\n\n## Overview\n\nThis Facebook Clone project is a fully functional social media platform built with a microservices architecture. It features user authentication, posts, comments, likes, chat functionality, friend connections, and a modern frontend interface. The project emphasizes scalability, data consistency, and performance.\n\n---\n\n#### **High-Level Architecture**\n\n1. **Microservices**\n\n-   For detailed documentation of each microservice, please refer to the following:\n\n    1. [Users Microservice](./users/README.md)\n    2. [Posts Microservice](./posts/README.md)\n    3. [Friends Microservice](./friends/README.md)\n    4. [Chat Microservice](./chat/README.md)\n    5. [Frontend Service](./frontend/README.md)\n\n2. **Frontend**\n\n    - Built with **Next.js**, the frontend offers a seamless user experience with modern UI/UX principles and server-side rendering.\n\n3. **Databases**\n\n    - **PostgreSQL**: Used for structured data in the Chat, Posts, and Users microservices.\n    - **Neo4j**: Used in the Friends microservice to handle graph-based relationships like friendships and friend suggestions.\n\n4. **Messaging and Caching**\n\n    - **RabbitMQ**: Ensures data consistency across microservices by facilitating event-driven communication.\n    - **Redis**:\n        - Used for caching frequently accessed data.\n        - Functions as the event store for channels in the Chat microservice to support real-time communication.\n\n5. **Containerization**\n    - All microservices and the frontend are fully containerized using Docker.\n    - A **Docker Compose** file orchestrates the services, ensuring seamless development and deployment.\n\n---\n\n#### **Folder Structure**\n\n```plaintext\nfacebook-clone/\n│\n├── users/              # Users Microservice\n├── posts/              # Posts Microservice\n├── friends/            # Friends Microservice\n├── chat/               # Chat Microservice\n├── frontend/           # Frontend Service\n├── docker-compose.yml  # Docker Compose configuration\n├── README.md           # Main Project Documentation\n```\n\n#### **Key Features**\n\n-   **Authentication and Authorization**:\n\n    -   User registration, login, and session management via the Users microservice.\n\n-   **Posts Management**:\n\n    -   Users can create, delete and view posts.\n    -   Features like commenting and liking posts are supported.\n\n-   **Friendship Management**:\n\n    -   Users can send and accept friend requests.\n    -   Friend suggestions are generated using graph-based algorithms in Neo4j.\n\n-   **Real-time Chat**:\n\n    -   Secure, scalable real-time messaging using Django Channels and Redis.\n\n-   **Modern Frontend**:\n\n    -   Built with Next.js for optimized performance and modern design.\n\n-   **Scalability and Consistency**:\n\n    -   Event-driven communication ensures data consistency across microservices using RabbitMQ.\n    -   Redis caching improves response times for high-demand endpoints.\n\n-   **Containerization**:\n    -   All components are containerized for consistent deployment across different environments.\n\n---\n\n### **System Architecture**\n\n![High-Level System Architecture](./images/System-Architecture.png)\n\n#### **Technologies Used**\n\n-   **Backend Framework**: Django with Django Rest Framework\n-   **Frontend Framework**: Next.js\n-   **Databases**: PostgreSQL, Neo4j\n-   **Message Broker**: RabbitMQ\n-   **Cache**: Redis\n-   **Containerization**: Docker\n-   **Orchestration**: Docker Compose\n\n---\n\n#### **Advantages of the Architecture**\n\n1. **Scalability**: Each microservice can be scaled independently to handle growing user demands.\n2. **Modularity**: Clear separation of concerns between different services simplifies maintenance and development.\n3. **Data Consistency**: RabbitMQ ensures event-driven synchronization between services.\n4. **Performance**: Redis caching improves the speed of frequently accessed data.\n5. **Modern Development Practices**: The use of Docker and Docker Compose enables seamless deployment and development.\n\n## Getting Started\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/apexkv/facebook-clone.git\ncd facebook-clone\n```\n\n### 2. Configure environment variables for each service\n\n-   These environment variables configure the necessary services like the database, message broker (RabbitMQ), and other service dependencies. Please make sure to fill in the appropriate values based on your environment.\n\n#### Users .env\n\n```plaintext\n# ./users/.env\n\nSECRET_KEY=ILKQ1giDu=\n\nPOSTGRES_DB=\nPOSTGRES_USER=\nPOSTGRES_PASSWORD=\nPOSTGRES_HOST=\nPOSTGRES_ROOT_PASSWORD=\nPOSTGRES_PORT=\n\nRABBITMQ_DEFAULT_USER=\nRABBITMQ_DEFAULT_PASS=\nRABBITMQ_HOST=\n\nCURRENT_QUEUE=users\nQUEUE_LIST=friends,posts,chat\n```\n\n#### Chat .env\n\n```plaintext\n# ./chat/.env\n\n# this secret key need to be same scret key in Users service secret key\nSECRET_KEY=ILKQ1giDu=\n\nPOSTGRES_DB=\nPOSTGRES_USER=\nPOSTGRES_PASSWORD=\nPOSTGRES_HOST=\nPOSTGRES_ROOT_PASSWORD=\nPOSTGRES_PORT=\n\nRABBITMQ_DEFAULT_USER=\nRABBITMQ_DEFAULT_PASS=\nRABBITMQ_HOST=\n\nCURRENT_QUEUE=chat\nQUEUE_LIST=friends,posts,users\n\nUSERS_SERVICE=http://users:8000\n```\n\n#### Posts .env\n\n```plaintext\n# ./posts/.env\n\nSECRET_KEY=ILKQ1giDu=\n\nPOSTGRES_DB=\nPOSTGRES_USER=\nPOSTGRES_PASSWORD=\nPOSTGRES_HOST=\nPOSTGRES_ROOT_PASSWORD=\nPOSTGRES_PORT=\n\nRABBITMQ_DEFAULT_USER=\nRABBITMQ_DEFAULT_PASS=\nRABBITMQ_HOST=\n\nCURRENT_QUEUE=posts\nQUEUE_LIST=friends,chats,users\n\nUSERS_SERVICE=http://users:8000\n```\n\n#### Friends .env\n\n```plaintext\n# ./friends/.env\n\nSECRET_KEY=ILKQ1giDu=\n\nNEO4J_AUTH=\nNEO4j_HOST=\n\nRABBITMQ_DEFAULT_USER=\nRABBITMQ_DEFAULT_PASS=\nRABBITMQ_HOST=\n\nQUEUE_LIST=chat,posts,users\nCURRENT_QUEUE=friends\n\nUSERS_SERVICE=http://users:8000\n```\n\n### 3. Start Service Using Docker\n\n```bash\ndocker compose up --build\n```\n\n### 4. Now you can explorer the project in these endpoints\n\n```\nhttp://localhost:3000/ # nextjs frontend\n\nhttp://localhost:888/api/users/ # users microservice\n\nhttp://localhost:888/api/posts/ # posts microservice\n\nhttp://localhost:888/api/friends/ # friends microservice\n\nhttp://localhost:888/api/chat/ # chat microservice\n```\n\n---\n\n### References\n\nFor more information on Docker and Docker Compose, visit their official documentation:\n\n-   [Docker](https://docs.docker.com/)\n-   [Docker Compose](https://docs.docker.com/compose/)\n\n# License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.\n\n# Finally\n\nThank you for exploring this Facebook Clone project. If you have any feedback, feel free to create an issue or contribute to the repository. Happy coding! 😊\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexkv%2Ffacebook-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapexkv%2Ffacebook-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapexkv%2Ffacebook-clone/lists"}