ahmadhabibi14 / chat-app

A chat app

Home Page:https://vftalk.my.id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VFtalk - Chat App

Tech stack:

How to start development:

##### Install dependencies
go mod tidy

cd views/pages
pnpm install

##### Set up docker
docker-compose up -d
docker network create vftalk-network

##### Start App
go run main.go web
# or
air web

##### Start nodejs for build javascript or css stuff
cd views/pages
pnpm watch

MariaDB

##### Login to MariaDB CLI
docker exec -it vftalk-db mariadb -u root -p

##### Database migration
### Install golang-migrate
go install -tags "postgres,mysql" github.com/golang-migrate/migrate/v4/cmd/migrate@latest

### Create Migration
migrate create -ext sql -dir database/migration migration_state
## or
make migrate state=migration_state

### Run migration
make migrate-up
make migrate-down
## or
go run main.go migrate-up
go run main.go migrate-down

Docker

# Remove all containers
docker rm -f $(docker ps -aq)

# Remove containers
docker-compose down

Deploy

cd deploy
##### Execute deploy script, it will automatically do their magic
./deploy.sh

#### or
## Configure github action script for CI/CD
## add github secrets, make sure which variable to store as defined at .github/workflows/deploy.yaml

TODO:

  • User edit progile
  • Limit online users to only 20
  • Login handler
  • API rate limit
  • Login page
  • Fix layout to not overflow
  • Responsive to mobile device
  • Turn to Progressive Web App (PWA)
  • Add Database to store user data
  • Add Database to store chats
  • User Info
  • Add Tenor API for stickers and GIFs
  • Upload picture in chats, and stickers from Tenor API
  • Use mailhog for SMTP in development, add to docker
  • Deploy to server (must use linux)
  • Add MariaDB to docker-compose
  • Use docker-mailserver for SMTP in production
  • User can edit profile picture
  • Image editor when update profile picture, specify for 1:1 ratio
  • Compress image after user uploaded it
  • Direct message
  • Notification (server sent event)
  • Active user list (for direct message)
  • Database migration
  • Add column for Google ID (OAuth) in MySQL

About

A chat app

https://vftalk.my.id

License:MIT License


Languages

Language:Go 55.2%Language:Svelte 23.0%Language:Astro 14.5%Language:TypeScript 2.2%Language:Shell 2.0%Language:JavaScript 1.8%Language:Makefile 0.6%Language:CSS 0.4%Language:Dockerfile 0.2%