No description
  • PHP 84.5%
  • Blade 13.3%
  • Dockerfile 0.7%
  • HTML 0.6%
  • Shell 0.5%
  • Other 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Taufiq Ismail abd6740c83
Some checks are pending
Tests / PHP 8.2 (push) Waiting to run
Tests / PHP 8.3 (push) Waiting to run
Tests / PHP 8.4 (push) Waiting to run
Merge branch 'dev-adam' into 'master'
fix(test): stop the suite wiping the working database — and report the activity, not the butiran

See merge request shukry-datakraf/myinfra-opa!37
2026-08-28 04:08:31 +00:00
.github/workflows Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00
app Merge branch 'dev-adam' into 'master' 2026-08-28 04:08:31 +00:00
bootstrap Use /up healthcheck and exempt auth cookies 2026-06-01 23:38:30 +08:00
config chore(opa): remove dead services.kewangan config 2026-07-07 21:36:59 +08:00
database Merge remote-tracking branch 'origin/master' into dev-shukry 2026-08-16 19:26:51 +08:00
docker new local setup 2025-12-11 00:45:45 +08:00
docs/openapi skop aktivit seeder 2025-06-30 15:00:14 +00:00
k8s Add KWGN env var and improve liveness checks 2026-06-24 17:02:32 +08:00
public pdf pelan 2025-09-10 06:07:23 +08:00
resources fix: UAT 23022026 no 18 2026-03-12 22:46:52 +08:00
routes Merge remote-tracking branch 'origin/master' into dev-shukry 2026-08-27 14:56:50 +08:00
storage jenis sistem fix 2026-01-28 14:36:43 +08:00
tests Merge branch 'dev-adam' into 'master' 2026-08-28 04:08:31 +00:00
.dockerignore storage issues 2025-11-25 04:49:24 +08:00
.DS_Store update unit test 2025-11-24 16:34:52 +08:00
.editorconfig Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00
.env.example PLGN update 2026-02-27 04:05:00 +00:00
.env.testing update test setup 2025-12-18 13:28:35 +08:00
.gitattributes Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00
.gitignore Update .gitignore 2026-06-29 15:58:24 +08:00
.gitlab-ci-test.yml update test setup 2025-12-18 13:28:35 +08:00
.gitlab-ci.yml ci(opa): don't fail build on protected :latest tag push denial 2026-06-29 12:43:20 +08:00
.gitmodules remove gitmodule 2025-10-07 16:12:54 +08:00
.styleci.yml Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00
artisan initial register 2025-04-28 04:20:58 +08:00
CHANGELOG.md Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00
composer.json fix: pin config.platform.php to 8.3.31 and re-resolve lock for the runtime 2026-06-19 18:56:03 +08:00
composer.lock fix: pin config.platform.php to 8.3.31 and re-resolve lock for the runtime 2026-06-19 18:56:03 +08:00
docker-compose.prod.local.yml update container name 2025-08-19 16:17:27 +08:00
docker-compose.prod.yml add docker config for opa 2025-11-14 14:11:46 +08:00
docker-compose.yml adjsutments deploy 2026-01-08 21:40:59 +08:00
Dockerfile Merge remote-tracking branch 'origin/master' 2026-06-24 10:59:34 +08:00
Dockerfile.ci update cicd 2025-10-12 21:37:09 +08:00
Dockerfile.local Use /up healthcheck and exempt auth cookies 2026-06-01 23:38:30 +08:00
forgot-password-email-test.html added new logo on forgot password email template 2025-08-12 16:48:50 +08:00
kwgn-seed-2027-tree.php fix(opa): receiveTangguh mutates pelaksanaan skop instead of penyediaan skop 2026-07-18 04:28:35 +08:00
Makefile make file opa 2026-01-08 21:23:37 +08:00
MyInfra.openapi.json fix column naming 2025-06-30 18:50:26 +00:00
OPA-MODULE.md update unit test 2025-11-24 16:34:52 +08:00
OPA-TESTING.md update unit test 2025-11-24 16:34:52 +08:00
package-lock.json added approved and rejected email stuff 2025-08-13 01:48:25 +08:00
package.json added approved and rejected email stuff 2025-08-13 01:48:25 +08:00
Penerimaan.openapi.json penerimaan and ptra ready 2025-06-17 02:45:17 +00:00
phpunit.xml fix(test): stop the suite running against the working database 2026-08-28 00:30:06 +08:00
pint.json update ci 2025-10-12 16:59:26 +08:00
Ptra.openapi.json Add frontend repository as git submodule 2025-06-16 15:15:58 +00:00
README.md Edit README.md 2026-08-18 06:38:06 +00:00
realm-export.json update keycloak 2025-08-19 21:54:28 +08:00
SenaraiPenerimaan.openapi.json penerimaan and ptra ready 2025-06-17 02:45:17 +00:00
servers.json keycloak update 2025-05-06 15:14:12 +08:00
Structure_PTRA.jpeg Create Structure_PTRA.jpeg 2025-06-22 18:33:41 +08:00
test-email-notifications.php DAK Update 2209 2025-09-22 11:10:52 +08:00
test-report.html unit test base complete 2025-10-10 09:11:52 +08:00
vite.config.js Initial Laravel API with Sail and PostgreSQL 2025-04-28 03:14:03 +08:00

🧰 System Requirements

Make sure the following are installed on your machine:

Tool Minimum Version Install Guide
Ubuntu 22.04 LTS Youre good
Docker 20+ https://docs.docker.com/engine/install/ubuntu/
Docker Compose v2+ https://docs.docker.com/compose/install/
Make 4.3+ sudo apt install make
PHP 8.2+ Optional (for artisan commands locally)
Node.js 18+ Install via https://github.com/nvm-sh/nvm
NPM 9+ Comes with Node.js

📦 Clone the Project

Make sure to clone both frontend and backend repositories into the same parent directory:

git clone https://gitlab.com/shukry-datakraf/myinfra-backend.git
git clone https://gitlab.com/shukry-datakraf/myinfra-frontend.git
cd myinfra-backend

⚙️ Initial Setup

  1. Copy .env files
cp .env.example .env
  1. Run full setup (first time only)
make reset

To start containers again later:

make up

To stop containers without removing:

make stop

🧪 Common Makefile Commands

Make sure you're inside the project root folder.

Command Description
make up Start all containers
make stop Stop containers without removing
make down Stop and remove all containers
make restart Rebuild and start containers
make reset Full reset with volume + rebuild
make bash Shell into Laravel backend container
make frontend Shell into Nuxt frontend container
make artisan Run artisan commands (use with cmd=...)
make npm Run npm commands in Laravel (use cmd=...)
make logs Tail all container logs
make frontend-log Tail Nuxt frontend logs
make backend-log Tail Laravel backend logs

💄 Migrate the Database

  1. Enter Laravel container
make bash
  1. Run migrations (example):
make artisan cmd="migrate"

To refresh + seed:

make artisan cmd="migrate:fresh --seed"

🪪 Running the App


🤩 CORS & Sanctum Setup (for Laravel + Nuxt)

Make sure in .env:

SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost:3000

And in config/cors.php:

'paths' => ['api/*', 'sanctum/csrf-cookie'],
'supports_credentials' => true,

🪩 Troubleshooting

⚠️ Keycloak Client Secret Issue

If you see warnings about The "kLpQ" variable is not set or get unauthorized_client errors:

The Keycloak client secret contains a $ character that needs proper escaping:

# WRONG - Single $ is interpreted as variable
KEYCLOAK_CLIENT_SECRET=Z#v7M&2rTx9$kLpQ

# CORRECT - Use $$ to escape the $ character in .env files
KEYCLOAK_CLIENT_SECRET=Z#v7M&2rTx9$$kLpQ

Note: The $$ in .env will be interpreted as a single $ when passed to containers.

After updating .env, restart containers:

make restart

If you still get unauthorized_client errors, the Keycloak client may need to be configured for service accounts:

  1. Access Keycloak Admin: http://localhost:8080 (admin/admin)
  2. Go to MyInfra realm → Clients → laravel-api
  3. Enable "Service accounts roles" under Settings
  4. Save the client configuration

Or run the testing seeder without Keycloak by modifying the seeder to skip Keycloak user creation.

Nuxt: Permission denied

Fix in Dockerfile:

RUN chmod +x node_modules/.bin/nuxt

Or in docker-compose.yml:

command: ["sh", "-c", "chmod +x node_modules/.bin/nuxt && npm run dev"]

🧪 Run Laravel Tests

make bash
php artisan test

OPA MODULE

Create database myinfra_opa

docker compose exec pgsql bash
psql -U postgres
CREATE DATABASE myinfra_opa;

Run Fresh Migration

make bash
php artisan migrate:fresh --database=myinfradb-opa --path=database/migrations/opa

Make Migration

make bash
php artisan make:migration --path=database/migrations/opa ..

Run Migration

make bash
php artisan migrate --database=myinfradb-opa --path=database/migrations/opa

Run Seeder

make bash
php artisan db:seed --class=Database\\Seeders\\Opa\\DatabaseSeeder --database=myinfradb-opa

API Endpoints

All endpoints require authentication.

Variable Used By Format (no /api)
STAGING_PGSN_API_URL PPA, OPA, PPUN http://myinfra-pgsn.url
STAGING_PPA_API_URL OPA, PPUN http://myinfra-ppa.url
BACKEND_PGSN_API_URL Frontend (SSR) http://myinfra-pgsn.url
BACKEND_PPA_API_URL Frontend (SSR) http://myinfra-ppa.url
BACKEND_OPA_API_URL Frontend (SSR) http://myinfra-opa.url
BACKEND_PPUN_API_URL Frontend (SSR) http://myinfra-ppun.url

... ...