Skip to content

Commit 3b28625

Browse files
feat: Initial StripeFlow implementation
- Complete payment processing platform with Spring Boot backend - React TypeScript frontend with modern UI components - Docker containerization with multi-stage builds - Kubernetes deployment configuration - Comprehensive API documentation with OpenAPI/Swagger - High-performance caching with Redis - Database optimization with advanced indexing - CI/CD pipeline with GitHub Actions - Monitoring and alerting with Prometheus/Grafana - Security scanning and compliance features - Performance testing and load testing capabilities - Complete documentation and setup guides Features: - Payment processing (charges, refunds, subscriptions) - Customer management with full lifecycle - Webhook system with retry logic - Real-time analytics dashboard - Multi-currency support - Enterprise security and compliance - High availability and scalability - 1000+ TPS performance capability
0 parents  commit 3b28625

File tree

147 files changed

+18922
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+18922
-0
lines changed

.github/workflows/cd.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Continuous Deployment
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
release:
7+
types: [ published ]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
# Deploy to Staging
15+
deploy-staging:
16+
runs-on: ubuntu-latest
17+
if: github.ref == 'refs/heads/develop'
18+
environment: staging
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Build and push images
35+
run: |
36+
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:staging ./backend
37+
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:staging ./frontend
38+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:staging
39+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:staging
40+
41+
- name: Deploy to staging
42+
run: |
43+
echo "Deploying to staging environment..."
44+
# Add your staging deployment commands here
45+
# Example: kubectl apply -f k8s/staging/
46+
47+
# Deploy to Production
48+
deploy-production:
49+
runs-on: ubuntu-latest
50+
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
51+
environment: production
52+
needs: []
53+
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@v3
60+
61+
- name: Log in to Container Registry
62+
uses: docker/login-action@v3
63+
with:
64+
registry: ${{ env.REGISTRY }}
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Extract version
69+
id: version
70+
run: |
71+
if [ "${{ github.event_name }}" = "release" ]; then
72+
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
73+
else
74+
echo "version=latest" >> $GITHUB_OUTPUT
75+
fi
76+
77+
- name: Build and push production images
78+
run: |
79+
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:${{ steps.version.outputs.version }} ./backend
80+
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:${{ steps.version.outputs.version }} ./frontend
81+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:${{ steps.version.outputs.version }}
82+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:${{ steps.version.outputs.version }}
83+
84+
- name: Deploy to production
85+
run: |
86+
echo "Deploying to production environment..."
87+
# Add your production deployment commands here
88+
# Example: kubectl apply -f k8s/production/
89+
90+
- name: Run smoke tests
91+
run: |
92+
echo "Running smoke tests..."
93+
# Add smoke test commands here
94+
# Example: curl -f https://api.stripeflow.com/health
95+
96+
- name: Notify deployment
97+
if: always()
98+
uses: 8398a7/action-slack@v3
99+
with:
100+
status: ${{ job.status }}
101+
channel: '#deployments'
102+
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
103+
fields: repo,message,commit,author,action,eventName,ref,workflow
104+
105+
# Rollback on failure
106+
rollback:
107+
runs-on: ubuntu-latest
108+
if: failure()
109+
needs: [deploy-production]
110+
111+
steps:
112+
- name: Rollback deployment
113+
run: |
114+
echo "Rolling back deployment..."
115+
# Add rollback commands here
116+
# Example: kubectl rollout undo deployment/stripeflow-backend
117+
118+
- name: Notify rollback
119+
uses: 8398a7/action-slack@v3
120+
with:
121+
status: failure
122+
channel: '#deployments'
123+
webhook_url: ${{ secrets.SLACK_WEBHOOK }}
124+
fields: repo,message,commit,author,action,eventName,ref,workflow

.github/workflows/ci.yml

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
# Backend Tests
15+
backend-test:
16+
runs-on: ubuntu-latest
17+
18+
services:
19+
postgres:
20+
image: postgres:15
21+
env:
22+
POSTGRES_PASSWORD: postgres
23+
POSTGRES_DB: stripeflow_test
24+
options: >-
25+
--health-cmd pg_isready
26+
--health-interval 10s
27+
--health-timeout 5s
28+
--health-retries 5
29+
ports:
30+
- 5432:5432
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
36+
- name: Set up JDK 17
37+
uses: actions/setup-java@v3
38+
with:
39+
java-version: '17'
40+
distribution: 'temurin'
41+
42+
- name: Cache Maven dependencies
43+
uses: actions/cache@v3
44+
with:
45+
path: ~/.m2
46+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
47+
restore-keys: ${{ runner.os }}-m2
48+
49+
- name: Run backend tests
50+
run: |
51+
cd backend
52+
mvn clean test
53+
54+
- name: Generate test report
55+
uses: dorny/test-reporter@v1
56+
if: success() || failure()
57+
with:
58+
name: Backend Test Results
59+
path: backend/target/surefire-reports/*.xml
60+
reporter: java-junit
61+
62+
# Frontend Tests
63+
frontend-test:
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- name: Checkout code
68+
uses: actions/checkout@v4
69+
70+
- name: Set up Node.js
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: '18'
74+
cache: 'npm'
75+
cache-dependency-path: frontend/package-lock.json
76+
77+
- name: Install dependencies
78+
run: |
79+
cd frontend
80+
npm ci
81+
82+
- name: Run linting
83+
run: |
84+
cd frontend
85+
npm run lint
86+
87+
- name: Run frontend tests
88+
run: |
89+
cd frontend
90+
npm run test:ci
91+
92+
- name: Upload coverage to Codecov
93+
uses: codecov/codecov-action@v3
94+
with:
95+
file: ./frontend/coverage/lcov.info
96+
flags: frontend
97+
name: frontend-coverage
98+
99+
# Security Scanning
100+
security-scan:
101+
runs-on: ubuntu-latest
102+
needs: [backend-test, frontend-test]
103+
104+
steps:
105+
- name: Checkout code
106+
uses: actions/checkout@v4
107+
108+
- name: Run Trivy vulnerability scanner
109+
uses: aquasecurity/trivy-action@master
110+
with:
111+
scan-type: 'fs'
112+
scan-ref: '.'
113+
format: 'sarif'
114+
output: 'trivy-results.sarif'
115+
116+
- name: Upload Trivy scan results to GitHub Security tab
117+
uses: github/codeql-action/upload-sarif@v2
118+
if: always()
119+
with:
120+
sarif_file: 'trivy-results.sarif'
121+
122+
# Build and Test Docker Images
123+
docker-build:
124+
runs-on: ubuntu-latest
125+
needs: [backend-test, frontend-test]
126+
if: github.event_name == 'push'
127+
128+
steps:
129+
- name: Checkout code
130+
uses: actions/checkout@v4
131+
132+
- name: Set up Docker Buildx
133+
uses: docker/setup-buildx-action@v3
134+
135+
- name: Log in to Container Registry
136+
uses: docker/login-action@v3
137+
with:
138+
registry: ${{ env.REGISTRY }}
139+
username: ${{ github.actor }}
140+
password: ${{ secrets.GITHUB_TOKEN }}
141+
142+
- name: Extract metadata
143+
id: meta
144+
uses: docker/metadata-action@v5
145+
with:
146+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
147+
tags: |
148+
type=ref,event=branch
149+
type=ref,event=pr
150+
type=sha,prefix={{branch}}-
151+
type=raw,value=latest,enable={{is_default_branch}}
152+
153+
- name: Build and push backend image
154+
uses: docker/build-push-action@v5
155+
with:
156+
context: ./backend
157+
push: true
158+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:${{ github.sha }}
159+
labels: ${{ steps.meta.outputs.labels }}
160+
161+
- name: Build and push frontend image
162+
uses: docker/build-push-action@v5
163+
with:
164+
context: ./frontend
165+
push: true
166+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:${{ github.sha }}
167+
labels: ${{ steps.meta.outputs.labels }}
168+
169+
# Integration Tests
170+
integration-test:
171+
runs-on: ubuntu-latest
172+
needs: [docker-build]
173+
if: github.event_name == 'push'
174+
175+
steps:
176+
- name: Checkout code
177+
uses: actions/checkout@v4
178+
179+
- name: Set up Docker Buildx
180+
uses: docker/setup-buildx-action@v3
181+
182+
- name: Create test environment
183+
run: |
184+
docker-compose -f docker-compose.yml up -d postgres redis
185+
sleep 30
186+
187+
- name: Run integration tests
188+
run: |
189+
docker-compose -f docker-compose.yml run --rm backend mvn test -Dspring.profiles.active=test
190+
191+
- name: Cleanup
192+
if: always()
193+
run: |
194+
docker-compose -f docker-compose.yml down -v

.github/workflows/release.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Log in to Container Registry
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ${{ env.REGISTRY }}
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Extract metadata
34+
id: meta
35+
uses: docker/metadata-action@v5
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
type=ref,event=branch
40+
type=ref,event=pr
41+
type=semver,pattern={{version}}
42+
type=semver,pattern={{major}}.{{minor}}
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
45+
- name: Build and push backend image
46+
uses: docker/build-push-action@v5
47+
with:
48+
context: ./backend
49+
push: true
50+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-backend:${{ github.ref_name }}
51+
labels: ${{ steps.meta.outputs.labels }}
52+
53+
- name: Build and push frontend image
54+
uses: docker/build-push-action@v5
55+
with:
56+
context: ./frontend
57+
push: true
58+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-frontend:${{ github.ref_name }}
59+
labels: ${{ steps.meta.outputs.labels }}
60+
61+
create-release:
62+
runs-on: ubuntu-latest
63+
needs: build-and-push
64+
65+
steps:
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
69+
- name: Create Release
70+
uses: actions/create-release@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
tag_name: ${{ github.ref }}
75+
release_name: Release ${{ github.ref }}
76+
draft: false
77+
prerelease: false
78+

0 commit comments

Comments
 (0)