Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.29 KB

README.md

File metadata and controls

73 lines (52 loc) · 2.29 KB

Chat App

Table of Contents

  1. About
  2. Demo
  3. Get Started

About

This is a relatively simple chat application created using Spring Boot in the backend and React/TypeScript in the frontend. It uses StompJS and SockJS (WebSocket) for real-time communication between users and MariaDB to persist data. Users can create an account via OAuth 2.0, create custom group chats, and send messages. This project takes some inspiration from older versions of Discord.

Link: https://chat.jasonpyau.com

This website is hosted on my Raspberry Pi, using Cloudflare's free tunneling services for SSL certificate and DDoS protection and GitHub Actions for continuous deployment on Git push.

Demo

image


Get Started

(Ubuntu)

All you need to do to get the app running is run the Spring Boot project; it automatically bundles up the React scripts via Webpack.

Create secrets.properties (./backend/src/main/resources/secrets.properties) - secrets.properties.sample

MARIADB_SERVER_URL=YOUR_MARIADB_SERVER_URL_HERE
MARIADB_DATABASE_NAME=YOUR_MARIADB_DATABASE_NAME_HERE
MARIADB_USERNAME=YOUR_MARIADB_USERNAME_HERE
MARIADB_PASSWORD=YOUR_MARIADB_PASSWORD_HERE

OAUTH_GOOGLE_CLIENT_ID=YOUR_OAUTH_GOOGLE_CLIENT_ID_HERE
OAUTH_GOOGLE_CLIENT_SECRET=YOUR_OAUTH_GOOGLE_CLIENT_SECRET_HERE
OAUTH_GITHUB_CLIENT_ID=YOUR_OAUTH_GITHUB_CLIENT_ID_HERE
OAUTH_GITHUB_CLIENT_SECRET=YOUR_OAUTH_GITHUB_CLIENT_SECRET_HERE
OAUTH_DISCORD_CLIENT_ID=YOUR_OAUTH_DISCORD_CLIENT_SECRET_HERE
OAUTH_DISCORD_CLIENT_SECRET=YOUR_OAUTH_DISCORD_CLIENT_SECRET_HERE

AWS_ACCESS_KEY_ID=YOUR_AWS_ACCESS_KEY_ID_HERE
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE
AWS_ENDPOINT=YOUR_AWS_ENDPOINT_HERE
AWS_BUCKET=YOUR_AWS_BUCKET_HERE
AWS_PUBLIC_BUCKET_URL=YOUR_AWS_PUBLIC_BUCKET_URL_HERE

Run Spring Boot Project

sudo apt update

sudo apt install openjdk-17-jdk

cd ./backend

sudo bash ./mvnw spring-boot:run

Update Webpack bundle on save

cd ./frontend

npm run watch