Skip to content
Open
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
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,51 @@ jobs:
env:
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_STELLAR_NETWORK: TESTNET

lighthouse:
name: Lighthouse CI (90+ all categories)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build production
run: npm run build
env:
NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_STELLAR_NETWORK: TESTNET

- name: Install Lighthouse CI
run: npm install -g @lhci/cli@0.14.0

- name: Start server and run Lighthouse CI
run: |
npm start &
SERVER_PID=$!
echo "Server PID: $SERVER_PID"
for i in $(seq 1 30); do
curl -sf http://localhost:3000 > /dev/null 2>&1 && echo "Server ready after ${i}s" && break
sleep 2
done
lhci autorun
kill $SERVER_PID 2>/dev/null || true
env:
PORT: 3000
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

- name: Upload Lighthouse results
if: always()
uses: actions/upload-artifact@v4
with:
name: lighthouse-results-${{ github.run_number }}
path: .lighthouseci/
retention-days: 30
14 changes: 11 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ jobs:
deploy-preview:
name: Deploy Preview to Unique URL
runs-on: ubuntu-latest
if: github.event.action != 'closed'
if: github.event.action != 'closed' && secrets.VERCEL_TOKEN != ''
steps:
- uses: actions/checkout@v4

- name: Skip if Vercel secrets not configured
if: ${{ !secrets.VERCEL_TOKEN }}
run: echo "⏭️ Vercel secrets not configured — skipping preview deployment"

- name: Deploy to Vercel
if: ${{ secrets.VERCEL_TOKEN != '' }}
uses: amondnet/vercel-action@v25
id: vercel-deploy
with:
Expand All @@ -22,6 +27,7 @@ jobs:
scope: ${{ secrets.VERCEL_ORG_ID }}

- name: Comment preview link on PR
if: ${{ secrets.VERCEL_TOKEN != '' && steps.vercel-deploy.outputs.preview-url != '' }}
uses: actions/github-script@v7
with:
script: |
Expand All @@ -35,14 +41,16 @@ jobs:
cleanup-preview:
name: Auto-delete Preview
runs-on: ubuntu-latest
if: github.event.action == 'closed'
if: github.event.action == 'closed' && secrets.VERCEL_TOKEN != ''
steps:
- name: Delete Vercel Preview
if: ${{ secrets.VERCEL_TOKEN != '' }}
run: |
curl -X DELETE "https://api.vercel.com/v13/deployments/${{ github.event.pull_request.head.sha }}" \
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}"
-H "Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}" || true

- name: Comment cleanup
if: ${{ secrets.VERCEL_TOKEN != '' }}
uses: actions/github-script@v7
with:
script: |
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/uptime-monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,42 @@ name: Uptime Monitor

on:
schedule:
- cron: '*/1 * * * *' # Every 1 minute
- cron: '*/15 * * * *' # Every 15 minutes (reduced from 1 min to avoid noise)
workflow_dispatch:

jobs:
monitor:
name: Check Production Uptime
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Check homepage
id: homepage
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://aframp.vercel.app/)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://aframp.vercel.app/ || echo "000")
if [ "$STATUS" != "200" ]; then
echo "status=down" >> $GITHUB_OUTPUT
echo "❌ Homepage down (HTTP $STATUS)"
exit 1
echo "⚠️ Homepage returned HTTP $STATUS"
else
echo "status=up" >> $GITHUB_OUTPUT
echo "✅ Homepage up"
fi
echo "status=up" >> $GITHUB_OUTPUT
echo "✅ Homepage up"

- name: Check onramp page
id: onramp
run: |
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://aframp.vercel.app/onramp)
STATUS=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://aframp.vercel.app/onramp || echo "000")
if [ "$STATUS" != "200" ]; then
echo "status=down" >> $GITHUB_OUTPUT
echo "❌ Onramp page down (HTTP $STATUS)"
exit 1
echo "⚠️ Onramp page returned HTTP $STATUS"
else
echo "status=up" >> $GITHUB_OUTPUT
echo "✅ Onramp page up"
fi
echo "status=up" >> $GITHUB_OUTPUT
echo "✅ Onramp page up"

- name: Alert on downtime
if: failure()
if: steps.homepage.outputs.status == 'down' || steps.onramp.outputs.status == 'down'
uses: actions/github-script@v7
with:
script: |
console.log(`🚨 ALERT: AFRAMP is DOWN\n\nTime: ${new Date().toISOString()}\nHomepage: ${{ steps.homepage.outputs.status }}\nOnramp: ${{ steps.onramp.outputs.status }}\n\nCheck: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}`);
console.log(`🚨 ALERT: AFRAMP may be DOWN\n\nTime: ${new Date().toISOString()}\nHomepage: ${{ steps.homepage.outputs.status }}\nOnramp: ${{ steps.onramp.outputs.status }}\n\nCheck: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}`);
1 change: 1 addition & 0 deletions .kiro/specs/vercel-analytics-split-testing/.config.kiro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"specId": "094ff45b-b4ae-4bfc-bc39-fb9f0f813205", "workflowType": "requirements-first", "specType": "feature"}
19 changes: 16 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ const manrope = Manrope({
subsets: ['latin'],
variable: '--font-manrope',
display: 'swap',
preload: false,
preload: true,
})

const outfit = Outfit({
subsets: ['latin'],
variable: '--font-cal-sans',
display: 'swap',
preload: false,
preload: true,
})

const spaceMono = Space_Mono({
Expand All @@ -42,7 +42,20 @@ export const metadata: Metadata = {
'fintech',
'Aframp',
],
generator: 'v0.app',
generator: 'Next.js',
robots: {
index: true,
follow: true,
googleBot: { index: true, follow: true },
},
openGraph: {
title: 'Aframp - Buy Crypto, Pay Bills & Send Money in Africa',
description:
"Africa's premier cNGN stablecoin payment platform. Buy crypto from ₦2,000, pay bills instantly, and send money across 12 African countries.",
type: 'website',
locale: 'en_NG',
siteName: 'Aframp',
},
}

export const viewport: Viewport = {
Expand Down
35 changes: 28 additions & 7 deletions lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,41 @@
"ci": {
"collect": {
"numberOfRuns": 3,
"startServerCommand": "npm start",
"url": [
"http://localhost:3000",
"http://localhost:3000/onramp",
"http://localhost:3000/dashboard"
]
],
"settings": {
"chromeFlags": "--no-sandbox --disable-dev-shm-usage",
"throttlingMethod": "simulate",
"formFactor": "desktop",
"screenEmulation": {
"mobile": false,
"width": 1350,
"height": 940,
"deviceScaleFactor": 1,
"disabled": false
}
}
},
"assert": {
"preset": "lighthouse:recommended",
"assertions": {
"categories:performance": ["error", { "minScore": 0.8 }],
"categories:accessibility": ["error", { "minScore": 0.9 }],
"categories:best-practices": ["error", { "minScore": 0.85 }],
"categories:seo": ["error", { "minScore": 0.85 }]
"categories:performance": ["error", { "minScore": 0.9 }],
"categories:accessibility": ["error", { "minScore": 0.9 }],
"categories:best-practices": ["error", { "minScore": 0.9 }],
"categories:seo": ["error", { "minScore": 0.9 }],

"cumulative-layout-shift": ["error", { "maxNumericValue": 0.1 }],
"largest-contentful-paint": ["error", { "maxNumericValue": 2500 }],
"total-blocking-time": ["error", { "maxNumericValue": 300 }],
"first-contentful-paint": ["error", { "maxNumericValue": 1800 }],

"document-title": ["error", { "minScore": 1 }],
"meta-description": ["error", { "minScore": 1 }],
"html-has-lang": ["error", { "minScore": 1 }],
"image-alt": ["error", { "minScore": 1 }],
"button-name": ["error", { "minScore": 1 }]
}
},
"upload": {
Expand Down
20 changes: 19 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,28 @@ const nextConfig = {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
// Allow optimized images for Lighthouse Best Practices score
unoptimized: false,
formats: ['image/avif', 'image/webp'],
minimumCacheTTL: 60,
},
// Enable standalone output for Docker deployments
output: 'standalone',
// Security headers — improves Best Practices score
async headers() {
return [
{
source: '/(.*)',
headers: [
{ key: 'X-Content-Type-Options', value: 'nosniff' },
{ key: 'X-Frame-Options', value: 'DENY' },
{ key: 'X-XSS-Protection', value: '1; mode=block' },
{ key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
{ key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' },
],
},
]
},
}

export default nextConfig
Loading