- Production API: https://api.be-healthy.life/docs
- Development API: https://api.dev.be-healthy.life/docs
- ์ด์ค์ | @adrinerDP
- ์์ฑ์ฑ | @puleugo
- Node.js 16 (with Yarn)
- PostgreSQL 14
- Nest.js 9
Copy example environment variables.
$ cp .env.example .env
Change values below accordingly.
# Application
APP_URL=http://localhost:3000
APP_PORT=3000
APP_SECRET=xxxxxxxxxx
# Database
DB_HOST=k8s.adrinerdp.co
DB_PORT=5432
DB_DATABASE=xxxxxxxxxx
DB_USERNAME=xxxxxxxxxx
DB_PASSWORD=xxxxxxxxxx
This project uses yarn as a package manager.
$ yarn
You can start development server with this command.
$ yarn start:dev
The migrations will run automatically when the server is started. When it doesn't work, you can migrate manually with this command.
$ yarn migration:run
$ yarn migration:generate src/migrations/{migration_name}
create_users_table
add_social_vendor_id_to_users_table
drop_password_from_users_table
This project uses Github Actions to do CI/CD.
- KUBE_CONFIG: Kubernetes Configurations to use cluster's API.
- HARBOR_USERNAME: Docker Registry username.
- HARBOR_ACCESS_TOKEN: Docker Registry password.
- DISCORD_WEBHOOK: Discord Webhook endpoint to send deployment logs.
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
target: production
push: true
platforms:
linux/amd64
tags: harbor.adrinerdp.co/healthin/api:latest, harbor.adrinerdp.co/healthin/api:${{ steps.version.outputs.code }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to cluster
uses: actions-hub/kubectl@master
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: set image deployment healthin-api healthin-api=harbor.adrinerdp.co/healthin/api:${{ steps.version.outputs.code }}