* Fix workflow triggers to use 'main' branch instead of 'master' * Switch to semantic version tags for GitHub Actions instead of SHAs for better maintainability * Fix golangci-lint by adding go mod tidy and specifying paths ./... for linting * feat: Restructure workflows following Single Responsibility Principle - Remove old monolithic workflows (ci.yml, ci-cd.yml, cd.yml) - Add focused workflows: lint.yml, test.yml, build.yml, security.yml, docker-build.yml, deploy.yml - Each workflow has a single, clear responsibility - Follow 2025 best practices with semantic versioning, OIDC auth, build attestations - Add comprehensive README.md with workflow documentation - Configure Dependabot for automated dependency updates Workflows now run independently and can be triggered separately for better CI/CD control. * fix: Resolve CI/CD workflow failures and GraphQL integration test issues - Fix Application struct mismatch in application_builder.go - Add global config.Cfg variable and BleveIndexPath field - Regenerate GraphQL code to fix ProcessArgField errors - Add search.InitBleve() call in main.go - Fix all errcheck issues (12 total) in main.go files and test files - Fix staticcheck issues (deprecated handler.NewDefaultServer, tagged switch) - Remove all unused code (50 unused items including mock implementations) - Fix GraphQL 'transport not supported' error in integration tests - Add comprehensive database cleanup for integration tests - Update GraphQL server setup with proper error presenter * feat: Complete backend CI/CD workflow setup - Add comprehensive GitHub Actions workflows for Go backend - Build workflow with binary compilation and attestation - Test workflow with coverage reporting and race detection - Lint workflow with golangci-lint and security scanning - Docker build workflow with multi-architecture support - Deploy workflow for production deployment - Security workflow with vulnerability scanning - All workflows follow Single Responsibility Principle - Use semantic versioning and latest action versions - Enable security features: OIDC auth, attestations, minimal permissions * fix: correct Go build path to ./cmd/api - Fix build workflow to target ./cmd/api instead of ./cmd - The main.go file is located in cmd/api/ subdirectory * fix: correct Dockerfile build path to ./cmd/api - Fix Docker build to target ./cmd/api instead of root directory - The main.go file is located in cmd/api/ subdirectory |
||
|---|---|---|
| .github | ||
| api | ||
| cmd | ||
| content/blog | ||
| deploy | ||
| docs | ||
| internal | ||
| ops | ||
| pkg | ||
| schemas | ||
| test | ||
| .air.toml | ||
| .gitignore | ||
| .tool-versions | ||
| AGENTS.md | ||
| api-binary | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.dev | ||
| go.mod | ||
| go.sum | ||
| gqlgen.yml | ||
| Makefile | ||
| README.md | ||
| refactor.md | ||
| TASKS.md | ||
| tools.go | ||
The Tercul Project
Welcome to Tercul, a modern platform for literary enthusiasts to discover, translate, and discuss works from around the world. This repository contains the backend services, API, and data processing pipelines that power the platform.
Architecture
The Tercul backend is built using a Domain-Driven Design (DDD-lite) approach, emphasizing a clean separation of concerns between domain logic, application services, and infrastructure. Key architectural patterns include:
- Command Query Responsibility Segregation (CQRS): Application logic is separated into Commands (for writing data) and Queries (for reading data). This allows for optimized, scalable, and maintainable services.
- Clean Architecture: Dependencies flow inwards, with inner layers (domain) having no knowledge of outer layers (infrastructure).
- Dependency Injection: Services and repositories are instantiated at the application's entry point (
cmd/api/main.go) and injected as dependencies, promoting loose coupling and testability.
For a more detailed explanation of the architectural vision and ongoing refactoring efforts, please see refactor.md.
Getting Started
Follow these instructions to get the development environment up and running on your local machine.
Prerequisites
- Go: Version 1.25.0 (as specified in
.tool-versions) - Docker & Docker Compose: For running external dependencies like PostgreSQL and Weaviate.
- make: For running common development commands.
- golangci-lint: For running the linter. Install it with:
Ensure your Go binary path (go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest$(go env GOPATH)/bin) is in your shell'sPATH.
Installation
-
Clone the repository:
git clone <repository-url> cd tercul -
Install Go dependencies:
go mod tidy
Configuration
The application is configured using environment variables. A local docker-compose.yml file is provided to run the necessary services (PostgreSQL, Weaviate, etc.) with default development settings.
The application will automatically connect to these services. For a full list of configurable variables and their default values, see internal/platform/config/config.go.
Running the Application
-
Start external services:
docker-compose up -d -
Run the API server:
go run cmd/api/main.goThe API server will be available at
http://localhost:8080. The GraphQL playground can be accessed athttp://localhost:8080/playground.
Running Tests
To ensure code quality and correctness, run the full suite of linters and tests:
make lint-test
This command executes the same checks that are run in our Continuous Integration (CI) pipeline.