Convert to Next.js with security features

- Migrate from Vite to Next.js 15 for server-side API support
- Add dynamic API route at /api/filaments that fetches from Confluence
- Implement security measures:
  - API credentials only accessible server-side
  - Security scan script to detect credential leaks
  - Tests to ensure no sensitive data exposure
  - Build-time security checks in CI/CD
- Update AWS Amplify configuration for Next.js deployment
- Update Terraform to use WEB_COMPUTE platform for Next.js
- Add Jest tests for API security
- Remove static JSON approach in favor of dynamic API

This provides real-time data updates while keeping credentials secure on the server.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DaX
2025-06-19 00:11:19 +02:00
parent 4b39190251
commit 21f6577592
22 changed files with 5306 additions and 578 deletions

View File

@@ -15,11 +15,12 @@ provider "aws" {
resource "aws_amplify_app" "filamenteka" {
name = "filamenteka"
repository = var.github_repository
platform = "WEB_COMPUTE"
# GitHub access token for private repos
access_token = var.github_token
# Build settings
# Build settings for Next.js
build_spec = <<-EOT
version: 1
frontend:
@@ -27,16 +28,19 @@ resource "aws_amplify_app" "filamenteka" {
preBuild:
commands:
- npm ci
- npm run security:check
build:
commands:
- npm run build
- npm run test
artifacts:
baseDirectory: dist
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
- .next/cache/**/*
EOT
# Environment variables