A monorepo of microservices-based backend system for PenK Assistant.
- Air - For live reload
- Make - For running commands
- MongoDB Database Tools - For database operations
- Protocol Buffer Compiler - For compiling Protocol Buffer files
- Go Protocol Buffer Plugin - For generating Go code from Protocol Buffers
- golangci-lint - For Go code linting
- protolint - For Protocol Buffer linting
- Install the
Goextension - Install
gofumpt:go install mvdan.cc/gofumpt@latest
- Configure VSCode settings (Ctrl/Cmd + Shift + P → "Preferences: Open User Settings (JSON)"):
{ "go.useLanguageServer": true, "gopls": { "formatting.gofumpt": true } }
# Install golang dependencies of all modules
make tidy
# Install node modules
cd services/gateway
npm install- Create
.env.developmentfile at the root level of the project - Copy
.env.exampleto.env.developmentand fill in secrets - Prepare some credential files of Firebase and OpenAI
- Run microsevices and gateway
Using migrate-mongo:
# Install migrate-mongo
npm i -g migrate-mongo
# Migration commands
migrate-mongo up
migrate-mongo down
migrate-mongo status# Backup entire database
make dump
# Restore entire database
make restore
# Restore specific collection
make restore-col COL=<collection-name># Run a specific service
make core
# Run microservices (Test DB)
make test SERVICE="core analytic timetracking notification penk payment"
# Run microservices (Dev DB)
make dev SERVICE="core analytic timetracking notification penk payment"
# Run gateway
make gateway
# Run unit tests
make unit-test
# Run API tests
make api-test# Code linting check and fix
make lint
make lint-fix
# Protocol Buffer linting check and fix
make protolint
make protolint-fix# Build and start containers
make up
# Stop containers
make down
# Stop containers and remove images
make down-rmi
# Clean up unused resources
make clean
# View container logs
make logs