Giter Site home page Giter Site logo

lightmnd / microservices-project-23 Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5.42 MB

Just an experiment using the microservices design pattern in NodeJS, React, Docker, Kubernetes, MongoDB, JWT, and more...

Dockerfile 2.71% HTML 9.07% JavaScript 88.22%

microservices-project-23's Introduction

Social Posts Project Documentation

System Diagram

alt text

Table of Contents


Introduction

This project is a simple Social application allows users to register, login, create posts, and add comments to posts. It utilizes various technologies including React, Node.js, Express, and MongoDB to provide a robust social posts platform.

Architecture Overview

Our project follows a microservices architecture, where no service depends on another directly. This modular approach ensures scalability and maintainability. Additionally, we use an event bus to handle events, both receiving and processing them efficiently.

Authentication

JWT and Cookie-Based Authentication

Our authentication system is based on JSON Web Tokens (JWT) and cookies. When a user logs in, they receive a JWT token that is stored in a cookie. This token is used to authenticate subsequent requests. It enhances security and ensures a seamless user experience.

Microservices

Our application is divided into several microservices, each responsible for specific functionalities:

  • User Service: Manages user registration and login.
  • Post Service: Handles post creation and retrieval.
  • Comment Service: Allows users to add comments to posts.
  • Event Bus (or Event Broker) Service: Handles async microservices communication.
  • Query: Manages query based on event type and handles queue messages.
  • Auth Service: Handles Authentication logic encrypting decrypting credentials.

This microservices architecture promotes isolation and independent scaling of services.

Event Bus

Event Handling with Event Bus

We employ an event bus to manage the communication between microservices. The event bus receives events and dispatches them to the appropriate services. This decoupled communication ensures that services can operate independently and asynchronously.

Queue System

Queue System with RabbitMQ

To handle write requests to the database efficiently, a queuing system was implemented using RabbitMQ. Write requests, such as creating a new post or comment, are placed in a queue and processed asynchronously. This enhances the performance and reliability of our application.

Docker Containerization

Docker Containerization

Our application is containerized using Docker, allowing for consistent deployment across different environments. Docker containers encapsulate each microservice, simplifying deployment and ensuring compatibility.

Kubernetes Orchestration

Kubernetes Orchestration (Nice to Have)

In the future, we plan to implement Kubernetes orchestration for our microservices. Kubernetes provides powerful tools for container orchestration, including automatic scaling, load balancing, and robust management of containerized applications. This will further enhance the scalability and reliability of our platform.


This documentation provides an overview of our Social Posts project, highlighting key components such as the microservices architecture, authentication system, event bus, and queue system.

microservices-project-23's People

Contributors

lightmnd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.