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 .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CDK output directory - MUST be excluded to prevent recursive bundling
deployments/app/cdk.out
deployments/glad/cdk.out
deployments/**/cdk.out
**/cdk.out

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ updates:

# CDK dependencies
- package-ecosystem: "gomod"
directory: "/deployments/app"
directory: "/deployments/glad"
schedule:
interval: "weekly"
open-pull-requests-limit: 3
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ jobs:
run: go mod download

- name: Run tests
run: task test:all
run: task glad:test:all

- name: Run linter
run: task lint

- name: Build Lambda
run: task build:lambda
run: task glad:build

- name: Build Lambda Docker
run: task glad:build:docker
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Thumbs.db
.env
.env.local
http-client.env.json
cmd/app/testdata/api-testing/http-client.env.json
cmd/glad/testdata/api-testing/http-client.env.json
.env.*.local
*.env.*
*.pem
Expand Down Expand Up @@ -87,4 +87,4 @@ yarn-error.log*
.terraform.lock.hcl

# Go module downloads (keep go.sum)
vendor/cmd/app/testdata/api-testing/http-client.env.json
vendor/cmd/glad/testdata/api-testing/http-client.env.json
7 changes: 5 additions & 2 deletions Dockerfile → Dockerfile.lambda
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apk add --no-cache git ca-certificates tzdata
# Set working directory
WORKDIR /build

# Copy go mod files
# Copy go mod files from project root
COPY go.mod go.sum ./

# Download dependencies
Expand All @@ -17,13 +17,16 @@ RUN go mod download
# Copy source code
COPY . .

# Build argument for Lambda path (default: cmd/glad)
ARG LAMBDA_PATH=cmd/glad

# Build the Lambda function
# CGO_ENABLED=0 for static binary
# -ldflags="-s -w" to reduce binary size
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-s -w" \
-o /build/bootstrap \
./cmd/app
./${LAMBDA_PATH}

# Stage 2: Create the Lambda runtime image
FROM public.ecr.aws/lambda/provided:al2023
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ that can handle millions of requests while maintaining low latency and high avai
```
glad/
├── cmd/
│ └── app/ # Lambda application
│ └── glad/ # Lambda application
│ ├── main.go # Lambda entry point
│ ├── integration_test.go # Integration tests
│ ├── testdata/ # Test data files
Expand All @@ -54,7 +54,7 @@ glad/
│ ├── logger/ # Structured logging
│ └── middleware/ # HTTP middleware
├── deployments/
│ └── app/ # AWS CDK infrastructure
│ └── glad/ # AWS CDK infrastructure
│ ├── cdk.go # CDK stack definition
├── Taskfile.yml # Task runner configuration
├── .golangci.yml # Go linter configuration
Expand Down Expand Up @@ -93,7 +93,7 @@ Request → Router → Middleware → Handler → Service → Repository → Dat
The database package follows a scalable file organization pattern designed for growth to 10+ repositories:

```
cmd/app/internal/database/
cmd/glad/internal/database/
├── client.go # Repository struct definitions
├── constants.go # Table names, GSI constants
├── entity_keys.go # Entity ID builders and parsers
Expand Down Expand Up @@ -135,7 +135,7 @@ The unified `Repository` interface composes all entity repositories, allowing bo

## Data Model - Optimized Single Table Design

[Check Data Model and Single Table Design Specs ](cmd/app/docs/dynamodb_table_design.md)
[Check Data Model and Single Table Design Specs ](cmd/glad/docs/dynamodb_table_design.md)

## Getting Started

Expand Down Expand Up @@ -277,13 +277,13 @@ Test coverage includes:
### Config (`pkg/config/`)
Centralized configuration loading from environment variables with typed structs and defaults.

### Errors (`cmd/app/internal/errors/` & `pkg/errors/`)
### Errors (`cmd/glad/internal/errors/` & `pkg/errors/`)
- Domain-specific error definitions
- Reusable error utilities
- HTTP status code mapping
- Proper error wrapping with context

### Validation (`cmd/app/internal/validation/`)
### Validation (`cmd/glad/internal/validation/`)
- Username validation (3-50 chars, alphanumeric + underscore)
- Password validation (min 6 chars)
- Name validation (non-empty)
Expand Down
Loading
Loading