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
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,41 @@ updates:
- "dependencies"
- "rust"

- package-ecosystem: "npm"
directory: "/workers"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "workers"
versioning-strategy: "increase"

- package-ecosystem: "npm"
directory: "/sdks"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 3
labels:
- "dependencies"
- "sdks"
versioning-strategy: "increase"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"

# Enable security updates
security-updates:
- package-ecosystem: "npm"
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Coverage

on:
pull_request:
paths:
- 'frontend/**'
- '!frontend/e2e/**'
push:
branches:
- main

jobs:
coverage:
name: Code coverage with threshold enforcement
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests with coverage
run: npm run test -- --coverage
env:
NEXT_TELEMETRY_DISABLED: '1'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: frontend/coverage
flags: frontend
fail_ci_if_error: false
54 changes: 54 additions & 0 deletions .github/workflows/size-limit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Size Limit

on:
pull_request:
paths:
- 'frontend/app/**'
- 'frontend/components/**'
- 'frontend/lib/**'
- 'frontend/next.config.ts'
- 'frontend/bundle-budget.json'
- 'frontend/package.json'
- '.size-limit.json'
push:
branches:
- main
paths:
- 'frontend/app/**'
- 'frontend/components/**'
- 'frontend/next.config.ts'

jobs:
size-limit:
name: Bundle size budgets and regression alerts
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build
env:
NEXT_TELEMETRY_DISABLED: '1'
SIZE_LIMIT: 'true'

- name: Enforce bundle budgets
run: npm run bundle:check

- name: Report size regressions on pull requests
if: github.event_name == 'pull_request'
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
directory: frontend
config_path: .size-limit.json
27 changes: 27 additions & 0 deletions .size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "agenticpay",
"repository": "https://github.com/Smartdevs17/agenticpay",
"sizeLimit": [
{
"name": "frontend framework chunk (gzip)",
"path": "frontend/.next/static/chunks/framework-*.js",
"limit": "210 kB",
"gzip": true,
"running": false
},
{
"name": "frontend main app chunks (gzip)",
"path": "frontend/.next/static/chunks/*.js",
"limit": "1500 kB",
"gzip": true,
"running": false
},
{
"name": "frontend css (gzip)",
"path": "frontend/.next/static/css/*.css",
"limit": "200 kB",
"gzip": true,
"running": false
}
]
}
35 changes: 35 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
coverage:
status:
project:
default:
target: auto
threshold: 1%
flags:
- frontend
informational: false
patch:
default:
target: 80%
threshold: 1%
informational: false
ignore:
- "frontend/e2e/**"
- "frontend/.next/**"
- "frontend/playwright-report/**"
- "frontend/test-results/**"
- "**/*.config.*"
- "**/*.d.ts"

comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
threshold: 1%
flags:
- frontend

github_checks:
annotations: true

fixes:
- "frontend/::"
52 changes: 52 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,58 @@ services:
depends_on:
- loki

backend:
image: node:20-alpine
working_dir: /app
command: sh -c "npm install && npm run dev"
ports:
- '4000:4000'
environment:
NODE_ENV: development
DATABASE_URL: postgres://postgres:postgres@postgres:5432/agenticpay
REDIS_URL: redis://redis:6379
LOG_API_URL: http://loki:3100
volumes:
- ./backend:/app
- /app/node_modules
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
develop:
watch:
- action: sync
path: ./backend
target: /app
- action: rebuild
path: ./backend/package.json

frontend:
image: node:20-alpine
working_dir: /app
command: sh -c "npm install && npm run dev"
ports:
- '3000:3000'
environment:
NODE_ENV: development
NEXT_PUBLIC_API_URL: http://backend:4000
NEXT_PUBLIC_CDN_URL: ''
NEXT_TELEMETRY_DISABLED: '1'
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
depends_on:
- backend
develop:
watch:
- action: sync
path: ./frontend
target: /app
- action: rebuild
path: ./frontend/package.json

volumes:
agenticpay-postgres:
agenticpay-redis:
Expand Down
22 changes: 22 additions & 0 deletions frontend/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,28 @@ const nextConfig: NextConfig = {
};
}

if (process.env.SIZE_LIMIT === "true" && !isServer) {
config.plugins = config.plugins || [];
config.plugins.push({
apply(compiler: any) {
compiler.hooks.done.tap("SizeLimitStats", (stats: any) => {
const fs = require("fs");
const path = require("path");
const out = stats.toJson({
all: false,
assets: true,
chunks: true,
chunkGroups: true,
});
fs.writeFileSync(
path.join(process.cwd(), ".next", "size-limit-stats.json"),
JSON.stringify(out),
);
});
},
} as any);
}

return config;
},
images: {
Expand Down
21 changes: 20 additions & 1 deletion frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,26 @@ export default defineConfig({
exclude: ['node_modules/**', '.next/**', 'e2e/**', 'playwright-report/**', 'test-results/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
reporter: ['text', 'json', 'html', 'lcov'],
reportsDirectory: './coverage',
exclude: [
'node_modules/**',
'.next/**',
'e2e/**',
'playwright-report/**',
'test-results/**',
'**/*.config.*',
'**/*.d.ts',
'**/*.test.{ts,tsx}',
'**/vitest.setup.ts',
],
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
skipFull: true,
},
},
})
39 changes: 39 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":dependencyDashboard",
":semanticCommits",
":preserveSemverRanges",
"schedule:weekly",
"group:allNonMajor"
],
"labels": ["dependencies", "renovate"],
"assignees": ["mmesolove"],
"reviewers": ["mmesolove"],
"separateMajorMinor": true,
"ignoreMajor": false,
"packageRules": [
{
"matchUpdateTypes": ["major"],
"labels": ["dependencies", "major"]
},
{
"matchDepTypes": ["devDependencies"],
"labels": ["dependencies", "dev"]
}
],
"npm": {
"enabled": true
},
"lockFileMaintenance": {
"enabled": true,
"schedule": "before 9am on monday"
},
"postUpdateOptions": ["npmDedupe"],
"prConcurrentLimit": 10,
"prHourlyLimit": 2,
"timezone": "UTC",
"enabledManagers": ["npm", "github-actions"],
"baseBranches": ["main"]
}
Loading
Loading