Compare commits

...

5 Commits

Author SHA1 Message Date
ba9f74afd5 fix build
All checks were successful
Build and Push Docker Image / build (push) Successful in 19s
2026-03-29 14:12:09 -05:00
7528b36c48 Merge branch 'main' of https://git.alwisp.com/jason/pos
Some checks failed
Build and Push Docker Image / build (push) Failing after 15s
2026-03-29 14:09:37 -05:00
84571c3516 fix build 2026-03-29 14:09:10 -05:00
f7f5ac7e3b Delete .github/workflows/ci.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 9s
2026-03-29 14:05:26 -05:00
7c71af2a9f Add .github/workflows/docker-build.yml
Some checks failed
CI / Client — typecheck & build (push) Has been cancelled
CI / Server — typecheck & build (push) Has been cancelled
CI / Docker build (smoke test) (push) Has been cancelled
Build and Push Docker Image / build (push) Failing after 15s
2026-03-29 13:57:52 -05:00
8 changed files with 39 additions and 85 deletions

View File

@@ -8,7 +8,13 @@
"mcp__Claude_Preview__preview_start",
"Bash(curl -s http://localhost:8080/api/v1/users -H \"Authorization: Bearer test\")",
"Bash(curl -s -X POST http://localhost:8080/api/v1/auth/login -H \"Content-Type: application/json\" -d \"{\"\"email\"\":\"\"admin@demo.com\"\",\"\"password\"\":\"\"password123\"\"}\")",
"Bash(curl -s \"http://localhost:8080/api/v1/users\" -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbW16c3JsdXowMDA0dTVqM2JldWwyMnM3IiwidmVuZG9ySWQiOiJkZW1vLXZlbmRvciIsInJvbGVJZCI6ImNtbXpzcmx0ZDAwMDB1NWozdnV6Y2QzZW0iLCJyb2xlTmFtZSI6Im93bmVyIiwiaWF0IjoxNzc0MDY2MjU4LCJleHAiOjE3NzQwNjcxNTh9.eBSLkZVXafSBE-o6A2I626EgBcxxXSKGVu7pv3yQdhU\")"
"Bash(curl -s \"http://localhost:8080/api/v1/users\" -H \"Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbW16c3JsdXowMDA0dTVqM2JldWwyMnM3IiwidmVuZG9ySWQiOiJkZW1vLXZlbmRvciIsInJvbGVJZCI6ImNtbXpzcmx0ZDAwMDB1NWozdnV6Y2QzZW0iLCJyb2xlTmFtZSI6Im93bmVyIiwiaWF0IjoxNzc0MDY2MjU4LCJleHAiOjE3NzQwNjcxNTh9.eBSLkZVXafSBE-o6A2I626EgBcxxXSKGVu7pv3yQdhU\")",
"Bash(DATABASE_URL=\"file:./prisma/dev.db\" npx prisma migrate dev --name add_events_rename_roles)",
"Bash(DATABASE_URL=\"file:./prisma/dev.db\" npx tsx prisma/seed.ts)",
"Bash(git add:*)",
"Bash(git commit:*)",
"Bash(npx tsc:*)",
"Bash(curl -s http://localhost:8080/api/v1/health)"
]
}
}

View File

@@ -1,75 +0,0 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
server:
name: Server — typecheck & build
runs-on: ubuntu-latest
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: server/package-lock.json
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- name: Typecheck
run: npx tsc --noEmit
- name: Build
run: npm run build
client:
name: Client — typecheck & build
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: client/package-lock.json
- name: Install dependencies
run: npm ci
- name: Typecheck
run: npx tsc --noEmit
- name: Build
run: npm run build
docker:
name: Docker build (smoke test)
runs-on: ubuntu-latest
needs: [server, client]
steps:
- uses: actions/checkout@v4
- name: Build image
run: |
docker build \
--build-arg NODE_ENV=production \
-t vendor-pos:ci .

25
.github/workflows/docker-build.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Build and Push Docker Image
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: registry.alwisp.com
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and Push
run: |
docker build -t registry.alwisp.com/${{ gitea.repository_owner }}/${{ gitea.repository }}:latest .
docker push registry.alwisp.com/${{ gitea.repository_owner }}/${{ gitea.repository }}:latest

View File

@@ -33,6 +33,7 @@ export function Btn({
children,
variant = "primary",
type = "button",
size,
disabled,
onClick,
style,
@@ -40,6 +41,7 @@ export function Btn({
children: React.ReactNode;
variant?: "primary" | "danger" | "ghost";
type?: "button" | "submit" | "reset";
size?: "sm";
disabled?: boolean;
onClick?: () => void;
style?: React.CSSProperties;
@@ -47,9 +49,9 @@ export function Btn({
const base: React.CSSProperties = {
border: "none",
borderRadius: "var(--radius)",
padding: "8px 16px",
padding: size === "sm" ? "4px 10px" : "8px 16px",
fontWeight: 600,
fontSize: 13,
fontSize: size === "sm" ? 12 : 13,
cursor: disabled ? "not-allowed" : "pointer",
opacity: disabled ? 0.6 : 1,
};

View File

@@ -301,7 +301,7 @@ function emptyProduct() {
return { name: "", sku: "", price: "", categoryId: "", taxId: "", description: "" };
}
function f(key: string, set: React.Dispatch<React.SetStateAction<Record<string, string>>>) {
function f<T extends Record<string, string>>(key: keyof T, set: React.Dispatch<React.SetStateAction<T>>) {
return (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>) =>
set((prev) => ({ ...prev, [key]: e.target.value }));
}

View File

@@ -61,7 +61,7 @@ export default function UsersPage() {
const openEdit = (user: User) => {
setSelected(user);
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id });
setForm({ name: user.name, email: user.email, password: "", roleId: user.role.id, vendorId: user.vendor?.id ?? "" });
setError("");
setModal("edit");
};

View File

@@ -1,6 +1,6 @@
PORT=8080
NODE_ENV=development
DATABASE_URL=file:./dev.db
DATABASE_URL=file:./prisma/dev.db
JWT_SECRET=change-me-in-production
LOG_LEVEL=info
CORS_ORIGIN=http://localhost:5173

View File

@@ -1,7 +1,6 @@
import express from "express";
import cors from "cors";
import path from "path";
import { fileURLToPath } from "url";
import healthRouter from "./routes/health.js";
import authRouter from "./routes/auth.js";
import vendorsRouter from "./routes/vendors.js";
@@ -15,9 +14,6 @@ import eventsRouter from "./routes/events.js";
import { errorHandler } from "./middleware/errorHandler.js";
import { requestLogger } from "./middleware/requestLogger.js";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export function createApp() {
const app = express();