Skip to content
/ portal Public

a microservice architecture social media web app example

Notifications You must be signed in to change notification settings

mewil/portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portal

Build Status

A social media web app powered by React, Gin, gRPC, and much more.

Homepage

alt text

Overview

Service Architecture

The portal application is split into services: auth, file, frontend, user, and post. These services communicate via gRPC and Protocol Buffer messages, defined here. All code not run in the browser is written in Go, but since each service runs in its own isolated Docker container and uses gRPC, they could be implemented in any supported language. The application uses the RDBMS MySQL and Object Storage Platform Minio for data storage.

Frontend Service

The frontend service is split into two parts, a web app and a REST API that provides clients controlled access to the other services.

Web App

The web app is written with React, and uses a package-based architecture. Each package here, has a specific function, and contains all the state and UI management code needed for that function, or it is used as a build block for other packages. The app follows the Flux architecture, and uses Redux, Redux Saga, and a number of other libraries to accomplish this. It also uses styled components instead of stylesheets.

REST API

The REST API is a Go app that uses the Gin framework for routing. It serves the web app and provides routes for accessing user and post data here. These routes validate requests and call controllers that make necessary gRPC calls to the other services.

Auth Service

The auth service manages hashing and storing user passwords and admin data. It uses a MySQL table to manage this data, and has gRPC server handlers for accepting requests.

File Service

The file service manages uploading and fetching files. It uses Minio, an open source object store, and gRPC streams for its file data to accomplish this.

User Service

The user service manages user data such as name, description, and followers/following and fetching files. It uses two MySQL tables to manage this data, and has gRPC server handlers for accepting requests.

Post Service

The post service manages user's posts, comments, and likes. It uses several MySQL tables to manage this data, and has gRPC server handlers for accepting requests.

Setup

  1. Install Docker Compose
  2. Clone this repo: git clone https://github.com/mewil/portal
  3. Change directory to the deploy repo: cd portal/deploy
  4. Start whatever environment you want
    • Development docker-compose -f development.yml up -d
      • Your git repo will be linked to the development environment, so your local changes will be reflected with a container restart
    • Production (more ENV data required) docker-compose -f production.yml up -d
      • NOTE: This takes care of setting up NGINX AND LetsEncrypt with the appropriate hosts and auto renewal
  5. Access http://localhost:8000 and start developing! To view application logs, run docker-compose -f development.yml logs -f

About

a microservice architecture social media web app example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published