From e671c107ca273b98b0bd2859e98008ce220772e0 Mon Sep 17 00:00:00 2001 From: pius-coder Date: Wed, 15 Apr 2026 23:27:26 +0100 Subject: [PATCH] feat: initial ImportEx API setup with Hono + Drizzle + PostgreSQL - Hono server with CORS and logging middleware - Drizzle ORM with PostgreSQL schema (users table) - Environment config with Zod validation - Dockerfile for production deployment - Gitea Actions workflows for dev/main deployment to Coolify - Health check route --- .gitea/workflows/deploy-dev.yml | 17 +++ .gitea/workflows/deploy-prod.yml | 17 +++ .gitignore | 38 ++++++ CLAUDE.md | 44 ++++++ Dockerfile | 22 +++ bun.lock | 223 +++++++++++++++++++++++++++++++ drizzle.config.ts | 11 ++ package.json | 27 ++++ src/config/env.ts | 11 ++ src/db/index.ts | 7 + src/db/schema/index.ts | 1 + src/db/schema/users.ts | 10 ++ src/index.ts | 22 +++ src/routes/health.ts | 7 + src/server.ts | 10 ++ tsconfig.json | 24 ++++ 16 files changed, 491 insertions(+) create mode 100644 .gitea/workflows/deploy-dev.yml create mode 100644 .gitea/workflows/deploy-prod.yml create mode 100644 .gitignore create mode 100644 CLAUDE.md create mode 100644 Dockerfile create mode 100644 bun.lock create mode 100644 drizzle.config.ts create mode 100644 package.json create mode 100644 src/config/env.ts create mode 100644 src/db/index.ts create mode 100644 src/db/schema/index.ts create mode 100644 src/db/schema/users.ts create mode 100644 src/index.ts create mode 100644 src/routes/health.ts create mode 100644 src/server.ts create mode 100644 tsconfig.json diff --git a/.gitea/workflows/deploy-dev.yml b/.gitea/workflows/deploy-dev.yml new file mode 100644 index 0000000..a28923f --- /dev/null +++ b/.gitea/workflows/deploy-dev.yml @@ -0,0 +1,17 @@ +name: Deploy to Development + +on: + push: + branches: + - dev + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Coolify Deploy (Dev) + run: | + curl --request GET \ + --url "${{ secrets.COOLIFY_WEBHOOK_DEV }}" \ + --header "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \ + --fail \ No newline at end of file diff --git a/.gitea/workflows/deploy-prod.yml b/.gitea/workflows/deploy-prod.yml new file mode 100644 index 0000000..5b5cea3 --- /dev/null +++ b/.gitea/workflows/deploy-prod.yml @@ -0,0 +1,17 @@ +name: Deploy to Production + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Trigger Coolify Deploy (Prod) + run: | + curl --request GET \ + --url "${{ secrets.COOLIFY_WEBHOOK_PROD }}" \ + --header "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \ + --fail \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39de971 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +# dependencies (bun install) +node_modules + +# output +out +dist +*.tgz + +# code coverage +coverage +*.lcov + +# logs +logs +_.log +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json + +# dotenv environment variable files +.env +.env.* +.env.development.local +.env.test.local +.env.production.local +.env.local + +# drizzle +drizzle/meta/ + +# caches +.eslintcache +.cache +*.tsbuildinfo + +# IntelliJ based IDEs +.idea + +# Finder (MacOS) folder config +.DS_Store diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..d0183df --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,44 @@ +Default to using Bun instead of Node.js. + +- Use `bun ` instead of `node ` or `ts-node ` +- Use `bun test` instead of `jest` or `vitest` +- Use `bun build ` instead of `webpack` or `esbuild` +- Use `bun install` instead of `npm install` or `yarn install` or `pnpm install` +- Use `bun run