Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
"Vue.volar",
"Vue.vscode-typescript-vue-plugin"
],
"features": {
"ghcr.io/devcontainers-contrib/features/pnpm:2": {}
},
// Connect as non-root user (https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user)
"remoteUser": "node"
}
1 change: 1 addition & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ports:
tasks:
- name: Node.js
init: ./scripts/setup.sh
command: nvm install

vscode:
extensions:
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.14.0
12 changes: 8 additions & 4 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# [REQUIREMENTS]
# Need to install: docker, nvm, pnpm

set -ex

BASEDIR=$(dirname $(dirname $(realpath $0)))
Expand Down Expand Up @@ -33,15 +36,16 @@ echo "NODEMAILER_PASS=\"\"" >> backend/.env
# Use docker-compose profile
if [ -z $DEVCONTAINER ]
then
docker-compose up -d
docker compose up -d
fi

jwt_secret=$(echo -n head /dev/urandom | LC_ALL=C tr -dc A-Za-z0-9 | sha256sum)
echo "JWT_SECRET=$jwt_secret" >> backend/.env

# Install pnpm
pnpm --version || sudo corepack enable
corepack prepare pnpm@7.2.1 --activate
# Install Node.js
bash -i -c 'nvm install'

# Install Node.js packages
pnpm install

# Install lefthook for git hook
Expand Down