diff --git a/.gitignore b/.gitignore index 3ef4dc6..0e10d66 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,11 @@ go.work.sum !*.go !go.sum !go.mod +!Dockerfile +!docker-compose.yaml +!air.toml +!*.html +!*.md !README.md !LICENSE diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..34ad7a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Use the official Golang image as the base. +FROM golang:1.22-alpine AS base + +# Install git (required by go modules) and any other utilities. +RUN apk add --no-cache git + + + + + +# Set the working directory inside the container. +WORKDIR /app + +# Cache go.mod and go.sum to speed up dependency installation. +COPY go.mod go.sum ./ +RUN go mod download + +# Copy the rest of the source code. +COPY . . +# Build the binary after copying the source files. +RUN go build -o /app/tmp/main ./cmd/app + +# The container will start Air, which watches the source files and rebuilds the app on change. +CMD ["./tmp/main"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3253904 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + app: + build: + context: . + dockerfile: Dockerfile + + ports: + - "8080:8080" + environment: + - GO111MODULE=on + command: ["./tmp/main"] diff --git a/static/components/AGENT_GUIDE.md b/static/components/AGENT_GUIDE.md new file mode 100644 index 0000000..45495a4 --- /dev/null +++ b/static/components/AGENT_GUIDE.md @@ -0,0 +1,101 @@ +# Agent Guide – Front‑End Web Components + +## Purpose +This guide defines the conventions we follow for building the front‑end of the **draw‑tools** project using **custom HTML web components**. + +## Rules + +1. **Only custom web components** + - All UI elements must be implemented as native HTML custom elements (``). + - No third‑party UI libraries (e.g., React, Vue) are used. + +2. **Self‑contained components** + - Each component lives in its own folder under `static/components`. + - The folder contains: + - `my-component.html` – the HTML template (including `