Skip to content

Commit 2c0d38b

Browse files
committed
Add files
1 parent e008175 commit 2c0d38b

167 files changed

Lines changed: 25911 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
8+
jobs:
9+
validate:
10+
runs-on: ubuntu-latest
11+
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
24+
25+
- name: Typecheck
26+
run: npm run typecheck
27+
28+
- name: Core integration tests
29+
run: |
30+
npm run test:practice
31+
npm run test:offline-queue
32+
npm run test:telemetry
33+
npm run test:task20-hardening

.github/workflows/expo-deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Expo Deploy (Manual)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: "EAS Update branch"
8+
required: true
9+
default: "preview"
10+
environment:
11+
description: "EAS environment"
12+
required: true
13+
default: "development"
14+
message:
15+
description: "Update message"
16+
required: true
17+
default: "CI manual update"
18+
19+
jobs:
20+
eas-update:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Node
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Setup Expo and EAS
37+
uses: expo/expo-github-action@v8
38+
with:
39+
eas-version: latest
40+
token: ${{ secrets.EXPO_TOKEN }}
41+
42+
- name: Publish EAS Update
43+
run: |
44+
npx eas update \
45+
--branch "${{ inputs.branch }}" \
46+
--environment "${{ inputs.environment }}" \
47+
--message "${{ inputs.message }}" \
48+
--platform all \
49+
--non-interactive

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Expo / React Native generated files
5+
.expo/
6+
dist/
7+
web-build/
8+
expo-env.d.ts
9+
.expo-shared/
10+
11+
# Build / coverage
12+
coverage/
13+
*.tsbuildinfo
14+
*.apk
15+
*.aab
16+
*.ipa
17+
18+
# Native credentials / signing material
19+
*.jks
20+
*.keystore
21+
*.p8
22+
*.p12
23+
*.key
24+
*.mobileprovision
25+
*.pem
26+
27+
# Logs
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
pnpm-debug.log*
32+
*.log
33+
34+
# Environment files
35+
.env
36+
.env.*
37+
!.env.example
38+
39+
# OS / editor
40+
.DS_Store
41+
Thumbs.db
42+
.idea/
43+
.vscode/
44+
45+
# Temporary / internal artifacts
46+
.forge/
47+
.kotlin/
48+
.metro-health-check*
49+
*.orig.*
50+
tmp/
51+
temp/
52+
53+
# Generated native folders (Expo prebuild)
54+
/ios
55+
/android

App.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
import { useEffect } from 'react';
3+
4+
import { AppLockGate } from './src/components/AppLockGate';
5+
import { DoubtHistoryProvider } from './src/hooks/DoubtHistoryContext';
6+
import { StudySessionProvider } from './src/hooks/StudySessionContext';
7+
import { SettingsProvider } from './src/hooks/SettingsContext';
8+
import { RootNavigator } from './src/navigation/RootNavigator';
9+
import { runGeminiDeviceStreamSmoke } from './src/ai/providers/geminiDeviceStreamSmoke';
10+
import { installRuntimeLogRedactionGuard } from './src/services/logSecurityGuard';
11+
12+
const shouldRunTask4DeviceSmoke =
13+
(globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env
14+
?.EXPO_PUBLIC_TASK4_DEVICE_SMOKE === '1';
15+
16+
export default function App() {
17+
useEffect(() => {
18+
installRuntimeLogRedactionGuard();
19+
20+
if (!shouldRunTask4DeviceSmoke) {
21+
return;
22+
}
23+
24+
void runGeminiDeviceStreamSmoke().catch((error: unknown) => {
25+
const message = error instanceof Error ? error.message : String(error);
26+
console.error('[GEMINI_DEVICE_SMOKE] FAIL', message);
27+
});
28+
}, []);
29+
30+
return (
31+
<SettingsProvider>
32+
<StudySessionProvider>
33+
<DoubtHistoryProvider>
34+
<AppLockGate>
35+
<RootNavigator />
36+
<StatusBar style="light" />
37+
</AppLockGate>
38+
</DoubtHistoryProvider>
39+
</StudySessionProvider>
40+
</SettingsProvider>
41+
);
42+
}

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# DoubtBuddy (JEE AI Study App)
2+
3+
Mobile-first React Native (Expo) app for JEE preparation with AI-assisted doubt solving, practice mode, revision scheduler, and progress analytics.
4+
5+
## Highlights
6+
7+
- AI doubt solving with provider orchestration (Gemini-first, fallback-ready)
8+
- Practice mode with configurable set sizes and grading flows
9+
- Revision mode with spaced-repetition scheduling
10+
- Progress dashboard with weak-topic drill-down
11+
- Offline queue for text solve replay
12+
13+
## Tech Stack
14+
15+
- Expo SDK 55 / React Native 0.83
16+
- TypeScript
17+
- AsyncStorage + SecureStore
18+
- React Navigation
19+
20+
## Getting Started
21+
22+
### Prerequisites
23+
24+
- Node.js 20+
25+
- npm 10+
26+
- Expo CLI via `npx`
27+
28+
### Install
29+
30+
```bash
31+
npm install
32+
```
33+
34+
### Run
35+
36+
```bash
37+
npm run start
38+
```
39+
40+
Then open on device/emulator using Expo Go (or development build).
41+
42+
## Quality Checks
43+
44+
```bash
45+
npm run typecheck
46+
npm run test:practice
47+
npm run test:offline-queue
48+
```
49+
50+
Additional test scripts are available in `package.json`.
51+
52+
## App Icon
53+
54+
Replace icon assets under `assets/`:
55+
56+
- `assets/icon.png`
57+
- optional Android adaptive icon assets if you use split foreground/background
58+
59+
Then run Expo with cache clear:
60+
61+
```bash
62+
npx expo start -c
63+
```
64+
65+
## CI/CD (GitHub Actions)
66+
67+
This repo includes:
68+
69+
- `ci.yml` for typecheck + test suite on push/PR
70+
- `expo-deploy.yml` for optional EAS Update publish on manual trigger
71+
72+
For deploy workflow, configure repository secrets before use:
73+
74+
- `EXPO_TOKEN`
75+
76+
Deployment workflow is manual (`workflow_dispatch`) so no credentials are exposed in code.
77+
78+
## License
79+
80+
Apache License 2.0 (you said you’ll add LICENSE manually).

app.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"expo": {
3+
"name": "DoubtBuddy",
4+
"slug": "doubtbuddy",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "dark",
9+
"splash": {
10+
"image": "./assets/splash-icon.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#070B14"
13+
},
14+
"ios": {
15+
"supportsTablet": true
16+
},
17+
"android": {
18+
"package": "com.doubtbuddy.app",
19+
"adaptiveIcon": {
20+
"backgroundColor": "#00000000",
21+
"foregroundImage": "./assets/android-icon-foreground.png",
22+
"backgroundImage": "./assets/android-icon-background.png",
23+
"monochromeImage": "./assets/android-icon-monochrome.png"
24+
},
25+
"predictiveBackGestureEnabled": false
26+
},
27+
"plugins": [
28+
[
29+
"expo-image-picker",
30+
{
31+
"photosPermission": "Allow DoubtBuddy to access and pick study photos.",
32+
"cameraPermission": "Allow DoubtBuddy to capture question photos.",
33+
"microphonePermission": false
34+
}
35+
],
36+
[
37+
"expo-secure-store",
38+
{
39+
"faceIDPermission": "Allow DoubtBuddy to use Face ID for secure key access."
40+
}
41+
]
42+
],
43+
"web": {
44+
"favicon": "./assets/favicon.png"
45+
},
46+
"extra": {
47+
"eas": {
48+
"projectId": "b0727f10-2b44-4cd5-98de-050e359834a5"
49+
}
50+
},
51+
"runtimeVersion": {
52+
"policy": "appVersion"
53+
},
54+
"updates": {
55+
"url": "https://u.expo.dev/b0727f10-2b44-4cd5-98de-050e359834a5"
56+
}
57+
}
58+
}

assets/android-icon-background.png

4.1 KB
Loading

assets/android-icon-foreground.png

52.5 KB
Loading

assets/android-icon-monochrome.png

12.8 KB
Loading

assets/favicon.png

1.1 KB
Loading

0 commit comments

Comments
 (0)