algocoach 0.1.3 β 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -21
- package/README.md +173 -66
- package/cli/index.ts +9 -7
- package/dist/assets/index-C1FVIsAd.js +55 -0
- package/dist/index.html +1 -1
- package/package.json +2 -1
- package/server/db/schema.ts +1 -0
- package/server/db/setup.ts +9 -0
- package/server/index.ts +5 -0
- package/server/local-dev/.gitkeep +0 -0
- package/server/middleware/rate-limit.ts +7 -0
- package/server/routes/onboard.ts +0 -1
- package/server/routes/plan.ts +66 -27
- package/server/services/ai.ts +8 -1
- package/dist/assets/index-D5iezweF.js +0 -55
- package/server/local-dev/test-ai.ts +0 -88
package/README.md
CHANGED
|
@@ -1,101 +1,208 @@
|
|
|
1
|
-
# AlgoCoach
|
|
1
|
+
# AlgoCoach π―
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="https://img.shields.io/npm/v/algocoach" alt="npm version">
|
|
5
|
+
<img src="https://img.shields.io/badge/license-AGPLv3-blue" alt="license">
|
|
6
|
+
<img src="https://img.shields.io/badge/runtime-Bun-%23f9f9f9" alt="bun">
|
|
7
|
+
<img src="https://img.shields.io/badge/AI-Google%20|%20Groq%20|%20NVIDIA-orange" alt="AI providers">
|
|
8
|
+
</p>
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
<p align="center">
|
|
11
|
+
<b>AI-powered LeetCode study planner</b><br>
|
|
12
|
+
Personalized roadmaps, daily problem sets, progress tracking β all local, all private.
|
|
13
|
+
</p>
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
- An AI provider API key (Google Gemini, Groq, or NVIDIA NIM)
|
|
15
|
+
<br>
|
|
9
16
|
|
|
10
|
-
|
|
17
|
+
<p align="center">
|
|
18
|
+
<kbd>
|
|
19
|
+
<img src="screenshots/dashboard.png" alt="AlgoCoach Dashboard" width="700">
|
|
20
|
+
</kbd>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<em>Dashboard showing today's plan, roadmap progress, and LeetCode stats</em>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## β¨ Features
|
|
30
|
+
|
|
31
|
+
| | Feature | Description |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| πΊοΈ | **AI Roadmap** | Personalized multi-week study plan based on your skill level and goals |
|
|
34
|
+
| π
| **Daily Plans** | 3 curated problems (Easy + Medium + Hard) every day β never wonder what to solve |
|
|
35
|
+
| π | **Auto-refresh** | Stuck on a problem? Replace it with an easier one or regenerate the whole set |
|
|
36
|
+
| π | **Progress Tracking** | Solved/tried/skipped counts, streaks, and topic-level progress |
|
|
37
|
+
| π | **LeetCode Sync** | Link your LeetCode account to auto-fetch your stats |
|
|
38
|
+
| π | **100% Local** | Database stored at `~/.algocoach/data.db`. No cloud, no signup, no data leaks |
|
|
39
|
+
| π | **AI Anywhere** | Works with Google Gemini, Groq, or NVIDIA NIM |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## π Quick Start
|
|
11
44
|
|
|
12
45
|
```bash
|
|
13
|
-
# Install
|
|
46
|
+
# Install (requires Bun)
|
|
14
47
|
npm install -g algocoach
|
|
15
48
|
|
|
16
|
-
# Start
|
|
49
|
+
# Start β creates config, opens browser
|
|
17
50
|
algocoach start
|
|
18
|
-
|
|
19
|
-
# Open http://localhost:3000
|
|
20
51
|
```
|
|
21
52
|
|
|
22
|
-
|
|
53
|
+
<p align="center">
|
|
54
|
+
<img src="screenshots/cli-demo.gif" alt="CLI Demo" width="600">
|
|
55
|
+
</p>
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## π₯οΈ Screenshots
|
|
60
|
+
|
|
61
|
+
<p align="center">
|
|
62
|
+
<table>
|
|
63
|
+
<tr>
|
|
64
|
+
<td align="center">
|
|
65
|
+
<img src="screenshots/onboard.png" alt="Onboarding" width="350"><br>
|
|
66
|
+
<em>Skill survey</em>
|
|
67
|
+
</td>
|
|
68
|
+
<td align="center">
|
|
69
|
+
<img src="screenshots/roadmap.png" alt="Roadmap" width="350"><br>
|
|
70
|
+
<em>AI-generated roadmap</em>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
<tr>
|
|
74
|
+
<td align="center">
|
|
75
|
+
<img src="screenshots/daily-plan.png" alt="Daily Plan" width="350"><br>
|
|
76
|
+
<em>Today's problems</em>
|
|
77
|
+
</td>
|
|
78
|
+
<td align="center">
|
|
79
|
+
<img src="screenshots/stats.png" alt="Stats" width="350"><br>
|
|
80
|
+
<em>Progress & streaks</em>
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
</table>
|
|
84
|
+
</p>
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## π Usage
|
|
89
|
+
|
|
90
|
+
### First Time
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
algocoach start
|
|
94
|
+
```
|
|
23
95
|
|
|
24
|
-
|
|
25
|
-
2. Edit `~/.algocoach/.env` β uncomment and set at least one API key:
|
|
96
|
+
This creates `~/.algocoach/.env`. Edit it to set your AI provider API key:
|
|
26
97
|
|
|
27
98
|
```env
|
|
28
99
|
AI_PROVIDER=google
|
|
29
|
-
GEMINI_API_KEY=
|
|
100
|
+
GEMINI_API_KEY=AIza...
|
|
30
101
|
```
|
|
31
102
|
|
|
32
|
-
|
|
103
|
+
Then run `algocoach start` again.
|
|
33
104
|
|
|
34
|
-
###
|
|
105
|
+
### Commands
|
|
35
106
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
| NVIDIA NIM | https://build.nvidia.com |
|
|
107
|
+
```bash
|
|
108
|
+
algocoach start # Create config if needed + start server + open browser
|
|
109
|
+
algocoach init # Only create config file
|
|
110
|
+
```
|
|
41
111
|
|
|
42
|
-
|
|
112
|
+
### Daily Workflow
|
|
43
113
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
114
|
+
```
|
|
115
|
+
1. Open http://localhost:3000
|
|
116
|
+
2. Complete the onboarding survey
|
|
117
|
+
3. Link your LeetCode username
|
|
118
|
+
4. Generate a roadmap (AI creates a study plan)
|
|
119
|
+
5. Open "Today's Plan" β solve 3 curated problems
|
|
120
|
+
6. Track progress daily
|
|
121
|
+
```
|
|
49
122
|
|
|
50
|
-
###
|
|
123
|
+
### Regenerating Problems
|
|
51
124
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| `algocoach init` | Create .env only |
|
|
56
|
-
| `algocoach serve` | Start server (alias for `start`) |
|
|
125
|
+
- **Per problem**: Click the β» icon next to any problem to replace it
|
|
126
|
+
- **All problems**: Click "Regenerate" to get 3 entirely new problems
|
|
127
|
+
- **Stuck?**: Click "I'm stuck" on a tried problem to get an easier one
|
|
57
128
|
|
|
58
|
-
|
|
129
|
+
---
|
|
59
130
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
131
|
+
## βοΈ Configuration
|
|
132
|
+
|
|
133
|
+
| Variable | Default | Description |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `AI_PROVIDER` | `google` | `google`, `groq`, or `nvidia` |
|
|
136
|
+
| `GEMINI_API_KEY` | β | Google Gemini API key |
|
|
137
|
+
| `GROQ_API_KEY` | β | Groq API key |
|
|
138
|
+
| `NVIDIA_API_KEY` | β | NVIDIA NIM API key |
|
|
139
|
+
| `AI_MODEL` | (provider default) | Override the AI model |
|
|
140
|
+
| `PORT` | `3000` | Server port (auto-fallsback if busy) |
|
|
141
|
+
|
|
142
|
+
Config file: `~/.algocoach/.env`
|
|
143
|
+
|
|
144
|
+
### Get an API Key
|
|
145
|
+
|
|
146
|
+
| Provider | Get Key | Free Tier |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| **Google Gemini** | [aistudio.google.com](https://aistudio.google.com) | β
Yes |
|
|
149
|
+
| **Groq** | [console.groq.com](https://console.groq.com) | β
Yes (fast!) |
|
|
150
|
+
| **NVIDIA NIM** | [build.nvidia.com](https://build.nvidia.com) | β
Yes |
|
|
151
|
+
|
|
152
|
+
---
|
|
68
153
|
|
|
69
|
-
## Architecture
|
|
154
|
+
## ποΈ Architecture
|
|
70
155
|
|
|
71
156
|
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
157
|
+
βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
158
|
+
β algocoach CLI β
|
|
159
|
+
β start / init / serve β
|
|
160
|
+
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
|
|
161
|
+
β
|
|
162
|
+
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
|
|
163
|
+
β Hono HTTP Server β
|
|
164
|
+
β API routes + Static frontend (dist/) β
|
|
165
|
+
βββββββββ¬ββββββββββββββββββββββ¬ββββββββββββββββ
|
|
166
|
+
β β
|
|
167
|
+
βββββββββΌββββββββ ββββββββββΌβββββββββ
|
|
168
|
+
β SQLite DB β β AI Providers β
|
|
169
|
+
β ~/.algocoach/ β β Google / Groq β
|
|
170
|
+
β data.db β β / NVIDIA β
|
|
171
|
+
βββββββββββββββββ βββββββββββββββββββ
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Stack**: Bun + Hono + React + Tailwind + Drizzle ORM + SQLite + Better Auth
|
|
175
|
+
|
|
176
|
+
### Data
|
|
177
|
+
|
|
178
|
+
- **Database**: `~/.algocoach/data.db` β persists across restarts, never sent anywhere
|
|
179
|
+
- **Config**: `~/.algocoach/.env` β API keys stay on your machine
|
|
180
|
+
- **No telemetry, no cloud, no signup**
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## π§ͺ Development
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
git clone https://github.com/NitheshChakaravarthySeelan/algo-coach
|
|
188
|
+
cd algo-coach
|
|
189
|
+
bun install
|
|
190
|
+
bun run dev # Dev mode (hot reload)
|
|
191
|
+
bun run build # Production build
|
|
192
|
+
bun test # Run tests
|
|
86
193
|
```
|
|
87
194
|
|
|
88
|
-
|
|
195
|
+
---
|
|
89
196
|
|
|
90
|
-
|
|
91
|
-
- **Config**: `~/.algocoach/.env` β API keys and settings
|
|
197
|
+
## π License
|
|
92
198
|
|
|
93
|
-
|
|
199
|
+
GNU Affero General Public License v3 (AGPL-3.0)
|
|
94
200
|
|
|
95
|
-
|
|
201
|
+
You're free to fork, modify, and use it personally. If you distribute or run a modified version as a service, you **must** release your source code as well. This prevents anyone from making a proprietary closed-source version of AlgoCoach.
|
|
96
202
|
|
|
97
|
-
|
|
98
|
-
- **Groq** β uses `groq-sdk` for fast inference
|
|
99
|
-
- **NVIDIA NIM** β uses `openai` SDK with NVIDIA's OpenAI-compatible API
|
|
203
|
+
---
|
|
100
204
|
|
|
101
|
-
|
|
205
|
+
<p align="center">
|
|
206
|
+
Made by <a href="https://github.com/NitheshChakaravarthySeelan">NitheshChakaravarthySeelan</a><br>
|
|
207
|
+
<sub>Built with Bun, React, and a lot of AI tokens</sub>
|
|
208
|
+
</p>
|
package/cli/index.ts
CHANGED
|
@@ -96,13 +96,15 @@ async function cmdStart() {
|
|
|
96
96
|
|
|
97
97
|
console.log(`\n AlgoCoach running at ${url}\n`)
|
|
98
98
|
|
|
99
|
-
// Auto-open browser
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
// Auto-open browser
|
|
100
|
+
try {
|
|
101
|
+
const openCmd = process.platform === "darwin"
|
|
102
|
+
? ["open", url]
|
|
103
|
+
: process.platform === "win32"
|
|
104
|
+
? ["cmd", "/c", "start", url]
|
|
105
|
+
: ["xdg-open", url]
|
|
106
|
+
Bun.spawnSync(openCmd)
|
|
107
|
+
} catch {}
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
const cmd = process.argv[2] || "start"
|