diff --git a/.dockerignore b/.dockerignore index edd6d86..e6c716d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4002df3..4f8219a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: # CDK dependencies - package-ecosystem: "gomod" - directory: "/deployments/app" + directory: "/deployments/glad" schedule: interval: "weekly" open-pull-requests-limit: 3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11677ac..6287d51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file + run: task glad:build + + - name: Build Lambda Docker + run: task glad:build:docker \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7f4ea26..be595e5 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 diff --git a/Dockerfile b/Dockerfile.lambda similarity index 85% rename from Dockerfile rename to Dockerfile.lambda index 4ad3db4..6acc961 100644 --- a/Dockerfile +++ b/Dockerfile.lambda @@ -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 @@ -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 diff --git a/README.md b/README.md index 46dcd6a..637f6a8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 @@ -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 @@ -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) diff --git a/Taskfile.yml b/Taskfile.yml index ece020d..d3e8ea9 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,108 +1,23 @@ version: '3' +includes: + glad: + taskfile: ./cmd/glad/Taskfile.yml + dir: . + tasks: default: desc: 'List all available tasks' cmd: task --list-all - # Continue AI tasks - continue:refresh-token: - desc: 'Refresh msg ai api-token' - dir: '{{.ROOT_DIR}}' - cmds: - - scripts/continue-refresh-token.sh - - # Build tasks - build:lambda: - desc: 'Build Lambda function for AWS deployment (legacy ZIP method)' - cmds: - - echo 'Building Lambda function...' - - mkdir -p .bin - - env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags lambda -ldflags='-s -w' -o .bin/bootstrap ./cmd/app - - cd .bin && zip lambda-function.zip bootstrap - - echo 'success!' - - build:docker: - desc: 'Build Docker image for Lambda deployment' - cmds: - - echo 'Building Docker image for Lambda...' - - docker build -t glad-lambda:latest . - - echo 'Docker image built successfully!' - - build:docker:test: - desc: 'Test Docker image locally using Lambda Runtime Interface Emulator' - cmds: - - echo 'Testing Docker image locally...' - - echo 'Starting Lambda container in background on port 9000...' - - docker run -d --name glad-lambda-test --rm -p 9000:8080 --env-file .env glad-lambda:latest - - echo 'Waiting for container to be ready...' - - sleep 3 - - echo '' - - echo '🧪 Testing Lambda with GET /protected request...' - - | - curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" \ - -H "Content-Type: application/json" \ - -d '{ - "httpMethod": "GET", - "path": "/protected", - "headers": {"Content-Type": "application/json"}, - "body": null - }' && echo "" - - echo '' - - echo '📋 Container logs:' - - docker logs glad-lambda-test - - echo '' - - echo '🛑 Stopping container...' - - docker stop glad-lambda-test - - echo '✅ Test complete!' - - build:docker:test:interactive: - desc: 'Run Docker Lambda container interactively (stays running, stop with Ctrl+C)' - cmds: - - echo 'Starting Lambda container on port 9000...' - - echo 'Send requests to http://localhost:9000/2015-03-31/functions/function/invocations' - - echo 'Stop with Ctrl+C' - - echo '' - - docker run --rm --name glad-lambda-interactive -p 9000:8080 --env-file .env glad-lambda:latest - - debug:lambda: - desc: 'Debug Lambda function deployment issues' - cmds: - - ./debug-lambda.sh - - debug:lambda:local: - desc: 'Test Lambda Docker image locally' - cmds: - - ./test-lambda-local.sh - - debug:apigateway: - desc: 'Debug API Gateway integration issues' - cmds: - - ./debug-apigateway.sh - - debug:force-deploy: - desc: 'Force API Gateway stage redeployment (fixes deployment drift)' - cmds: - - ./force-stage-deploy.sh - - debug:logs: - desc: 'Tail Lambda CloudWatch logs in real-time' - cmds: - - | - FUNCTION_NAME=$(aws cloudformation describe-stack-resources --stack-name glad-stack --profile {{.AWS_PROFILE | default "default"}} --query "StackResources[?ResourceType=='AWS::Lambda::Function'].PhysicalResourceId" --output text) - echo "Tailing logs for function: $FUNCTION_NAME" - aws logs tail "/aws/lambda/$FUNCTION_NAME" --follow --profile {{.AWS_PROFILE | default "default"}} - - # Development tasks - - # Testing tasks + # Global tasks test: - desc: 'Run all Go tests' + desc: 'Run all tests' cmds: - go test ./... test:verbose: - desc: 'Run all Go tests with verbose output' + desc: 'Run all tests with verbose output' cmds: - go test -v ./... @@ -113,161 +28,35 @@ tasks: - go test -coverprofile=coverage.out ./... - go tool cover -html=coverage.out -o coverage.html - echo 'Coverage report generated - coverage.html' - - go tool cover -html=coverage.out - - test:suite: - desc: 'Run comprehensive test suite with detailed reporting' - cmds: - - go run -tags test test_suite.go - - test:api: - desc: 'Run some test flow against the real API. For now, it works only on empty database.' - cmds: - - docker compose -f docker-compose.http-test.yml run --rm http-client - - test:models: - desc: 'Run only model tests' - cmds: - - go test -v ./cmd/app/internal/models - - test:auth: - desc: 'Run only authentication tests' - cmds: - - go test -v ./pkg/auth - - go test -v ./pkg/middleware - - test:database: - desc: 'Run only database tests' - cmds: - - go test -v ./cmd/app/internal/database - - test:handlers: - desc: 'Run only API handler tests' - cmds: - - go test -v ./cmd/app/internal/api - - test:integration: - desc: 'Run integration tests' - cmds: - - go test -v -tags integration ./cmd/app - test:all: - desc: 'Run all tests including integration tests' - cmds: - - go test -v ./... - - go test -v -tags integration ./cmd/app - - # Code quality tasks fmt: - desc: 'Format Go code' + desc: 'Format all Go code' cmds: - go fmt ./... lint: - desc: 'Run Go linter (go vet)' + desc: 'Run Go linter' cmds: - echo 'Running go vet...' - go vet ./... - # Utility tasks clean: desc: 'Clean build artifacts' cmds: - rm -rf .bin/ - echo 'Cleaned build artifacts' - # CDK Deployment tasks - cdk:install: - desc: 'Install CDK dependencies' - dir: 'deployments/app' - cmds: - - go mod download - - echo 'CDK dependencies installed' - - cdk:synth: - desc: 'Synthesize CDK template (generate CloudFormation) - Docker image built automatically' - dir: 'deployments/app' - cmds: - - cdk synth - - echo 'CDK template synthesized to cdk.out/' - - cdk:diff: - desc: 'Show differences between current and deployed stack - Docker image built automatically' - dir: 'deployments/app' - cmds: - - cdk diff - - cdk:deploy: - desc: 'Deploy infrastructure to AWS using Docker image' - dir: 'deployments/app' - cmds: - - echo 'Deploying to AWS with profile {{.profile | default "default"}}' - - echo 'CDK will automatically build the Docker image during deployment...' - - cdk deploy --all --require-approval never --profile {{.profile | default "default"}} - - echo 'Deployment completed!' - - cdk:deploy:database: - desc: 'Deploy only database stack' - dir: 'deployments/app' - cmds: - - cdk deploy glad-database-stack --require-approval never --profile {{.profile | default "default"}} - - cdk:deploy:app: - desc: 'Deploy only application stack' - dir: 'deployments/app' - cmds: - - cdk deploy glad-app-stack --require-approval never --profile {{.profile | default "default"}} - - cdk:destroy: - desc: 'Destroy AWS infrastructure (use with caution!)' - dir: 'deployments/app' - cmds: - - echo 'WARNING This will destroy all AWS resources!' - - cdk destroy --all --force - - cdk:destroy:app: - desc: 'Destroy only application stack (keeps database)' - dir: 'deployments/app' - cmds: - - cdk destroy glad-app-stack --force - - cdk:destroy:database: - desc: 'Destroy database stack (table will be retained)' - dir: 'deployments/app' - cmds: - - echo 'WARNING Database table will be retained but stack will be removed' - - cdk destroy glad-database-stack --force - - cdk:bootstrap: - desc: 'Bootstrap CDK in your AWS account (run once)' - dir: 'deployments/app' - cmds: - - cdk bootstrap - - echo 'CDK bootstrapped for your AWS account' - - # Full deployment workflow - deploy: - desc: 'Full deployment workflow using Docker (test and deploy)' - cmds: - - echo "running command with args - {{.AWS_PROFILE}}" - - task: test - - task: cdk:deploy - vars: - profile: - sh: echo {{.AWS_PROFILE | default "default"}} - requires: - vars: [AWS_PROFILE] - - deploy:diff: - desc: 'Preview deployment changes with Docker' + # Continue AI tasks + continue:refresh-token: + desc: 'Refresh msg ai api-token' cmds: - - task: cdk:diff + - scripts/continue-refresh-token.sh # Development workflow shortcuts dev:full-test: - desc: 'Run full development test cycle (format, lint, test, build)' - deps: [fmt, lint, test, build:lambda] + desc: 'Run full development test cycle' + deps: [fmt, lint, test] dev:quick-test: - desc: 'Quick development test (format, test only)' + desc: 'Quick development test' deps: [fmt, test] diff --git a/changes1.md b/changes1.md deleted file mode 100644 index 092bf19..0000000 --- a/changes1.md +++ /dev/null @@ -1,102 +0,0 @@ -# Migrate Lambda Deployment from ZIP to Docker Container - -## Summary - -Migrated the GLAD Stack Lambda function deployment from ZIP-based packaging to Docker container images. This change provides better dependency management, larger size limits (10GB vs 250MB), and improved local testing capabilities with full Lambda Runtime Interface Emulator support. - -## Implementation Details - -### New Features - -#### 1. Multi-Stage Dockerfile -- **File**: `Dockerfile` -- **Stage 1 (Builder)**: Compiles Go application with static binary optimizations - - Uses `golang:1.24.0-alpine` base image - - Builds with `-ldflags="-s -w"` for minimal binary size - - Produces statically-linked executable -- **Stage 2 (Runtime)**: AWS Lambda runtime environment - - Uses `public.ecr.aws/lambda/provided:al2023` base image - - Copies only the compiled binary (minimal attack surface) - - Sets up Lambda bootstrap handler - -#### 2. Enhanced Task Automation -- **File**: `Taskfile.yml` -- **New Tasks**: - - `task build:docker` - Build Docker image locally for testing - - `task build:docker:test` - Test Docker image with Lambda Runtime Interface Emulator -- **Updated Tasks**: - - `task deploy` - Now uses Docker-based deployment (CDK handles build automatically) - - `task cdk:deploy`, `task cdk:synth`, `task cdk:diff` - Removed ZIP packaging dependencies - -#### 3. Automated ECR Integration -- CDK automatically creates and manages ECR repository -- Image versioning based on source code hash (automatic cache invalidation) -- Zero manual Docker registry operations required - -### Key Changes - -#### Infrastructure (CDK) -- **File**: `deployments/app/cdk.go` -- **Before**: `awslambda.NewFunction()` with ZIP-based `awslambda.AssetCode_FromAsset()` -- **After**: `awslambda.NewDockerImageFunction()` with `awslambda.DockerImageCode_FromImageAsset()` -- **Benefit**: CDK handles entire Docker build → push → deploy pipeline automatically - -#### Build Process -- **Before**: Manual `go build` + `zip` commands -- **After**: Dockerfile-based build with CDK orchestration -- **Benefit**: Consistent builds across environments, reproducible deployments - -#### Deployment Workflow -CDK now automatically: -1. Builds Docker image from Dockerfile -2. Creates/reuses ECR repository (managed by CDK bootstrap) -3. Tags image with content hash -4. Pushes image to ECR -5. Updates Lambda function to use new image -6. Updates API Gateway integration - -## Testing - -### Local Testing -```bash -# Build Docker image locally -task build:docker - -# Test with Lambda Runtime Interface Emulator -task build:docker:test -``` - -### Deployment Testing -```bash -# Full deployment (test → build → deploy) -task deploy - -# Or deploy directly -task cdk:deploy -``` - -### Comparison: ZIP vs Docker - -| Aspect | ZIP (Old) | Docker (New) | -|-------------------|-----------------------|---------------------------| -| Max Size | 250MB uncompressed | 10GB | -| Build Process | Manual go build + zip | Automatic via CDK | -| Deployment Method | Upload ZIP to Lambda | Push to ECR, Lambda pulls | -| Dependencies | Go-only | Any OS dependencies | -| Local Testing | Limited | Full Lambda emulation | -| Consistency | Build environment varies | Same image everywhere | - -## Benefits - -1. **Larger Dependency Support**: 10GB limit vs 250MB for ZIP files -2. **Custom Runtime Control**: Full control over OS, libraries, and system dependencies -3. **Development Consistency**: Same Docker image runs locally and in production -4. **Simplified Deployment**: CDK handles entire Docker workflow automatically -5. **Better Testing**: Lambda Runtime Interface Emulator provides accurate local testing -6. **Automatic Versioning**: Image tags based on source code hash ensure proper cache invalidation - -## Prerequisites - -- Docker must be running (Docker Desktop on macOS) -- AWS CDK bootstrap completed in target account/region -- Sufficient ECR storage quota in AWS account diff --git a/cmd/glad/Taskfile.yml b/cmd/glad/Taskfile.yml new file mode 100644 index 0000000..6b684b2 --- /dev/null +++ b/cmd/glad/Taskfile.yml @@ -0,0 +1,97 @@ +version: '3' + +vars: + APP_NAME: glad + LAMBDA_PATH: cmd/glad + DEPLOYMENT_PATH: deployments/glad + DOCKER_IMAGE: glad-lambda + +tasks: + build: + desc: 'Build app Lambda function (ZIP method)' + cmds: + - echo 'Building {{.APP_NAME}} Lambda function...' + - mkdir -p .bin + - env GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags lambda -ldflags='-s -w' -o .bin/bootstrap ./{{.LAMBDA_PATH}} + - cd .bin && zip lambda-function.zip bootstrap + - echo 'Success!' + + build:docker: + desc: 'Build app Docker image for Lambda' + cmds: + - echo 'Building {{.APP_NAME}} Docker image...' + - docker build -f Dockerfile.lambda --build-arg LAMBDA_PATH={{.LAMBDA_PATH}} -t {{.DOCKER_IMAGE}}:latest . + - echo 'Docker image built successfully!' + + test: + desc: 'Run app tests' + cmds: + - go test -v ./{{.LAMBDA_PATH}}/... + + test:all: + desc: 'Run all tests including integration tests' + cmds: + - go test -v ./... + - go test -v -tags integration ./cmd/glad + + test:integration: + desc: 'Run app integration tests' + cmds: + - go test -v -tags integration ./{{.LAMBDA_PATH}} + + cdk:synth: + desc: 'Synthesize app CDK template' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk synth + + cdk:diff: + desc: 'Show app stack differences' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk diff + + cdk:deploy: + desc: 'Deploy app infrastructure' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - echo 'Deploying {{.APP_NAME}} with profile {{.profile | default "default"}}' + - cdk deploy --all --require-approval never --profile {{.profile | default "default"}} + + cdk:deploy:database: + desc: 'Deploy app database stack' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk deploy glad-database-stack --require-approval never --profile {{.profile | default "default"}} + + cdk:deploy:app: + desc: 'Deploy app application stack' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk deploy glad-app-stack --require-approval never --profile {{.profile | default "default"}} + + cdk:destroy: + desc: 'Destroy app infrastructure' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk destroy --all --force + + cdk:destroy:app: + desc: 'Destroy app application stack' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk destroy glad-app-stack --force + + cdk:destroy:database: + desc: 'Destroy app database stack' + dir: '{{.DEPLOYMENT_PATH}}' + cmds: + - cdk destroy glad-database-stack --force + + deploy: + desc: 'Full app deployment workflow' + cmds: + - task: test + - task: cdk:deploy + vars: + profile: '{{.profile | default "default"}}' diff --git a/cmd/app/docs/dynamodb_table_design.md b/cmd/glad/docs/dynamodb_table_design.md similarity index 100% rename from cmd/app/docs/dynamodb_table_design.md rename to cmd/glad/docs/dynamodb_table_design.md diff --git a/cmd/app/integration_test.go b/cmd/glad/integration_test.go similarity index 96% rename from cmd/app/integration_test.go rename to cmd/glad/integration_test.go index 7db43f6..a879973 100644 --- a/cmd/app/integration_test.go +++ b/cmd/glad/integration_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - "github.com/hackmajoris/glad/cmd/app/internal/handler" - "github.com/hackmajoris/glad/cmd/app/internal/service" - "github.com/hackmajoris/glad/pkg/auth" - "github.com/hackmajoris/glad/pkg/config" - "github.com/hackmajoris/glad/pkg/middleware" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/handler" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/service" + "github.com/hackmajoris/glad-stack/pkg/auth" + "github.com/hackmajoris/glad-stack/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/middleware" "github.com/aws/aws-lambda-go/events" ) diff --git a/cmd/app/internal/database/client.go b/cmd/glad/internal/database/client.go similarity index 94% rename from cmd/app/internal/database/client.go rename to cmd/glad/internal/database/client.go index 9e6f0ae..3bc06ac 100644 --- a/cmd/app/internal/database/client.go +++ b/cmd/glad/internal/database/client.go @@ -3,8 +3,8 @@ package database import ( "sync" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" diff --git a/cmd/app/internal/database/client_test.go b/cmd/glad/internal/database/client_test.go similarity index 98% rename from cmd/app/internal/database/client_test.go rename to cmd/glad/internal/database/client_test.go index 2b367f8..cfdc69d 100644 --- a/cmd/app/internal/database/client_test.go +++ b/cmd/glad/internal/database/client_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" ) func TestNewMockRepository(t *testing.T) { diff --git a/cmd/app/internal/database/constants.go b/cmd/glad/internal/database/constants.go similarity index 100% rename from cmd/app/internal/database/constants.go rename to cmd/glad/internal/database/constants.go diff --git a/cmd/app/internal/database/entity_keys.go b/cmd/glad/internal/database/entity_keys.go similarity index 100% rename from cmd/app/internal/database/entity_keys.go rename to cmd/glad/internal/database/entity_keys.go diff --git a/cmd/app/internal/database/factory.go b/cmd/glad/internal/database/factory.go similarity index 93% rename from cmd/app/internal/database/factory.go rename to cmd/glad/internal/database/factory.go index c926a3d..5983f68 100644 --- a/cmd/app/internal/database/factory.go +++ b/cmd/glad/internal/database/factory.go @@ -3,8 +3,8 @@ package database import ( "os" - "github.com/hackmajoris/glad/pkg/config" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // Repository combines all repository interfaces for unified access. diff --git a/cmd/app/internal/database/factory_test.go b/cmd/glad/internal/database/factory_test.go similarity index 98% rename from cmd/app/internal/database/factory_test.go rename to cmd/glad/internal/database/factory_test.go index eb03ba3..e19e043 100644 --- a/cmd/app/internal/database/factory_test.go +++ b/cmd/glad/internal/database/factory_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/hackmajoris/glad/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/config" ) func TestNewRepository_EnvironmentDetection(t *testing.T) { diff --git a/cmd/app/internal/database/master_skill_repository.go b/cmd/glad/internal/database/master_skill_repository.go similarity index 83% rename from cmd/app/internal/database/master_skill_repository.go rename to cmd/glad/internal/database/master_skill_repository.go index 30e3f73..ce84c37 100644 --- a/cmd/app/internal/database/master_skill_repository.go +++ b/cmd/glad/internal/database/master_skill_repository.go @@ -1,6 +1,6 @@ package database -import "github.com/hackmajoris/glad/cmd/app/internal/models" +import "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" // MasterSkillRepository defines operations for master skills type MasterSkillRepository interface { diff --git a/cmd/app/internal/database/master_skill_repository_dynamodb.go b/cmd/glad/internal/database/master_skill_repository_dynamodb.go similarity index 96% rename from cmd/app/internal/database/master_skill_repository_dynamodb.go rename to cmd/glad/internal/database/master_skill_repository_dynamodb.go index 6e31264..f1dc40f 100644 --- a/cmd/app/internal/database/master_skill_repository_dynamodb.go +++ b/cmd/glad/internal/database/master_skill_repository_dynamodb.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" diff --git a/cmd/app/internal/database/master_skill_repository_mock.go b/cmd/glad/internal/database/master_skill_repository_mock.go similarity index 95% rename from cmd/app/internal/database/master_skill_repository_mock.go rename to cmd/glad/internal/database/master_skill_repository_mock.go index e8125a5..c40149b 100644 --- a/cmd/app/internal/database/master_skill_repository_mock.go +++ b/cmd/glad/internal/database/master_skill_repository_mock.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // CreateMasterSkill creates a master skill in memory diff --git a/cmd/app/internal/database/user_repository.go b/cmd/glad/internal/database/user_repository.go similarity index 82% rename from cmd/app/internal/database/user_repository.go rename to cmd/glad/internal/database/user_repository.go index 893309b..0e9a334 100644 --- a/cmd/app/internal/database/user_repository.go +++ b/cmd/glad/internal/database/user_repository.go @@ -1,6 +1,6 @@ package database -import "github.com/hackmajoris/glad/cmd/app/internal/models" +import "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" // UserRepository defines the interface for user data operations type UserRepository interface { diff --git a/cmd/app/internal/database/user_repository_dynamodb.go b/cmd/glad/internal/database/user_repository_dynamodb.go similarity index 96% rename from cmd/app/internal/database/user_repository_dynamodb.go rename to cmd/glad/internal/database/user_repository_dynamodb.go index b667224..6ee133c 100644 --- a/cmd/app/internal/database/user_repository_dynamodb.go +++ b/cmd/glad/internal/database/user_repository_dynamodb.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" diff --git a/cmd/app/internal/database/user_repository_mock.go b/cmd/glad/internal/database/user_repository_mock.go similarity index 94% rename from cmd/app/internal/database/user_repository_mock.go rename to cmd/glad/internal/database/user_repository_mock.go index 481bcf0..1452b5b 100644 --- a/cmd/app/internal/database/user_repository_mock.go +++ b/cmd/glad/internal/database/user_repository_mock.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // CreateUser creates a user in memory diff --git a/cmd/app/internal/database/user_skill_repository.go b/cmd/glad/internal/database/user_skill_repository.go similarity index 91% rename from cmd/app/internal/database/user_skill_repository.go rename to cmd/glad/internal/database/user_skill_repository.go index fd0a84a..88f1bbe 100644 --- a/cmd/app/internal/database/user_skill_repository.go +++ b/cmd/glad/internal/database/user_skill_repository.go @@ -1,6 +1,6 @@ package database -import "github.com/hackmajoris/glad/cmd/app/internal/models" +import "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" // SkillRepository defines operations for user skills type SkillRepository interface { diff --git a/cmd/app/internal/database/user_skill_repository_dynamodb.go b/cmd/glad/internal/database/user_skill_repository_dynamodb.go similarity index 98% rename from cmd/app/internal/database/user_skill_repository_dynamodb.go rename to cmd/glad/internal/database/user_skill_repository_dynamodb.go index 16daff5..f93d97f 100644 --- a/cmd/app/internal/database/user_skill_repository_dynamodb.go +++ b/cmd/glad/internal/database/user_skill_repository_dynamodb.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/dynamodb" diff --git a/cmd/app/internal/database/user_skill_repository_mock.go b/cmd/glad/internal/database/user_skill_repository_mock.go similarity index 96% rename from cmd/app/internal/database/user_skill_repository_mock.go rename to cmd/glad/internal/database/user_skill_repository_mock.go index 634fcbf..9417b1e 100644 --- a/cmd/app/internal/database/user_skill_repository_mock.go +++ b/cmd/glad/internal/database/user_skill_repository_mock.go @@ -3,9 +3,9 @@ package database import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // CreateSkill creates a user skill in memory diff --git a/cmd/app/internal/dto/dto.go b/cmd/glad/internal/dto/dto.go similarity index 100% rename from cmd/app/internal/dto/dto.go rename to cmd/glad/internal/dto/dto.go diff --git a/cmd/app/internal/errors/user.go b/cmd/glad/internal/errors/user.go similarity index 100% rename from cmd/app/internal/errors/user.go rename to cmd/glad/internal/errors/user.go diff --git a/cmd/app/internal/handler/error_mapper.go b/cmd/glad/internal/handler/error_mapper.go similarity index 94% rename from cmd/app/internal/handler/error_mapper.go rename to cmd/glad/internal/handler/error_mapper.go index f07bafa..a77065a 100644 --- a/cmd/app/internal/handler/error_mapper.go +++ b/cmd/glad/internal/handler/error_mapper.go @@ -3,8 +3,8 @@ package handler import ( "net/http" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - pkgerrors "github.com/hackmajoris/glad/pkg/errors" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + pkgerrors "github.com/hackmajoris/glad-stack/pkg/errors" ) // ErrorMapper maps service errors to HTTP status codes and messages diff --git a/cmd/app/internal/handler/master_skill_handler.go b/cmd/glad/internal/handler/master_skill_handler.go similarity index 97% rename from cmd/app/internal/handler/master_skill_handler.go rename to cmd/glad/internal/handler/master_skill_handler.go index c88094c..33edb67 100644 --- a/cmd/app/internal/handler/master_skill_handler.go +++ b/cmd/glad/internal/handler/master_skill_handler.go @@ -4,8 +4,8 @@ import ( "encoding/json" "net/http" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - "github.com/hackmajoris/glad/cmd/app/internal/service" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/service" "github.com/aws/aws-lambda-go/events" ) diff --git a/cmd/app/internal/handler/user_handler.go b/cmd/glad/internal/handler/user_handler.go similarity index 97% rename from cmd/app/internal/handler/user_handler.go rename to cmd/glad/internal/handler/user_handler.go index 9ff97ad..695e38c 100644 --- a/cmd/app/internal/handler/user_handler.go +++ b/cmd/glad/internal/handler/user_handler.go @@ -5,13 +5,13 @@ import ( "net/http" "github.com/aws/aws-lambda-go/events" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/cmd/app/internal/service" - "github.com/hackmajoris/glad/cmd/app/internal/validation" - "github.com/hackmajoris/glad/pkg/auth" - _ "github.com/hackmajoris/glad/pkg/errors" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/service" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/validation" + "github.com/hackmajoris/glad-stack/pkg/auth" + _ "github.com/hackmajoris/glad-stack/pkg/errors" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // Handler handles HTTP requests diff --git a/cmd/app/internal/handler/user_handler_test.go b/cmd/glad/internal/handler/user_handler_test.go similarity index 95% rename from cmd/app/internal/handler/user_handler_test.go rename to cmd/glad/internal/handler/user_handler_test.go index e88c381..0a2e7db 100644 --- a/cmd/app/internal/handler/user_handler_test.go +++ b/cmd/glad/internal/handler/user_handler_test.go @@ -5,12 +5,12 @@ import ( "testing" "time" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/cmd/app/internal/service" - "github.com/hackmajoris/glad/pkg/auth" - "github.com/hackmajoris/glad/pkg/config" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/service" + "github.com/hackmajoris/glad-stack/pkg/auth" + "github.com/hackmajoris/glad-stack/pkg/config" "github.com/aws/aws-lambda-go/events" ) diff --git a/cmd/app/internal/models/skill.go b/cmd/glad/internal/models/skill.go similarity index 98% rename from cmd/app/internal/models/skill.go rename to cmd/glad/internal/models/skill.go index 8a8495f..7419ba9 100644 --- a/cmd/app/internal/models/skill.go +++ b/cmd/glad/internal/models/skill.go @@ -4,7 +4,7 @@ import ( "errors" "time" - apperrors "github.com/hackmajoris/glad/pkg/errors" + apperrors "github.com/hackmajoris/glad-stack/pkg/errors" ) // Skill represents a master skill entity in the system diff --git a/cmd/app/internal/models/user.go b/cmd/glad/internal/models/user.go similarity index 95% rename from cmd/app/internal/models/user.go rename to cmd/glad/internal/models/user.go index e9e0393..b83320d 100644 --- a/cmd/app/internal/models/user.go +++ b/cmd/glad/internal/models/user.go @@ -3,8 +3,8 @@ package models import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/pkg/errors" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/pkg/errors" "golang.org/x/crypto/bcrypt" ) diff --git a/cmd/app/internal/models/user_skill.go b/cmd/glad/internal/models/user_skill.go similarity index 97% rename from cmd/app/internal/models/user_skill.go rename to cmd/glad/internal/models/user_skill.go index 0a9b320..53a7c65 100644 --- a/cmd/app/internal/models/user_skill.go +++ b/cmd/glad/internal/models/user_skill.go @@ -3,8 +3,8 @@ package models import ( "time" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/pkg/errors" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/pkg/errors" ) // ProficiencyLevel represents the proficiency level for a skill diff --git a/cmd/app/internal/models/user_test.go b/cmd/glad/internal/models/user_test.go similarity index 100% rename from cmd/app/internal/models/user_test.go rename to cmd/glad/internal/models/user_test.go diff --git a/cmd/app/internal/models/utils.go b/cmd/glad/internal/models/utils.go similarity index 100% rename from cmd/app/internal/models/utils.go rename to cmd/glad/internal/models/utils.go diff --git a/cmd/app/internal/router/router.go b/cmd/glad/internal/router/router.go similarity index 98% rename from cmd/app/internal/router/router.go rename to cmd/glad/internal/router/router.go index b311bb0..898a1ee 100644 --- a/cmd/app/internal/router/router.go +++ b/cmd/glad/internal/router/router.go @@ -3,7 +3,7 @@ package router import ( "net/http" - "github.com/hackmajoris/glad/pkg/middleware" + "github.com/hackmajoris/glad-stack/pkg/middleware" "github.com/aws/aws-lambda-go/events" ) diff --git a/cmd/app/internal/service/master_skill_service.go b/cmd/glad/internal/service/master_skill_service.go similarity index 95% rename from cmd/app/internal/service/master_skill_service.go rename to cmd/glad/internal/service/master_skill_service.go index 8b029e5..e825421 100644 --- a/cmd/app/internal/service/master_skill_service.go +++ b/cmd/glad/internal/service/master_skill_service.go @@ -3,10 +3,10 @@ package service import ( "time" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // MasterSkillService handles master skill business logic diff --git a/cmd/app/internal/service/skill_service.go b/cmd/glad/internal/service/skill_service.go similarity index 96% rename from cmd/app/internal/service/skill_service.go rename to cmd/glad/internal/service/skill_service.go index 845a658..c3d377c 100644 --- a/cmd/app/internal/service/skill_service.go +++ b/cmd/glad/internal/service/skill_service.go @@ -3,11 +3,11 @@ package service import ( "time" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // Re-export domain errors for convenience in handler layer diff --git a/cmd/app/internal/service/user_service.go b/cmd/glad/internal/service/user_service.go similarity index 92% rename from cmd/app/internal/service/user_service.go rename to cmd/glad/internal/service/user_service.go index 21a0c1f..f8151f9 100644 --- a/cmd/app/internal/service/user_service.go +++ b/cmd/glad/internal/service/user_service.go @@ -3,13 +3,13 @@ package service import ( "time" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/dto" - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - "github.com/hackmajoris/glad/cmd/app/internal/models" - "github.com/hackmajoris/glad/pkg/auth" - pkgerrors "github.com/hackmajoris/glad/pkg/errors" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/dto" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/models" + "github.com/hackmajoris/glad-stack/pkg/auth" + pkgerrors "github.com/hackmajoris/glad-stack/pkg/errors" + "github.com/hackmajoris/glad-stack/pkg/logger" ) // Re-export domain errors for convenience in handler layer diff --git a/cmd/app/internal/validation/validation.go b/cmd/glad/internal/validation/validation.go similarity index 94% rename from cmd/app/internal/validation/validation.go rename to cmd/glad/internal/validation/validation.go index 8e71215..1b32910 100644 --- a/cmd/app/internal/validation/validation.go +++ b/cmd/glad/internal/validation/validation.go @@ -1,8 +1,8 @@ package validation import ( - apperrors "github.com/hackmajoris/glad/cmd/app/internal/errors" - pkgerrors "github.com/hackmajoris/glad/pkg/errors" + apperrors "github.com/hackmajoris/glad-stack/cmd/glad/internal/errors" + pkgerrors "github.com/hackmajoris/glad-stack/pkg/errors" ) // Validator provides validation functionality diff --git a/cmd/app/main.go b/cmd/glad/main.go similarity index 86% rename from cmd/app/main.go rename to cmd/glad/main.go index b3d0f4f..b935536 100644 --- a/cmd/app/main.go +++ b/cmd/glad/main.go @@ -3,13 +3,13 @@ package main import ( "log" - "github.com/hackmajoris/glad/cmd/app/internal/database" - "github.com/hackmajoris/glad/cmd/app/internal/handler" - "github.com/hackmajoris/glad/cmd/app/internal/router" - "github.com/hackmajoris/glad/cmd/app/internal/service" - "github.com/hackmajoris/glad/pkg/auth" - "github.com/hackmajoris/glad/pkg/config" - "github.com/hackmajoris/glad/pkg/middleware" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/database" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/handler" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/router" + "github.com/hackmajoris/glad-stack/cmd/glad/internal/service" + "github.com/hackmajoris/glad-stack/pkg/auth" + "github.com/hackmajoris/glad-stack/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/middleware" "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" diff --git a/cmd/app/main_test.go b/cmd/glad/main_test.go similarity index 96% rename from cmd/app/main_test.go rename to cmd/glad/main_test.go index ee50cf5..19c45bb 100644 --- a/cmd/app/main_test.go +++ b/cmd/glad/main_test.go @@ -6,8 +6,8 @@ package main import ( "testing" - "go-on-aws/cmd/app/internal/api" - "go-on-aws/cmd/app/internal/database" + "go-on-aws/cmd/glad/internal/api" + "go-on-aws/cmd/glad/internal/database" "go-on-aws/pkg/auth" "go-on-aws/pkg/middleware" diff --git a/cmd/app/testdata/api-testing/api-test.http b/cmd/glad/testdata/api-testing/api-test.http similarity index 100% rename from cmd/app/testdata/api-testing/api-test.http rename to cmd/glad/testdata/api-testing/api-test.http diff --git a/cmd/app/testdata/sample_request.json b/cmd/glad/testdata/sample_request.json similarity index 100% rename from cmd/app/testdata/sample_request.json rename to cmd/glad/testdata/sample_request.json diff --git a/deployments/app/README.md b/deployments/glad/README.md similarity index 100% rename from deployments/app/README.md rename to deployments/glad/README.md diff --git a/deployments/app/app_stack.go b/deployments/glad/app_stack.go similarity index 99% rename from deployments/app/app_stack.go rename to deployments/glad/app_stack.go index c3bc503..f24d56e 100644 --- a/deployments/app/app_stack.go +++ b/deployments/glad/app_stack.go @@ -32,7 +32,7 @@ func NewAppStack(scope constructs.Construct, id string, props *AppStackProps) aw // Create Lambda using Docker image myFunc := awslambda.NewDockerImageFunction(stack, jsii.String(id+"-go-func"), &awslambda.DockerImageFunctionProps{ Code: awslambda.DockerImageCode_FromImageAsset(jsii.String("../../"), &awslambda.AssetImageCodeProps{ - File: jsii.String("Dockerfile"), + File: jsii.String("Dockerfile.lambda"), }), Timeout: awscdk.Duration_Seconds(jsii.Number(30)), MemorySize: jsii.Number(512), diff --git a/deployments/app/cdk.json b/deployments/glad/cdk.json similarity index 100% rename from deployments/app/cdk.json rename to deployments/glad/cdk.json diff --git a/deployments/app/database_stack.go b/deployments/glad/database_stack.go similarity index 100% rename from deployments/app/database_stack.go rename to deployments/glad/database_stack.go diff --git a/deployments/app/go.mod b/deployments/glad/go.mod similarity index 100% rename from deployments/app/go.mod rename to deployments/glad/go.mod diff --git a/deployments/app/go.sum b/deployments/glad/go.sum similarity index 100% rename from deployments/app/go.sum rename to deployments/glad/go.sum diff --git a/deployments/app/main.go b/deployments/glad/main.go similarity index 100% rename from deployments/app/main.go rename to deployments/glad/main.go diff --git a/docker-compose.http-test.yml b/docker-compose.http-test.yml index e7159e7..dc89cb8 100644 --- a/docker-compose.http-test.yml +++ b/docker-compose.http-test.yml @@ -4,7 +4,7 @@ services: http-client: image: jetbrains/intellij-http-client volumes: - - ./cmd/app/testdata/api-testing:/workdir + - ./cmd/glad/testdata/api-testing:/workdir working_dir: /workdir command: > --env=dev diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/go.mod b/go.mod index 51f5efe..3dbfd55 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/hackmajoris/glad +module github.com/hackmajoris/glad-stack go 1.24.0 diff --git a/pkg/auth/jwt.go b/pkg/auth/jwt.go index d1110f0..19b8f69 100644 --- a/pkg/auth/jwt.go +++ b/pkg/auth/jwt.go @@ -3,9 +3,9 @@ package auth import ( "time" - "github.com/hackmajoris/glad/pkg/config" - pkgerrors "github.com/hackmajoris/glad/pkg/errors" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/pkg/config" + pkgerrors "github.com/hackmajoris/glad-stack/pkg/errors" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/golang-jwt/jwt/v5" ) diff --git a/pkg/auth/jwt_test.go b/pkg/auth/jwt_test.go index 2349890..d9e8486 100644 --- a/pkg/auth/jwt_test.go +++ b/pkg/auth/jwt_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/hackmajoris/glad/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/config" "github.com/golang-jwt/jwt/v5" ) diff --git a/pkg/middleware/auth.go b/pkg/middleware/auth.go index 65d15a8..2c4c7a1 100644 --- a/pkg/middleware/auth.go +++ b/pkg/middleware/auth.go @@ -5,9 +5,9 @@ import ( "strings" "time" - "github.com/hackmajoris/glad/pkg/auth" - pkgerrors "github.com/hackmajoris/glad/pkg/errors" - "github.com/hackmajoris/glad/pkg/logger" + "github.com/hackmajoris/glad-stack/pkg/auth" + pkgerrors "github.com/hackmajoris/glad-stack/pkg/errors" + "github.com/hackmajoris/glad-stack/pkg/logger" "github.com/aws/aws-lambda-go/events" ) diff --git a/pkg/middleware/auth_test.go b/pkg/middleware/auth_test.go index 6c31cc7..984b641 100644 --- a/pkg/middleware/auth_test.go +++ b/pkg/middleware/auth_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "github.com/hackmajoris/glad/pkg/auth" - "github.com/hackmajoris/glad/pkg/config" + "github.com/hackmajoris/glad-stack/pkg/auth" + "github.com/hackmajoris/glad-stack/pkg/config" "github.com/aws/aws-lambda-go/events" ) diff --git a/test_suite.go b/test_suite.go index 192a1a0..51fbfbb 100644 --- a/test_suite.go +++ b/test_suite.go @@ -21,7 +21,7 @@ func main() { testSuites := []TestSuite{ { Name: "Models", - Path: "./cmd/app/internal/models", + Path: "./cmd/glad/internal/models", Description: "User model validation, password hashing, and data operations", }, { @@ -36,17 +36,17 @@ func main() { }, { Name: "Database", - Path: "./cmd/app/internal/database", + Path: "./cmd/glad/internal/database", Description: "Mock repository operations and concurrent access", }, { Name: "API Handlers", - Path: "./cmd/app/internal/api", + Path: "./cmd/glad/internal/api", Description: "REST API endpoints, registration, login, and user operations", }, { Name: "Main Lambda", - Path: "./cmd/app", + Path: "./cmd/glad", Description: "Lambda handler routing and request processing", }, }