Skip to content

Collaborate chat program, built with socket.io, docker containers and monitoring tools

License

Notifications You must be signed in to change notification settings

IceMints/Blobber-Buddy-Chat

 
 

Repository files navigation

Blobber Buddy Chat

by Gigi, Joying, Megan and Reem :) Pod 335

Introduction

We live in a pandemic world where social distancing and germaphobia is the new social norm. Finding friends is becoming more difficult and strangers are becoming stranger! Fear not! Blobber's got your back. Blobber will find friends for you so you'll have a friend to talk to anywhere, anytime online.

Description

Our group worked on a webapp that would allow people to meetup and chat. A user would register to our service, and then sign-in, and join an exciting room.

  • Used socketio for the chatroom instant messenging
  • Used session-cookies to ensure only login-user have access
  • HTML / CSS with a splash of javascript for front-end design
  • Postgres for our backend database connected via SqlAlchemy ORM to store user registeration data
  • Flask for our web framework
  • Gunicorn to load wsgi webserver
  • Configure Nginx to reverse proxy
  • Created a blobber.tech domain
  • Contained our webapp, nginx and database for security and efficiency in docker
  • Used docker-compose yaml file to configurae docker containers to interact with each other
  • Use cAdvisor, Prometheus and grafana for monitoring container resource usage in real time
  • Created a custom CI/CD pipeline with Github Actions and workflow for testing, linting, webhook notification and deployment
  • Deployed on AWS with domain name, ip blocking and firewalld
  • Use google reCaptcha to help with replay attempts
  • Tried Apache docker image inplace of Nginx when troubleshooting SocketIO
  • Troubleshooting with Systemctl, Journalctl, Docker-compose logs, free and df

Visuals

**updated 8/17/2021 Home Page image

Login image

Dashboard

image

Chatroom

image

AWS Instance from t2.micro -> t2.small image

cAdvisor image

Prometheus image

Grafana Dashboard image

Grafana Dashboard 2 image

Containers image

Discord Webhook image

Google reCaptcha API

Screenshot_2021-09-02_15-19-21

Technologies Used

  • Python-Flask
  • HTML / CSS
  • SocketIO
  • Postgres
  • NGINX
  • cAdvisor
  • Prometheus
  • Docker containers
  • reCaptcha
  • Github Actions (CI/CD)
  • AWS instance
  • Hosted on .tech domain
  • IP blocking, domain name only

Installation

Make sure you have python3 and pip installed

Create and activate virtual environment using virtualenv

$ python -m venv python3-virtualenv
$ source python3-virtualenv/bin/activate

Pre-requisites / requirements

  • Use the package manager pip to install all dependencies
pip install -r requirements.txt
  • NOTE Due to a known issue in SocketIO, the app may only be run in production mode

Usage

Start flask

$ flask run
  • Setup ENV file:
    • create a .env file

    • Include the following information to configure your database and fill in with your information:

      • POSTGRES_USER=
      • POSTGRES_PASSWORD=
      • POSTGRES_HOST=
      • POSTGRES_DB=

Start a web browser and type in localhost:5000, page will render and can be intereact like any other webpage.

Languages

  • HTML 70.6%
  • CSS 13.2%
  • Python 12.6%
  • Shell 3.2%
  • Dockerfile 0.4%