Skip to content

Latest commit

 

History

History
67 lines (55 loc) · 1.39 KB

CMD.md

File metadata and controls

67 lines (55 loc) · 1.39 KB

Server

Create a new project

pnpm init

Install dependencies

pnpm add fastify fastify-socket.io ioredis close-with-grace dotenv socket.io @fastify/cors

Install dev dependencies

pnpm add @types/node tsx typescript @types/ws -D

Create tsconfig.json

pnpm tsc --init

UI

Create Next.js app

pnpm create next-app ui

Install dependencies

pnpm add socket.io-client

Install dev dependencies

pnpm add @types/ws -D

Install shadcn-ui

npx shadcn-ui@latest init

Add components

npx shadcn-ui@latest add textarea button form

Deploy steps

Create the server

  1. Generate some keys https://www.wpoven.com/tools/create-ssh-key#
  2. Create a DO droplet

Configure the server

  1. SSH intro droplet
  2. Update the package repository metadata - sudo apt update
  3. Add the NodeJS package - curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
  4. Install Node.js sudo apt-get install nodejs
  5. Install docker compose - sudo apt install docker-compose
  6. Install NodeJS (so we can build the UI) - sudo apt install nodejs npm
  7. Install pnpm - wget -qO- https://get.pnpm.io/install.sh | sh -
  8. source /root/.bashrc
  9. If you're using a private repo get a GitHub PAT
  10. Clone the repo - git clone https://<PAT>@<repo>

Start deploying

  1. Configure the GH action