Skip to content

PenK Assistant is an AI-powered productivity copilot that helps manage habits, tasks, schedules and more in one place saving time, reducing stress, and boosting personal productivity.

Notifications You must be signed in to change notification settings

Fbin243/penk-backend

Repository files navigation

PenK Logo PenK Backend

A monorepo of microservices-based backend system for PenK Assistant.

PenK Architecture

Table of Contents

Prerequisites

Dev Tools

VSCode Setup

  1. Install the Go extension
  2. Install gofumpt:
    go install mvdan.cc/gofumpt@latest
  3. Configure VSCode settings (Ctrl/Cmd + Shift + P → "Preferences: Open User Settings (JSON)"):
    {
      "go.useLanguageServer": true,
      "gopls": {
        "formatting.gofumpt": true
      }
    }

Install dependencies

# Install golang dependencies of all modules 
make tidy

# Install node modules
cd services/gateway
npm install

Getting Started

  1. Create .env.development file at the root level of the project
  2. Copy .env.example to .env.development and fill in secrets
  3. Prepare some credential files of Firebase and OpenAI
  4. Run microsevices and gateway

Database Management

MongoDB Migrations

Using migrate-mongo:

# Install migrate-mongo
npm i -g migrate-mongo

# Migration commands
migrate-mongo up
migrate-mongo down
migrate-mongo status

MongoDB Tools

# Backup entire database
make dump

# Restore entire database
make restore

# Restore specific collection
make restore-col COL=<collection-name>

Running microservices

# 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

Linters

# Code linting check and fix
make lint
make lint-fix

# Protocol Buffer linting check and fix
make protolint
make protolint-fix

Docker

# 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

About

PenK Assistant is an AI-powered productivity copilot that helps manage habits, tasks, schedules and more in one place saving time, reducing stress, and boosting personal productivity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published