aki-008 commited on
Commit
f316317
Β·
1 Parent(s): 217e7a6

fix: Readme fixed

Browse files
Files changed (1) hide show
  1. Readme.md +259 -7
Readme.md CHANGED
@@ -1,10 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
- title: PrepAI
3
- emoji: 🐒
4
- colorFrom: yellow
5
- colorTo: blue
6
- sdk: docker
7
- pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # PrepAI – Intelligent Interview & Notes Assistant
2
+
3
+ PrepAI is a comprehensive AI-powered platform designed to help users prepare for interviews, generate personalized quizzes, manage study notes, and even participate in real-time mock interviews using conversational AI. It blends multiple modern technologies such as FastAPI, React, ChromaDB, PostgreSQL, Vapi, Groq, and LlamaIndex into a cohesive, production-ready system.
4
+
5
+ ---
6
+
7
+ ## πŸš€ Live Demo
8
+
9
+ β–Ά **Try the project here:** [https://huggingface.co/spaces/aki-008/prepAI](https://huggingface.co/spaces/aki-008/prepAI)
10
+
11
+ ---
12
+
13
+ ## πŸš€ Overview
14
+
15
+ PrepAI enables users to:
16
+
17
+ - Conduct **AI-powered mock interviews** with real-time voice interaction.
18
+ - Upload PDFs and **chat with notes** using vector search + RAG.
19
+ - Generate **MCQ quizzes** from resumes or study material.
20
+ - Maintain persistent **chat sessions**, interview transcripts, and summaries.
21
+ - Work inside a fully containerized architecture with isolated services.
22
+
23
+ This system is ideal for interview preparation platforms, ed-tech tools, or personal study automation.
24
+
25
+ ---
26
+
27
+ ## 🧩 Architecture
28
+
29
+ PrepAI is built with a modular full-stack architecture:
30
+
31
+ ### **Backend (FastAPI)**
32
+
33
+ - JWT Authentication
34
+ - Upload & process PDFs
35
+ - ChromaDB vector store integration
36
+ - Streaming LLM responses
37
+ - Vapi-powered live interview assistant
38
+ - Quiz generation using Groq/OpenAI
39
+
40
+ ### **Frontend (React + TypeScript + Vite)**
41
+
42
+ - User onboarding (Sign In / Sign Up)
43
+ - PDF upload, preview, rename, deletion
44
+ - Interactive note-chat interface
45
+ - Dashboard with metrics
46
+ - Seamless Vapi interview client
47
+
48
+ ### **Database Layer**
49
+
50
+ - **PostgreSQL** stores:
51
+
52
+ - Users
53
+ - PDFs
54
+ - Chat sessions
55
+ - Messages
56
+ - Metadata
57
+
58
+ ### **Vector Search Layer**
59
+
60
+ - **ChromaDB** stores:
61
+
62
+ - Chunked PDF embeddings
63
+ - User-ingested knowledge
64
+
65
+ ### **AI Services**
66
+
67
+ - **Groq/OpenAI** for LLM responses
68
+ - **SentenceTransformers** for embeddings
69
+ - **Vapi** for real-time voice conversations
70
+ - **LlamaIndex** for PDF parsing & chunking
71
+
72
  ---
73
+
74
+ ## πŸ“¦ Directory Structure
75
+
76
+ ```
77
+ aki-008-prepai/
78
+ β”œβ”€β”€ Backend/
79
+ β”‚ β”œβ”€β”€ app/
80
+ β”‚ β”œβ”€β”€ Dockerfile
81
+ β”‚ └── requirements.txt
82
+ β”‚
83
+ β”œβ”€β”€ Frontend/
84
+ β”‚ β”œβ”€β”€ src/
85
+ β”‚ β”œβ”€β”€ Dockerfile
86
+ β”‚ └── vite.config.ts
87
+ β”‚
88
+ β”œβ”€β”€ docker-compose.yml
89
+ └── RUN.md
90
+ ```
91
+
92
  ---
93
 
94
+ ## βš™οΈ Installation & Setup
95
+
96
+ ### **1. Clone the repository**
97
+
98
+ ```
99
+ git clone <repo-url>
100
+ cd aki-008-prepai
101
+ ```
102
+
103
+ ### **2. Create your `.env` file**
104
+
105
+ Provide:
106
+
107
+ - PostgreSQL credentials
108
+ - Groq API key
109
+ - OpenAI key (if needed)
110
+ - VAPI_PRIVATE_KEY
111
+ - VAPI_PUBLIC_KEY
112
+ - VAPI_ASSISTANT_ID
113
+
114
+ Example:
115
+
116
+ ```
117
+ DATABASE_URL=postgresql+asyncpg://postgres:password@db:5432/studentdb
118
+ GROQ_API_KEY=your-key
119
+ VAPI_PRIVATE_KEY=your-key
120
+ VAPI_PUBLIC_KEY=your-key
121
+ VAPI_ASSISTANT_ID=your-assistant-id
122
+ ```
123
+
124
+ ### **3. Run the system (Docker)**
125
+
126
+ ```
127
+ docker-compose up --build
128
+ ```
129
+
130
+ Services started:
131
+
132
+ - Frontend β†’ [http://localhost:5173](http://localhost:5173)
133
+ - Backend β†’ [http://localhost:8000](http://localhost:8000)
134
+ - ChromaDB β†’ [http://localhost:8080](http://localhost:8080)
135
+ - PostgreSQL β†’ [http://localhost:5432](http://localhost:5432)
136
+
137
+ ### **4. Dev mode (manual)**
138
+
139
+ Backend:
140
+
141
+ ```
142
+ cd Backend
143
+ python run.py
144
+ ```
145
+
146
+ Frontend:
147
+
148
+ ```
149
+ cd Frontend
150
+ npm install
151
+ npm run dev
152
+ ```
153
+
154
+ ChromaDB:
155
+
156
+ ```
157
+ chroma run --host 0.0.0.0 --port 8080 --path ./chroma_store
158
+ ```
159
+
160
+ ---
161
+
162
+ ## πŸ§ͺ Key Features in Detail
163
+
164
+ ### **1. PDF Upload & Notes Chat**
165
+
166
+ - PDFs are chunked using PyMuPDF + LlamaIndex.
167
+ - Embeddings generated via MiniLM.
168
+ - Chunks stored in ChromaDB.
169
+ - Users can open chats tied to each PDF with full chat history.
170
+
171
+ ### **2. AI Interview System**
172
+
173
+ - Dynamic prompt generation based on job-role, experience, difficulty.
174
+ - Real-time Vapi-based interview with:
175
+
176
+ - Emotion recognition
177
+ - Adjustable voice
178
+ - Adaptive follow-ups
179
+ - Strict 5-minute flow
180
+
181
+ - Transcripts saved automatically.
182
+
183
+ ### **3. Quiz Generation**
184
+
185
+ From resumes or notes:
186
+
187
+ - Strict rules enforced by the SYSTEM_PROMPT
188
+ - Always 10 MCQs with 4 options
189
+ - JSON-structured output
190
+ - Options + explanations
191
+
192
+ ### **4. Authentication**
193
+
194
+ - Secure hashing using Argon2
195
+ - JWT tokens
196
+ - Protected routes for all user-specific actions
197
+
198
+ ---
199
+
200
+ ## πŸ› οΈ Development Notes
201
+
202
+ ### **Backend**
203
+
204
+ - Powered by **FastAPI** with async SQLAlchemy.
205
+ - Auto-table creation on startup.
206
+ - Organized into clear routers: Auth, Notes, Interview, Quiz.
207
+ - Streaming responses for chat.
208
+
209
+ ### **Frontend**
210
+
211
+ - Built on **React + TypeScript**.
212
+ - Modern UI with Tailwind.
213
+ - Routes include: Home, Dashboard, Notes, Interview.
214
+ - ProtectedRoute ensures authentication.
215
+
216
+ ### **Docker Setup**
217
+
218
+ `docker-compose.yml` orchestrates:
219
+
220
+ - PostgreSQL database
221
+ - ChromaDB vector server
222
+ - Backend (Python)
223
+ - Frontend (Nginx)
224
+
225
+ ---
226
+
227
+ ## πŸ“„ Interview Transcript Storage
228
+
229
+ During every interview:
230
+
231
+ - All real-time transcripts are appended in `Backend/transcripts/<call_id>.txt`.
232
+ - Summary is appended at end of call.
233
+
234
+ ---
235
+
236
+ ## 🚧 Roadmap
237
+
238
+ Future improvements:
239
+
240
+ - User analytics dashboard
241
+ - Multi-file knowledge merging
242
+ - Advanced scoring for interview responses
243
+ - Multi-voice model selector
244
+ - Mobile-friendly front-end layout
245
+
246
+ ---
247
+
248
+ ## πŸ§‘β€πŸ’» Contributing
249
+
250
+ Feel free to open issues or submit pull requests. Contributions are welcome for both frontend and backend.
251
+
252
+ ---
253
+
254
+ ## πŸ“œ License
255
+
256
+ This project is licensed under your chosen license (MIT recommended).
257
+
258
+ ---
259
+
260
+ ### ❀️ Thank you for using PrepAI!
261
+
262
+ If you'd like additional documentation (API reference, UML diagrams, onboarding guide), just ask!