Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Production default is https://api.kaffepos.my.id when this value is empty.
# Set this only when you want to override that behavior.
VITE_API_BASE_URL=
VITE_INSFORGE_URL=https://6x4q2bgn.ap-southeast.insforge.app
VITE_INSFORGE_URL=https://849uckhn.ap-southeast.insforge.app
VITE_INSFORGE_ANON_KEY=

# ── App Config ────────────────────────────────────────────────────
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This project uses [InsForge](https://insforge.dev): an all-in-one, open-source Postgres-based backend (BaaS) that gives this app a database, authentication, file storage, edge functions, realtime, an AI model gateway, and payments through one platform.

- **Project:** **kaffepos-v2** (API base `https://6x4q2bgn.ap-southeast.insforge.app`)
- **Project:** **Kaffe POS** (API base `https://849uckhn.ap-southeast.insforge.app`)
- **Skills:** these InsForge skills are installed for supported coding agents. Reach for them before implementing any InsForge feature instead of guessing the API:
- `insforge`: app code with the `@insforge/sdk` client (database CRUD, auth, storage, edge functions, realtime, AI, email, and Stripe payments).
- `insforge-cli`: backend and infrastructure via the `insforge` CLI (projects, SQL, migrations, RLS policies, storage buckets, functions, secrets, payment setup, schedules, deploys).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ The repair command reads ignored local staging env files, requires `STAGING_PROF
- **Session Management:** Custom (SHA-256 token hashing)

### Infrastructure & Cloud Services
- **Cloud Backend & Database:** InsForge Cloud PostgreSQL (`6x4q2bgn.ap-southeast.insforge.app`, 46 tables with full RLS + 160+ indexes) & InsForge Edge Functions (`@insforge/sdk`)
- **Cloud Backend & Database:** InsForge Cloud PostgreSQL (`849uckhn.ap-southeast.insforge.app`, 46 tables with full RLS + 160+ indexes) & InsForge Edge Functions (`@insforge/sdk`)
- **Payment Gateway:** Mayar Headless API v2 (`https://api.mayar.id/hl/v2` production / `https://api.mayar.io/hl/v2` sandbox)
- **CDN & Storage:** Cloudflare CDN & R2 / InsForge Storage
- **Transactional Email:** Resend
Expand Down
8 changes: 4 additions & 4 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ CLOUDFLARE_IMAGES_ACCOUNT_HASH=
CLOUDFLARE_IMAGES_DELIVERY_URL=

# InsForge Cloud & PostgreSQL Database (prefer DATABASE_URL in staging/production).
INSFORGE_PROJECT_ID=0246a183-d8b0-4de6-8d41-9240e2380d50
INSFORGE_URL=https://6x4q2bgn.ap-southeast.insforge.app
INSFORGE_PROJECT_ID=9be3a9b0-568c-4a0c-bd32-f655dcfcdc79
INSFORGE_URL=https://849uckhn.ap-southeast.insforge.app
INSFORGE_ANON_KEY=
INSFORGE_API_KEY=
DATABASE_URL=postgresql://postgres:replace-me@6x4q2bgn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require
DB_HOST=6x4q2bgn.ap-southeast.database.insforge.app
DATABASE_URL=postgresql://postgres:replace-me@849uckhn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require
DB_HOST=849uckhn.ap-southeast.database.insforge.app
DB_PORT=5432
DB_NAME=insforge
DB_USER=postgres
Expand Down
2 changes: 1 addition & 1 deletion backend/src/core/db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('database SSL config', () => {
DB_SSL: 'false',
DB_SSL_REJECT_UNAUTHORIZED: 'true',
DB_SSL_CA: undefined,
DATABASE_URL: 'postgresql://postgres:secret@6x4q2bgn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require',
DATABASE_URL: 'postgresql://postgres:secret@849uckhn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require',
})).toMatchObject({ rejectUnauthorized: true });
});
});
2 changes: 1 addition & 1 deletion backend/src/core/insforge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('InsForge backend integration helpers', () => {
it('identifies InsForge managed PostgreSQL hostnames', () => {
expect(
isInsforgeDatabaseTarget(
'postgresql://postgres:secret@6x4q2bgn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require',
'postgresql://postgres:secret@849uckhn.ap-southeast.database.insforge.app:5432/insforge?sslmode=require',
),
).toBe(true);
expect(isInsforgeDatabaseTarget('postgresql://kaffepos:secret@localhost:5432/kaffepos')).toBe(
Expand Down
4 changes: 2 additions & 2 deletions backend/src/core/insforge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { createAdminClient, createClient } from '@insforge/sdk';
import { env } from './env';
import { isManagedTlsDatabaseUrl } from './db';

export const INSFORGE_DEFAULT_PROJECT_ID = '0246a183-d8b0-4de6-8d41-9240e2380d50';
export const INSFORGE_DEFAULT_HOST = 'https://6x4q2bgn.ap-southeast.insforge.app';
export const INSFORGE_DEFAULT_PROJECT_ID = '9be3a9b0-568c-4a0c-bd32-f655dcfcdc79';
export const INSFORGE_DEFAULT_HOST = 'https://849uckhn.ap-southeast.insforge.app';

export function isInsforgeDatabaseTarget(databaseUrl = env.DATABASE_URL): boolean {
if (!databaseUrl) return false;
Expand Down
6 changes: 3 additions & 3 deletions insforge.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[project]
id = "0246a183-d8b0-4de6-8d41-9240e2380d50"
name = "kaffepos-v2"
id = "9be3a9b0-568c-4a0c-bd32-f655dcfcdc79"
name = "Kaffe POS"
region = "ap-southeast"
host = "https://6x4q2bgn.ap-southeast.insforge.app"
host = "https://849uckhn.ap-southeast.insforge.app"

[database]
migrations_directory = "migrations"
Expand Down
2 changes: 1 addition & 1 deletion insforge/functions/kaffepos-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default async function (req: Request): Promise<Response> {
}

const startedAt = Date.now();
const baseUrl = Deno.env.get('INSFORGE_URL') || 'https://6x4q2bgn.ap-southeast.insforge.app';
const baseUrl = Deno.env.get('INSFORGE_URL') || 'https://849uckhn.ap-southeast.insforge.app';
const anonKey = Deno.env.get('INSFORGE_ANON_KEY') || Deno.env.get('ANON_KEY') || '';

try {
Expand Down
2 changes: 1 addition & 1 deletion scripts/smoke-insforge-backend.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const insforgeUrl =
process.env.INSFORGE_URL ||
backendEnv.INSFORGE_URL ||
rootEnv.VITE_INSFORGE_URL ||
'https://6x4q2bgn.ap-southeast.insforge.app';
'https://849uckhn.ap-southeast.insforge.app';
const insforgeAnonKey =
process.env.INSFORGE_ANON_KEY ||
backendEnv.INSFORGE_ANON_KEY ||
Expand Down
2 changes: 1 addition & 1 deletion src/lib/insforge.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createClient } from '@insforge/sdk';

export const INSFORGE_DEFAULT_HOST = 'https://6x4q2bgn.ap-southeast.insforge.app';
export const INSFORGE_DEFAULT_HOST = 'https://849uckhn.ap-southeast.insforge.app';

const rawBaseUrl = (import.meta.env.VITE_INSFORGE_URL as string | undefined)?.trim();
const rawAnonKey = (import.meta.env.VITE_INSFORGE_ANON_KEY as string | undefined)?.trim();
Expand Down
Loading