Skip to content

ahmadhabibi14/chat-app

Repository files navigation

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