Skip to content

Commit 1d4e861

Browse files
author
AI Assistant
committed
Update project with latest changes and new features
1 parent dfc6b59 commit 1d4e861

25 files changed

Lines changed: 1156 additions & 25 deletions

‎.env.example‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Copy this file to .env and set your server-side Gemini API key
22
GEMINI_API_KEY=
3+
4+
# Optional client-side Sentry DSN for error monitoring
5+
VITE_SENTRY_DSN=

‎.github/workflows/ci.yml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
quality:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: npm
21+
22+
- name: Install Dependencies
23+
run: npm ci --legacy-peer-deps
24+
25+
- name: Lint
26+
run: npm run lint
27+
28+
- name: Test
29+
run: npm run test
30+
31+
- name: Build
32+
run: npm run build
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Preview Artifact
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
preview:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- name: Install Dependencies
21+
run: npm ci --legacy-peer-deps
22+
23+
- name: Build Preview
24+
run: npm run build
25+
26+
- name: Upload Preview Artifact
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: web-preview-dist
30+
path: dist

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Generate GitHub Release Notes
19+
uses: softprops/action-gh-release@v2
20+
with:
21+
generate_release_notes: true

‎.github/workflows/uptime.yml‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Uptime Checks
2+
3+
on:
4+
schedule:
5+
- cron: '*/30 * * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
uptime:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Node
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
20+
- name: Run Uptime Checks
21+
env:
22+
UPTIME_WEB_URL: https://abdullahmalik-ctrl.github.io/Jarvis-Cali/
23+
UPTIME_API_HEALTH_URL: ${{ secrets.UPTIME_API_HEALTH_URL }}
24+
run: node scripts/uptime-check.mjs

‎README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ Notes:
162162
### 🧠 Practice Mode Feature
163163

164164
- AI-generated quizzes based on topic, difficulty, and question count.
165+
- Curated question bank with difficulty tags and curriculum mapping (General, Common Core, IGCSE, SAT).
166+
- Hybrid generation strategy: approved curated items first, then AI fallback for missing coverage.
167+
- Built-in solution quality review queue for AI-generated questions (approve / needs work workflow).
165168
- Topic presets: Algebra, Calculus, Geometry, Trigonometry, Arithmetic, Statistics.
166169
- Per-question feedback with explanation.
167170
- End-of-quiz summary with score/percentage and retry flow.
@@ -173,6 +176,20 @@ Notes:
173176
- Select and persist preferred model.
174177
- Theme toggling.
175178
- Progressive Web App install prompt integration when available.
179+
- Offline action queue for tutor/practice requests.
180+
- Background sync trigger for queued actions when connectivity returns.
181+
- Conflict-safe queue replay strategy (last-write-wins per conflict key).
182+
- In-app update toast when a new service worker version is available.
183+
184+
### 🧪 Content Quality Workflow
185+
186+
- `curatedQuestionBank.js` stores approved baseline content with metadata:
187+
- `topic`
188+
- `difficulty`
189+
- `curriculumTag`
190+
- `quality.status`
191+
- `questionBankService.js` handles filtering and review override state.
192+
- `qualityReviewService.js` tracks generated-question review queue and outcomes.
176193

177194
## 🏗️ Architecture Highlights
178195

@@ -194,10 +211,28 @@ Notes:
194211
- `npm run dev` - run proxy server + Vite together 🚀
195212
- `npm run server` - run secure proxy server only 🔐
196213
- `npm run build` - create production bundle 🏗️
214+
- `npm run test` - run smoke tests ✅
197215
- `npm run preview` - preview production build locally 👀
198216
- `npm run lint` - run ESLint 🧹
199217
- `npm run deploy` - deploy `dist` to GitHub Pages 🌐
200218

219+
## 🔁 Professional DevOps
220+
221+
GitHub Actions workflows included:
222+
223+
- `.github/workflows/ci.yml`
224+
- Runs lint, tests, and production build on push/PR.
225+
- `.github/workflows/preview-artifact.yml`
226+
- Builds PR preview artifact (`dist`) for quick QA download.
227+
- `.github/workflows/uptime.yml`
228+
- Scheduled uptime checks for live web URL and optional API health URL.
229+
- `.github/workflows/release.yml`
230+
- Auto-generates GitHub release notes for `v*` tags.
231+
232+
Optional monitoring:
233+
234+
- Frontend Sentry via `VITE_SENTRY_DSN`.
235+
201236
## 🚢 Deployment
202237

203238
### 🐙 GitHub Pages (configured)

‎index.html‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@
1313
<body>
1414
<div id="root"></div>
1515
<script type="module" src="/src/main.jsx"></script>
16-
<script>
17-
if ('serviceWorker' in navigator) {
18-
window.addEventListener('load', () => {
19-
navigator.serviceWorker.register('/Jarvis-Cali/sw.js')
20-
.then(registration => {
21-
console.log('SW registered: ', registration);
22-
})
23-
.catch(registrationError => {
24-
console.log('SW registration failed: ', registrationError);
25-
});
26-
});
27-
}
28-
</script>
2916
</body>
3017

3118
</html>

‎package-lock.json‎

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"dev": "concurrently \"npm run server\" \"vite\"",
99
"server": "node server/index.js",
1010
"build": "vite build",
11+
"test": "node --test tests",
1112
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
1213
"preview": "vite preview",
1314
"predeploy": "npm run build",
@@ -25,6 +26,7 @@
2526
"react": "^18.2.0",
2627
"react-dom": "^18.2.0",
2728
"react-markdown": "^10.1.0",
29+
"@sentry/react": "^10.17.0",
2830
"rehype-katex": "^7.0.1",
2931
"remark-math": "^6.0.0",
3032
"three": "^0.183.0"

‎public/sw.js‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const CACHE_NAME = 'jarvis-math-v5';
1+
const CACHE_NAME = 'jarvis-math-v6';
22
const urlsToCache = [
33
'./',
44
'./index.html',
@@ -16,6 +16,27 @@ self.addEventListener('install', (event) => {
1616
);
1717
});
1818

19+
const notifyClients = async (message) => {
20+
const clients = await self.clients.matchAll({ includeUncontrolled: true, type: 'window' });
21+
clients.forEach((client) => client.postMessage(message));
22+
};
23+
24+
self.addEventListener('message', (event) => {
25+
if (event.data?.type === 'SKIP_WAITING') {
26+
self.skipWaiting();
27+
}
28+
29+
if (event.data?.type === 'REQUEST_SYNC') {
30+
event.waitUntil(notifyClients({ type: 'jarvis-sync-now' }));
31+
}
32+
});
33+
34+
self.addEventListener('sync', (event) => {
35+
if (event.tag === 'jarvis-sync') {
36+
event.waitUntil(notifyClients({ type: 'jarvis-sync-now' }));
37+
}
38+
});
39+
1940
self.addEventListener('fetch', (event) => {
2041
event.respondWith(
2142
fetch(event.request)

0 commit comments

Comments
 (0)