GoGovMY - Malaysia's open-source link management infrastructure.
Learn more »
Introduction ·
Features ·
Tech Stack ·
Pre-Requisites ·
Setup Local Environment Variables ·
Working Directories
Infrastructure & Application Architecture
Local Development
Contributing
License
GoGovMY - Malaysia's open-source link management infrastructure.
Welcome to the official repository for GoGovMY, a comprehensive monorepo project meticulously crafted to enhance the development, management, and deployment of a suite of projects that power Malaysian government secure link shortener and analytics platform build by GovTech Malaysia.
There are multiple reasons why we built an official government link shortener:
- URLs are too long to fit into tweets or SMSes, and difficult to remember
- Email clients might block other commercial link shorteners if they are listed as spam on their site
- Citizens are afraid of phishing when receiving a shortened link and unsure of where it goes
With GoGovMY, citizens are safe in the knowledge that the links are official and safe. Any authorized user can log in with their government emails and immediately create authenticated and recognisable short links.
- Next.js – framework
- TypeScript – language
- Tailwind – CSS
- Self-Host Redis – redis
- PostgresSQL – database
- NextAuth.js – auth
- Turborepo – monorepo
- Amazon Simple Email Services – emails
- AWS K8S – deployments
- GoLang – Redirect Server
- Debezium – Database Event Trigger
- Kafka – Event Streaming
- ElasticSearch – Indexing & Analytics
- ZooKeeper – Dependency Management
- KafDrop – Kafka UI Management
- Debezium-UI – Debzium UI Management
- Uptime-Kuma – Status Page
Please create a .env (using as .env.example as example) file in the root directory and add the following environment variables:
###############################
###### REQUIRED ENV VARS ######
###############################
NEXT_PUBLIC_APP_NAME=GoGovMy
NEXT_PUBLIC_APP_DOMAIN=gogovmy
NEXT_PUBLIC_APP_SHORT_DOMAIN=app.go.gov.my
NEXT_PUBLIC_APP_APP_DOMAIN=locahost:8888
NODE_ENV=development
# This is for Unit Test in the apps/web/tests folder
E2E_BASE_URL=http://localhost:8888
E2E_TOKEN=
E2E_USER_ID=
E2E_WORKSPACE_ID=
E2E_WORKSPACE_SLUG=
E2E_WORKSPACE_NAME=
REDIS_URL="redis://localhost:6379"
REDIS_PORT=6379
POSTGRESHOST=localhost
POSTGRESDB=gogov-local
POSTGRESUSER=postgres
POSTGRESPASSWORD=postgres
POSTGRESPORT=5432
DATABASE_URL="postgresql://${POSTGRESUSER}:${POSTGRESPASSWORD}@localhost:${POSTGRESPORT}/${POSTGRESDB}?schema=public"
DIRECT_URL="postgresql://${POSTGRESUSER}:${POSTGRESPASSWORD}@localhost:${POSTGRESPORT}/${POSTGRESDB}?schema=public"
# Generate a random secret here: https://generate-secret.vercel.app/32
NEXTAUTH_SECRET=
NEXTAUTH_URL=http://localhost:8888 # (only needed for localhost)
# AWS SES - Simple Email Services for OTP
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_REGION=ap-southeast-2
SES_EMAIL_SOURCE=
## Replae this value with environment base url
BASE_URL=http://localhost:8888
#Logstash Config
ELASTICSEARCH_HOST=http://elasticsearch:9200
LOGSTASH_STATEMENT=""
###############################
###### OPTIONAL ENV VARS ######
###############################
# Used for Google Login
# Learn how to set this up here: https://next-auth.js.org/providers/google
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# Use for storing image assets
STORAGE_ACCESS_KEY_ID=
STORAGE_SECRET_ACCESS_KEY=
STORAGE_ENDPOINT=
STORAGE_BASE_URL=
# Redirect Services
KAFKA_OUTBOX_TOPIC=outbox-topic
REDIRECT_SERVER_URL=http://localhost:3000
KAFKA_BROKER_URL=localhost:9092
# GoLang ENV
ELASTIC_URL=http://localhost:9200
ELASTIC_USER=elastic
ELASTIC_PASSWORD=
HTTP_PORT=3000
TELEMETRY_URL=jaeger:4318
go-gov-my
|_.github - CI/CD GitHub Actions
|_ apps
|_ docs
|_ web
|_ redirect-server
|_connect-jdbc-es
|_packages
|_tailwind-config
|_tsconfig
|_ui
|_utils
|_.dockerignore
|_.editorconfig
|_.env.example
|_.docker-compose.yml
|_Dockerfile
|_filebeat.yml
|_init-debezium-connector.sh
|_LICENSE.md
|_package.json
|_pnpm-lock.yaml
|_pnpm-workspace.yaml
|_prettier-config.js
|_README.md
|_turbo.json
----- Applications -----
# Application Dashboard: Port 8888
# Administrator Dashbaord: Port 8888 with sub-domain {{admin.localhot:8888}}
# Redirect Server: Port 3000
# Redirect Server API (Internal): Port 3002
# Documentation App: Port 3334
----- Services -----
# Prisma Studio: Port 5555
# Internal Redirect Server API: Port 3002
# ElasticSearch: Port 9200
# Database: Port 5432
# Kafka: Port 9092
# Redis: 6379
# Zookeeper: 2181
# Kafdrop: 9000
# Kafka: 29092
# Debezium: 8083
# Debezium UI: 8080
# Uptime-Kuma: 3001
## Clone the repository
git clone https://github.com/govtechmy/go-gov-my.git
## CD into directories
cd go-gov-my
## Install dependencies
pnpm install
## Start the development server
docker-compose up -d
pnpm dev
We welcome and appreciate contributions from the community. Whether you're fixing a bug, improving documentation, or proposing a new feature, your input helps make this project better for everyone. Here's how you can get involved:
If you encounter a bug, unexpected behavior, or a potential improvement, please don't hesitate to open an issue. When submitting an issue, include as much relevant information as possible—such as steps to reproduce, screenshots, or logs—to help us understand and address the problem efficiently.
To get started with local development, follow our comprehensive local development guide. This guide outlines all necessary dependencies, setup instructions, and development workflows to help you quickly spin up the project on your machine.
Once you're ready to contribute code—whether it’s a bug fix, a quality-of-life enhancement, or a brand-new feature—submit a pull request. Please ensure your changes align with our coding standards and are well-documented. Pull requests should be linked to an open issue (if applicable) and include a clear, descriptive title and summary of changes.
- Follow the existing code style and naming conventions.
- Write clear, concise commit messages.
- Include tests for new or updated functionality where possible.
- Keep pull requests focused and easy to review—smaller, incremental changes are preferred.
Your contributions help shape the future of this project and support our mission to build more accessible and effective public digital services. Thank you for taking the time to make a difference!
GoGovMY is open-source under the GNU Affero General Public License Version 3 (AGPLv3) or any later version. You can find it here.