An open API service indexing awesome lists of open source software.

https://github.com/norun9/hybird

Real-Time Chat App with Serverless Architecture
https://github.com/norun9/hybird

clean-architecture lambda serverless websocket

Last synced: about 2 months ago
JSON representation

Real-Time Chat App with Serverless Architecture

Awesome Lists containing this project

README

          

## Backend Development Architecture

[See our "Clean Architecture" for more details](backend/api/doc/README.md)

## AWS Architecture

### REST API


backend

### WebSocket API


websocket

### Frontend


frontend

## Deployment Process

> The following are personal notes

### HashiCorp Terraform Terraform

```bash
export AWS_PROFILE=your_iam_user_name

terraform plan -out=tfplan

terraform apply "tfplan"
```

### Next js Next.js

Run GitHub Actions manually ([ssg_deploy.yml](.github/workflows/ssg_deploy.yml))

## Goose Migration to RDS via Bastion Host

> [!NOTE]
> In the future, we plan to integrate the migration process into the Continuous Deployment (CD) pipeline to automate database updates during deployments.

Follow these steps to perform Goose migration to RDS instance via Bastion host.

#### Step 1: SSH into the Bastion Host
```bash
ssh -i "path/to/your-keypair.pem" ec2-user@
```

#### Step 2: Connect to the RDS Instance
Once logged into the Bastion, use the following command to connect to your RDS instance in the shell.
```bash
mysql -h -u -p
```

#### Step 3: Install Goose

Use the following command to install Goose in the shell.
```bash
# Download the Goose installation script
curl -fsSL https://raw.githubusercontent.com/pressly/goose/master/install.sh -o goose | sh

# Make the Goose binary executable
chmod +x goose

# Move Goose to /usr/local/bin to make it accessible globally
sudo mv goose /usr/local/bin/

# Verify that Goose is installed correctly
goose --version
```

#### Step 4: Transfer Migration Directory to the Home Directory on Bastion

To transfer the migration directory from "your local machine" to the Bastion instance, use the following command.
```bash
# /home/ec2-user/ is the Bastion home directory
scp -r -i "your_keypair.pem" your_migration_files_dir ec2-user@:/home/ec2-user/
```

#### Step 5: Run Goose Migration

After transferring the migration files, run the Goose migration using the following command in the shell.
```bash
goose -dir /path/to/your_migrations_dir mysql ':@tcp(:3306)/?parseTime=true' up
```