### Quick start with docker-compose.example.yml Source: https://github.com/hodyhq/upvora/blob/main/README.md Downloads the example compose file, renames it, and starts the stack. Edit BASE_URL, secrets, and SMTP settings before running. The compose file includes the updater sidecar for one-click updates. ```bash curl -LO https://raw.githubusercontent.com/hodyhq/Upvora/main/docker-compose.example.yml mv docker-compose.example.yml docker-compose.yml # edit BASE_URL, secrets and SMTP, then: docker compose up -d ``` -------------------------------- ### Install Go tools: air, godotenv, golangci-lint Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Install the required Go CLI tools for live reload, environment variable loading, and linting. Run from the repository root to get the golangci-lint version pinned in go.mod, which is what CI uses. ```bash go install github.com/cosmtrek/air ``` ```bash go install github.com/joho/godotenv/cmd/godotenv ``` ```bash go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint ``` -------------------------------- ### Start Upvora in watch mode Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Start both the server and UI in watch mode. The application reloads on every file change. Alternatively, use `make build` and `make run`. ```bash make watch ``` -------------------------------- ### Install client-side packages Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Install the Node.js dependencies for the frontend. ```bash npm install ``` -------------------------------- ### Create local environment configuration Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Copy the example environment file to create a local .env file. The .example.env is already configured to use the fake SMTP server. ```bash cp .example.env .env ``` -------------------------------- ### Start local PostgreSQL and MailHog with Docker Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Start a local PostgreSQL database and a fake SMTP server (MailHog) on Docker. The SMTP server runs on port 1025 and its UI is at http://localhost:8025. ```bash docker compose up -d ``` -------------------------------- ### Build and Run Commands Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Use make build to compile the project and make run to start the server after adding a new locale. ```bash make build ``` ```bash make run ``` -------------------------------- ### Hand-rolled docker-compose.yml without updater Source: https://github.com/hodyhq/upvora/blob/main/README.md Manual compose file with Postgres and the Upvora app, without the updater sidecar. Requires setting BASE_URL, DATABASE_URL, JWT_SECRET, and SMTP environment variables. The app serves on port 3000 and migrations run on start. ```yaml # docker-compose.yml services: db: image: postgres:17 environment: POSTGRES_USER: upvora POSTGRES_PASSWORD: change-me POSTGRES_DB: upvora volumes: [db-data:/var/lib/postgresql/data] app: image: ghcr.io/hodyhq/upvora:latest # or pin a release tag, e.g. :v0.38.2.7.1 depends_on: [db] ports: ["3000:3000"] environment: BASE_URL: https://feedback.yourdomain.com DATABASE_URL: postgres://upvora:change-me@db:5432/upvora?sslmode=disable JWT_SECRET: generate-a-long-random-secret EMAIL_NOREPLY: noreply@yourdomain.com EMAIL_SMTP_HOST: smtp.yourprovider.com EMAIL_SMTP_PORT: "587" EMAIL_SMTP_USERNAME: your-smtp-user EMAIL_SMTP_PASSWORD: your-smtp-password EMAIL_SMTP_ENABLE_STARTTLS: "true" volumes: db-data: ``` -------------------------------- ### Makefile development commands (make watch, make lint, make test) Source: https://github.com/hodyhq/upvora/blob/main/README.md Run the hot-reload server and UI with `make watch`, lint with `make lint`, and run server and UI unit tests with `make test`. Requires Node 22, Go 1.25, and Docker for Postgres. ```bash make watch # hot-reload server + UI make lint # golangci-lint + eslint make test # server + UI unit tests ``` -------------------------------- ### Run unit tests Source: https://github.com/hodyhq/upvora/blob/main/CONTRIBUTING.md Run both UI and Server unit tests. ```bash make test ``` -------------------------------- ### Run dbEntities unit tests Source: https://github.com/hodyhq/upvora/blob/main/app/services/sqlstore/dbEntities/README.md Command to run unit tests for the dbEntities package using godotenv to load the .test.env file. Tests cover the exported User type. ```bash godotenv -f .test.env go test ./app/services/sqlstore/dbEntities/... ``` -------------------------------- ### Using exported User type with dbEntities Source: https://github.com/hodyhq/upvora/blob/main/app/services/sqlstore/dbEntities/README.md Shows how to import the dbEntities package and use the exported User type to query a user and convert it to an entity.User via ToModel. The User type is exported for cross-package use, while other types remain unexported. ```go import "github.com/getfider/fider/app/services/sqlstore/dbEntities" var user dbEntities.User err := trx.Get(&user, "SELECT id, name, email... FROM users WHERE id = $1", userID) if err != nil { return err } // Convert to entity.User entityUser := user.ToModel(ctx) ``` -------------------------------- ### Add Locale to AllLocales Slice Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Append the new locale constant to the AllLocales slice in locale.go to register it with the backend. ```go AllLocales = []Locale{ LocaleEnglish, LocalePortugueseBR, // ... other locales LocaleKorean, // Add your new locale here } ``` -------------------------------- ### Add Locale Constant in locale.go Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Define a new locale constant in app/models/enum/locale.go with fields for code, display name, pluralization culture code, PostgreSQL text search config, lingua-go language enum, and RTL flag. Use 'simple' for PostgresConfig if PostgreSQL lacks native support for the language. ```go LocaleKorean = Locale{ Code: "ko", // Locale code Name: "Korean", // Display name MessageFormatCode: "ko", // Pluralization library culture code PostgresConfig: "simple", // PostgreSQL text search config LinguaLanguage: lingua.Korean, // Lingua-go language enum IsRTL: false, // Right-to-left text direction } ``` -------------------------------- ### Add Locale to lingui.config.js locales Array Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Add the locale code to the locales array in lingui.config.js to enable LinguiJS compilation for the new language. ```javascript locales: ["pt-BR", "es-ES", "nl", /* ... other locales, */ "ko"], ``` -------------------------------- ### Add Locale to locales Object in locales.ts Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Add the new locale entry to the locales object in locale/locales.ts for frontend language selector support. ```typescript const locales: { [key: string]: Locale } = { en: { text: "English", }, // ... other locales ko: { text: "Korean", }, } ``` -------------------------------- ### Add Locale to messages Object in ssr.tsx Source: https://github.com/hodyhq/upvora/blob/main/locale/README.md Add the locale to the messages object in public/ssr.tsx to load client translations for server-side rendering. ```typescript const messages: { [key: string]: any } = { en: require(`../locale/en/client`), // ... other locales ko: require(`../locale/ko/client`), } ```