Skip to content

Commit ad5df01

Browse files
committed
🚀 RARE 4N - Complete Platform Setup: Backend, Client Portal, Workflows, MCP Server, and Documentation
1 parent 8d53a43 commit ad5df01

File tree

132 files changed

+41874
-85
lines changed

Some content is hidden

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

132 files changed

+41874
-85
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@
4646
*.sqlite binary
4747
*.sqlite3 binary
4848

49+
50+
51+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build Android App
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'apps/mobile/**'
8+
- 'mobile/**'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'apps/mobile/**'
13+
- 'mobile/**'
14+
workflow_dispatch:
15+
inputs:
16+
profile:
17+
description: 'Build profile'
18+
required: true
19+
default: 'production'
20+
type: choice
21+
options:
22+
- development
23+
- preview
24+
- production
25+
26+
jobs:
27+
build-android:
28+
name: Build Android
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
cache: 'npm'
39+
40+
- name: Setup Expo
41+
uses: expo/expo-github-action@v8
42+
with:
43+
eas-version: latest
44+
token: ${{ secrets.EXPO_TOKEN }}
45+
46+
- name: Install dependencies
47+
working-directory: ./apps/mobile
48+
run: npm ci
49+
50+
- name: Build Android
51+
working-directory: ./apps/mobile
52+
run: |
53+
eas build --platform android \
54+
--profile ${{ github.event.inputs.profile || 'production' }} \
55+
--non-interactive \
56+
--no-wait
57+
env:
58+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
59+
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
60+
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
61+
62+
- name: Notify build completion
63+
if: always()
64+
run: |
65+
curl -X POST "${{ secrets.API_URL }}/api/auto-builder/build-complete" \
66+
-H "Content-Type: application/json" \
67+
-H "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
68+
-d '{
69+
"platform": "android",
70+
"profile": "${{ github.event.inputs.profile || 'production' }}",
71+
"status": "${{ job.status }}",
72+
"workflow": "${{ github.workflow }}",
73+
"run_id": "${{ github.run_id }}"
74+
}' || true
75+

.github/workflows/build-ios.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build iOS App
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'apps/mobile/**'
8+
- 'mobile/**'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'apps/mobile/**'
13+
- 'mobile/**'
14+
workflow_dispatch:
15+
inputs:
16+
profile:
17+
description: 'Build profile'
18+
required: true
19+
default: 'production'
20+
type: choice
21+
options:
22+
- development
23+
- preview
24+
- production
25+
26+
jobs:
27+
build-ios:
28+
name: Build iOS
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: '20'
38+
cache: 'npm'
39+
40+
- name: Setup Expo
41+
uses: expo/expo-github-action@v8
42+
with:
43+
eas-version: latest
44+
token: ${{ secrets.EXPO_TOKEN }}
45+
46+
- name: Install dependencies
47+
working-directory: ./apps/mobile
48+
run: npm ci
49+
50+
- name: Build iOS
51+
working-directory: ./apps/mobile
52+
run: |
53+
eas build --platform ios \
54+
--profile ${{ github.event.inputs.profile || 'production' }} \
55+
--non-interactive \
56+
--no-wait
57+
env:
58+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
59+
ASC_API_KEY_ID: ${{ secrets.ASC_API_KEY_ID }}
60+
ASC_API_KEY_ISSUER_ID: ${{ secrets.ASC_API_KEY_ISSUER_ID }}
61+
ASC_API_KEY_P8: ${{ secrets.ASC_API_KEY_P8 }}
62+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
63+
APPLE_SERVICE_ID: ${{ secrets.APPLE_SERVICE_ID }}
64+
65+
- name: Notify build completion
66+
if: always()
67+
run: |
68+
curl -X POST "${{ secrets.API_URL }}/api/auto-builder/build-complete" \
69+
-H "Content-Type: application/json" \
70+
-H "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
71+
-d '{
72+
"platform": "ios",
73+
"profile": "${{ github.event.inputs.profile || 'production' }}",
74+
"status": "${{ job.status }}",
75+
"workflow": "${{ github.workflow }}",
76+
"run_id": "${{ github.run_id }}"
77+
}' || true
78+

.github/workflows/deploy-web.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Deploy Web (Client Portal)
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths:
7+
- 'apps/client-portal/**'
8+
- 'apps/client-portal/**/*'
9+
pull_request:
10+
branches: [main, master]
11+
paths:
12+
- 'apps/client-portal/**'
13+
workflow_dispatch:
14+
15+
jobs:
16+
deploy-web:
17+
name: Deploy to Cloudflare Pages
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20'
27+
cache: 'npm'
28+
29+
- name: Install dependencies
30+
working-directory: ./apps/client-portal
31+
run: npm ci || npm install
32+
33+
- name: Build (if needed)
34+
working-directory: ./apps/client-portal
35+
run: |
36+
if [ -f "package.json" ] && grep -q '"build"' package.json; then
37+
npm run build
38+
else
39+
echo "No build step required"
40+
fi
41+
42+
- name: Deploy to Cloudflare Pages
43+
uses: cloudflare/pages-action@v1
44+
with:
45+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
46+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
47+
projectName: ${{ secrets.CLOUDFLARE_PAGES_PROJECT_NAME || 'rare4n-client-portal' }}
48+
directory: ./apps/client-portal
49+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Notify deployment completion
52+
if: always()
53+
run: |
54+
curl -X POST "${{ secrets.API_URL }}/api/auto-builder/deploy-complete" \
55+
-H "Content-Type: application/json" \
56+
-H "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
57+
-d '{
58+
"platform": "web",
59+
"status": "${{ job.status }}",
60+
"workflow": "${{ github.workflow }}",
61+
"run_id": "${{ github.run_id }}",
62+
"commit": "${{ github.sha }}"
63+
}' || true
64+
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Build Android App (Template)
2+
3+
# ✅ هذا template للاستخدام في بناءات العملاء المستقبلية
4+
# ✅ استبدل {{CLIENT_NAME}} و {{PROJECT_ID}} بالقيم الفعلية
5+
6+
on:
7+
push:
8+
branches: [main, master]
9+
paths:
10+
- 'apps/mobile/**'
11+
- 'mobile/**'
12+
workflow_dispatch:
13+
inputs:
14+
profile:
15+
description: 'Build profile'
16+
required: true
17+
default: 'production'
18+
type: choice
19+
options:
20+
- development
21+
- preview
22+
- production
23+
24+
jobs:
25+
build-android:
26+
name: Build Android - {{CLIENT_NAME}}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
cache: 'npm'
37+
38+
- name: Setup Expo
39+
uses: expo/expo-github-action@v8
40+
with:
41+
eas-version: latest
42+
token: ${{ secrets.EXPO_TOKEN }}
43+
44+
- name: Install dependencies
45+
working-directory: ./apps/mobile
46+
run: npm ci
47+
48+
- name: Build Android
49+
working-directory: ./apps/mobile
50+
run: |
51+
eas build --platform android \
52+
--profile ${{ github.event.inputs.profile || 'production' }} \
53+
--non-interactive \
54+
--no-wait
55+
env:
56+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
57+
GOOGLE_PLAY_SERVICE_ACCOUNT_JSON: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_JSON }}
58+
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
59+
60+
- name: Notify build completion
61+
if: always()
62+
run: |
63+
curl -X POST "${{ secrets.API_URL }}/api/auto-builder/build-complete" \
64+
-H "Content-Type: application/json" \
65+
-H "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
66+
-d '{
67+
"client": "{{CLIENT_NAME}}",
68+
"project_id": "{{PROJECT_ID}}",
69+
"platform": "android",
70+
"profile": "${{ github.event.inputs.profile || 'production' }}",
71+
"status": "${{ job.status }}",
72+
"workflow": "${{ github.workflow }}",
73+
"run_id": "${{ github.run_id }}"
74+
}' || true
75+
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build iOS App (Template)
2+
3+
# ✅ هذا template للاستخدام في بناءات العملاء المستقبلية
4+
# ✅ استبدل {{CLIENT_NAME}} و {{PROJECT_ID}} بالقيم الفعلية
5+
6+
on:
7+
push:
8+
branches: [main, master]
9+
paths:
10+
- 'apps/mobile/**'
11+
- 'mobile/**'
12+
workflow_dispatch:
13+
inputs:
14+
profile:
15+
description: 'Build profile'
16+
required: true
17+
default: 'production'
18+
type: choice
19+
options:
20+
- development
21+
- preview
22+
- production
23+
24+
jobs:
25+
build-ios:
26+
name: Build iOS - {{CLIENT_NAME}}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '20'
36+
cache: 'npm'
37+
38+
- name: Setup Expo
39+
uses: expo/expo-github-action@v8
40+
with:
41+
eas-version: latest
42+
token: ${{ secrets.EXPO_TOKEN }}
43+
44+
- name: Install dependencies
45+
working-directory: ./apps/mobile
46+
run: npm ci
47+
48+
- name: Build iOS
49+
working-directory: ./apps/mobile
50+
run: |
51+
eas build --platform ios \
52+
--profile ${{ github.event.inputs.profile || 'production' }} \
53+
--non-interactive \
54+
--no-wait
55+
env:
56+
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
57+
ASC_API_KEY_ID: ${{ secrets.ASC_API_KEY_ID }}
58+
ASC_API_KEY_ISSUER_ID: ${{ secrets.ASC_API_KEY_ISSUER_ID }}
59+
ASC_API_KEY_P8: ${{ secrets.ASC_API_KEY_P8 }}
60+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
61+
APPLE_SERVICE_ID: ${{ secrets.APPLE_SERVICE_ID }}
62+
63+
- name: Notify build completion
64+
if: always()
65+
run: |
66+
curl -X POST "${{ secrets.API_URL }}/api/auto-builder/build-complete" \
67+
-H "Content-Type: application/json" \
68+
-H "Authorization: Bearer ${{ secrets.API_TOKEN }}" \
69+
-d '{
70+
"client": "{{CLIENT_NAME}}",
71+
"project_id": "{{PROJECT_ID}}",
72+
"platform": "ios",
73+
"profile": "${{ github.event.inputs.profile || 'production' }}",
74+
"status": "${{ job.status }}",
75+
"workflow": "${{ github.workflow }}",
76+
"run_id": "${{ github.run_id }}"
77+
}' || true
78+

0 commit comments

Comments
 (0)