@iprep/server
v1.1.4
Published
Express backend API for iPrep
Readme
@iprep/server
Express.js backend API for iPrep. Connects the React frontend to Claude Code CLI and the SQLite database.
Development
pnpm run devServer runs on http://localhost:3000
API Endpoints
Health
| Method | Endpoint | Description |
| ------ | ---------- | ------------------ |
| GET | /health | Server health check |
Tutors
| Method | Endpoint | Description |
| ------ | ------------------ | ---------------------------- |
| GET | /api/tutors | List all available tutors |
| GET | /api/tutors/:id | Get a single tutor config |
Chat
| Method | Endpoint | Description |
| ------ | ------------ | ------------------------------------ |
| POST | /api/chat | Send a message → Claude → response |
Conversations
| Method | Endpoint | Description |
| ------ | ------------------------------------- | ------------------------------ |
| GET | /api/conversations?userId=&tutorId= | List conversations |
| GET | /api/conversations/:id | Get conversation details |
| GET | /api/conversations/:id/messages | Get messages in a conversation |
Documents
| Method | Endpoint | Description |
| -------- | ------------------------------------- | -------------------------------- |
| GET | /api/documents/:tutorId | List documents for a tutor |
| POST | /api/documents/:tutorId/upload | Upload a document (.md or .txt) |
| DELETE | /api/documents/:tutorId/:documentId | Delete a document |
Services
| Service | Description |
| -------------------- | -------------------------------------------------- |
| ChatService | Orchestrates message flow (user → Claude → DB → UI)|
| TutorService | Loads tutor configs from ~/.iprep/aitutors/ |
| DocumentService | Manages document uploads and storage per tutor |
| SessionService | Creates and tracks user–tutor sessions |
Notes
- Tutor configs are loaded from
~/.iprep/aitutors/{tutorId}/(markdown files) - Uploaded documents are stored at
~/.iprep/aitutors/{tutorId}/docs/ - Only
.mdand.txtfiles are accepted for upload (max 10 MB)
