Welcome to the Gazeta CNVA project! This repository contains the source code for the official Gazeta CNVA digital platform, a modern content delivery system built with a Go backend and a SvelteKit frontend.
| Form for Poems | Poem in Google Docs | Poem on Website |
|---|---|---|
![]() |
![]() |
![]() |
| Desktop Homepage | Mobile Homepage |
|---|---|
![]() |
![]() |
| Desktop Publications |
|---|
![]() |
The project is a monorepo composed of two main services:
-
worker/(Backend API): A Go application responsible for:- Periodically fetching new article submissions from a Google Form.
- Downloading associated media (thumbnails, document content) from Google Drive and Google Docs.
- Processing and caching this data.
- Serving the content via a RESTful API.
-
app/(Frontend): A SvelteKit application that provides the user interface for reading articles. It consumes the data exposed by the Go backend.
Both applications are designed to be containerized with Docker and are deployed automatically via GitHub Actions.
To work with this project, you will need the following installed:
- Go (for the backend)
- Node.js (for the frontend)
- Docker (for building and running containers)
The deployment process relies on a self-hosted GitHub Actions runner tagged gazeta.
This project requires several secrets and configuration values to run. Do not hardcode these values in the source code. Use environment variables for local development and GitHub Secrets for deployment.
The backend needs a Google Cloud Platform (GCP) Service Account to access Google Forms, Drive, and Docs.
- Create a Service Account in your GCP project.
- Enable the Google Drive API, Google Docs API, and Google Forms API for your project.
- Grant the Service Account the necessary IAM roles (e.g.,
ViewerorEditor) to access these services. - Create a JSON key for the Service Account and download it.
- Share your Google Form, Google Drive folder(s), and any relevant Google Docs with the Service Account's email address (the
client_emailfrom the JSON key).
The following values from the JSON key and your setup are required.
You must set these environment variables for the Go worker to run.
GCP_PRIVATE_KEY: The entire private key string from the JSON file, including-----BEGIN PRIVATE KEY-----and-----END PRIVATE KEY-----.GCP_PRIVATE_KEY_ID: Theprivate_key_idfrom the JSON file.GCP_SERVICE_ACCOUNT_EMAIL: Theclient_emailfrom the JSON file.GCP_FORM_ID: The ID of the Google Form used for submissions.API_URL: The public base URL of the API (e.g.,https://api.gazetacnva.ro/). This is used to construct correct thumbnail URLs.
The following secrets must be configured in your GitHub repository settings (Settings > Secrets and variables > Actions) for the deployment workflows to succeed.
DOCKER_USERNAME: Your Docker Hub username.DOCKER_PASSWORD: Your Docker Hub password or an access token.GH_TOKEN: A GitHub Personal Access Token withread:packagesscope. This is used during the Docker build to authenticate and download private Go modules.GH_USERNAME: The GitHub username associated with theGH_TOKEN.
- Navigate to the
workerdirectory:cd worker - Set the required environment variables (see Configuration).
- Run the application:
go run . - The API will be available on
http://localhost:8080.
- Navigate to the
appdirectory:cd app - Install dependencies:
npm install - Start the development server:
npm run dev - The application will be available on
http://localhost:5173.
Deployment is handled automatically by the GitHub Actions workflows defined in .github/workflows/.
build-gazeta-api.yml: Triggers on pushes to theworker/directory. It builds the Go application, pushes a Docker image to Docker Hub, and then deploys it on thegazetaself-hosted runner.build-gazeta-app.yml: Triggers on pushes to theapp/directory. It builds the SvelteKit application, pushes a Docker image to Docker Hub, and deploys it on thegazetaself-hosted runner.
The deployment steps on the runner involve:
- Stopping the old container.
- Removing the old container and image to save space.
- Starting a new container with the latest image from Docker Hub.





