-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathimplementation_plan.md.resolved
More file actions
392 lines (317 loc) · 15.9 KB
/
implementation_plan.md.resolved
File metadata and controls
392 lines (317 loc) · 15.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
# Enclope Enhancement Plan
> A structured, phased approach to upgrade the Enclope website while preserving the existing vision and functionality.
---
## 🎯 Guiding Principles
1. **Preserve the Vision**: "The Digital Foundry" — raw talent, forged products
2. **Non-Destructive Changes**: Work alongside existing code, never break what works
3. **Incremental Delivery**: Each phase delivers testable, working features
4. **Mobile-First Thinking**: All new features should work on all devices
5. **Security First**: Proper authentication, data validation, and access control
---
## 📋 Project Scope Summary
| Feature | Priority | Phase |
|---------|----------|-------|
| Supabase Database Integration | 🔴 Critical | 1 |
| Form Submissions Working | 🔴 Critical | 1 |
| Admin Dashboard (Read Stats) | 🔴 Critical | 2 |
| Admin Authentication | 🔴 Critical | 2 |
| Submission Management | 🟡 High | 3 |
| Bug Fixes (Links, Images) | 🟡 High | 3 |
| Dynamic Projects from DB | 🟢 Medium | 4 |
| Content Management | 🟢 Medium | 4 |
---
## 🗄️ Database Schema Design (Supabase)
```mermaid
erDiagram
applications {
uuid id PK
text type "student | client"
jsonb form_data
text status "pending | reviewed | accepted | rejected"
timestamp created_at
timestamp updated_at
}
contacts {
uuid id PK
text name
text email
text service_interest
text message
boolean is_read
timestamp created_at
}
projects {
uuid id PK
text title
text description
text[] tech_stack
text image_url
text status "deployed | beta | concept"
text type "web | mobile | dashboard"
boolean is_featured
int display_order
timestamp created_at
}
admin_users {
uuid id PK
text email
text role "admin | viewer"
timestamp created_at
}
```
---
## 🚀 Phase 1: Database Foundation (Days 1-2)
> **Goal**: Connect Supabase and make forms work without changing UI
### Tasks
#### 1.1 Supabase Project Setup
- [ ] Create Supabase project (or use existing)
- [ ] Set up environment variables
- [ ] Create `.env` files for client and server
- [ ] Add `.env` to [.gitignore](file:///Users/rishabhvyas/Desktop/Enclope/.gitignore) (security)
#### 1.2 Database Tables
- [ ] Create `applications` table (student/client forms)
- [ ] Create `contacts` table (project inquiry form)
- [ ] Create `projects` table (portfolio items)
- [ ] Set up Row Level Security (RLS) policies
#### 1.3 Client Integration
- [ ] Install `@supabase/supabase-js` in client
- [ ] Create `src/lib/supabase.js` configuration
- [ ] Create `src/lib/api.js` for database operations
#### 1.4 Connect Forms to Database
- [ ] [JoinPage.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/pages/JoinPage.jsx) → Student form saves to `applications`
- [ ] [JoinPage.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/pages/JoinPage.jsx) → Client form saves to `applications`
- [ ] [TheForge.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/sections/TheForge.jsx) → Contact form saves to `contacts`
- [ ] Add success/error toast notifications
- [ ] Add loading states to buttons
### Files to Create/Modify
| Action | File | Description |
|--------|------|-------------|
| [NEW] | `client/.env` | Supabase credentials |
| [NEW] | `client/src/lib/supabase.js` | Supabase client config |
| [NEW] | `client/src/lib/api.js` | Database helper functions |
| [MODIFY] | [client/src/pages/JoinPage.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/pages/JoinPage.jsx) | Connect forms to DB |
| [MODIFY] | [client/src/sections/TheForge.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/sections/TheForge.jsx) | Connect contact form |
| [NEW] | `client/src/components/Toast.jsx` | Notification component |
### Risks & Mitigations
| Risk | Mitigation |
|------|------------|
| Breaking existing UI | Only add logic, don't change JSX structure |
| Environment variable exposure | Use `VITE_` prefix, never commit `.env` |
---
## 🎛️ Phase 2: Admin Dashboard Foundation (Days 3-5)
> **Goal**: Create a protected admin area to view submissions
### Tasks
#### 2.1 Admin Authentication
- [ ] Set up Supabase Auth (email/password)
- [ ] Create admin users table with roles
- [ ] Build login page (`/admin/login`)
- [ ] Create `AuthProvider` context
- [ ] Build `ProtectedRoute` component
#### 2.2 Admin Layout
- [ ] Create admin layout (sidebar + content area)
- [ ] Design consistent with "Foundry" theme
- [ ] Build reusable admin components:
- [ ] `StatCard` — for metrics
- [ ] `DataTable` — for listings
- [ ] `StatusBadge` — for application status
#### 2.3 Dashboard Overview Page
- [ ] Total applications count (student/client split)
- [ ] Applications by status breakdown
- [ ] Recent submissions list (last 10)
- [ ] Total contact inquiries
- [ ] Weekly/monthly trends chart
#### 2.4 Application Listings
- [ ] Student applications list with filters
- [ ] Client project briefs list with filters
- [ ] Contact inquiries list
- [ ] Search functionality
- [ ] Pagination
### Admin Dashboard — Single Page Experience
> **Key UX Decision**: The admin dashboard will be a **single-page application** with sidebar navigation. Admins won't need to type URLs — everything is accessible from one unified interface.
| Route | Purpose |
|-------|---------|
| `/admin/login` | Login page (only separate page) |
| `/admin` | **Main Dashboard SPA** — all views rendered here |
#### How It Works
```
┌──────────────────────────────────────────────────────────────────┐
│ 🔥 ENCLOPE COMMAND CENTER [Admin] [Logout] │
├────────────────┬─────────────────────────────────────────────────┤
│ │ │
│ SIDEBAR │ CONTENT AREA (changes based on selection) │
│ (Always │ │
│ Visible) │ ┌─────────────────────────────────────────┐ │
│ │ │ │ │
│ ┌──────────┐ │ │ Selected view renders here: │ │
│ │📊 Overview│ │ │ • Overview (stats + recent) │ │
│ ├──────────┤ │ │ • Applications (table + filters) │ │
│ │📝 Apps │◀─┼───│ • Application Detail (modal/panel) │ │
│ │ └ View │ │ │ • Contacts (table + actions) │ │
│ │ └ Detail│ │ │ • Projects (CRUD interface) │ │
│ ├──────────┤ │ │ • Settings (admin management) │ │
│ │💬 Contacts│ │ │ │ │
│ ├──────────┤ │ └─────────────────────────────────────────┘ │
│ │📦 Projects│ │ │
│ ├──────────┤ │ Application Detail opens as a SLIDE-OUT │
│ │⚙️ Settings│ │ PANEL, not a new page! │
│ └──────────┘ │ │
│ │ │
└────────────────┴─────────────────────────────────────────────────┘
```
#### Implementation Approach
- **React State** controls which "view" is active
- **Slide-out panels** for detail views (no page navigation)
- **Keyboard shortcuts** for power users (optional)
- **Persistent sidebar** — admin never loses context
### Files to Create
| File | Description |
|------|-------------|
| `src/pages/admin/AdminLogin.jsx` | Login page |
| `src/pages/admin/Dashboard.jsx` | Stats overview |
| `src/pages/admin/ApplicationsList.jsx` | View all applications |
| `src/pages/admin/ApplicationDetail.jsx` | Single application view |
| `src/pages/admin/ContactsList.jsx` | Contact submissions |
| `src/context/AuthContext.jsx` | Auth state management |
| `src/components/admin/AdminLayout.jsx` | Admin shell |
| `src/components/admin/StatCard.jsx` | Metric display |
| `src/components/admin/DataTable.jsx` | Data grid |
| `src/components/ProtectedRoute.jsx` | Route guard |
### Dashboard Wireframe
```
┌─────────────────────────────────────────────────────────────┐
│ 🔥 ENCLOPE ADMIN [Avatar] [Logout] │
├──────────────────┬──────────────────────────────────────────┤
│ │ │
│ 📊 Dashboard │ Welcome back, Admin │
│ ─────────────── │ │
│ 📝 Applications │ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ • Students │ │ 42 │ │ 18 │ │ 15 │ │
│ • Clients │ │ Total │ │Students │ │Clients │ │
│ │ │ Apps │ │ Apps │ │ Briefs │ │
│ 💬 Contacts │ └─────────┘ └─────────┘ └─────────┘ │
│ │ │
│ 📦 Projects │ Recent Applications │
│ │ ┌───────────────────────────────────┐ │
│ ⚙️ Settings │ │ Name │ Type │ Date │Status │ │
│ │ ├─────────┼────────┼────────┼───────┤ │
│ │ │ Rahul V │Student │ Today │Pending│ │
│ │ │ TechCo │Client │ Jan 28 │Review │ │
│ │ └───────────────────────────────────┘ │
└──────────────────┴──────────────────────────────────────────┘
```
---
## 📋 Phase 3: Management Features (Days 6-7)
> **Goal**: Enable admins to take action on submissions
### Tasks
#### 3.1 Application Management
- [ ] Update application status (pending → reviewed → accepted/rejected)
- [ ] Add admin notes to applications
- [ ] Delete applications (soft delete)
- [ ] Export to CSV
#### 3.2 Contact Management
- [ ] Mark as read/unread
- [ ] Reply button (opens email client)
- [ ] Archive old contacts
#### 3.3 Bug Fixes (Non-Breaking)
- [ ] Fix placeholder image in [StarterKit.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/sections/StarterKit.jsx)
- [ ] Add real social media links in [Footer.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/components/Footer.jsx)
- [ ] Fix "View Full Archive" button in [Showroom.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/sections/Showroom.jsx)
- [ ] Add "Code of Conduct" page or link
- [ ] Form validation improvements
#### 3.4 UX Improvements
- [ ] Better form validation (real-time)
- [ ] Success page after form submission
- [ ] Email confirmation to applicants (optional)
---
## 📦 Phase 4: Dynamic Content (Days 8-10)
> **Goal**: Make portfolio and content manageable from admin
### Tasks
#### 4.1 Dynamic Projects
- [ ] Fetch projects from `projects` table
- [ ] Update [Showroom.jsx](file:///Users/rishabhvyas/Desktop/Enclope/client/src/sections/Showroom.jsx) to use database
- [ ] Cache projects for performance
#### 4.2 Projects Management
- [ ] Add new projects from admin
- [ ] Edit existing projects
- [ ] Upload images (Supabase Storage)
- [ ] Reorder projects
#### 4.3 Optional: Services Management
- [ ] Move `forgeCategories` to database
- [ ] Admin UI to edit services
---
## 🗂️ Folder Structure After Implementation
```
client/
├── src/
│ ├── components/
│ │ ├── admin/ # NEW: Admin-specific components
│ │ │ ├── AdminLayout.jsx
│ │ │ ├── Sidebar.jsx
│ │ │ ├── StatCard.jsx
│ │ │ └── DataTable.jsx
│ │ ├── ui/ # NEW: Shared UI components
│ │ │ ├── Toast.jsx
│ │ │ ├── Button.jsx
│ │ │ └── Input.jsx
│ │ ├── Header.jsx # Existing
│ │ ├── Footer.jsx # Existing
│ │ └── ProtectedRoute.jsx # NEW
│ │
│ ├── context/ # NEW
│ │ └── AuthContext.jsx
│ │
│ ├── lib/ # NEW: Utilities
│ │ ├── supabase.js
│ │ └── api.js
│ │
│ ├── pages/
│ │ ├── admin/ # NEW: Admin pages
│ │ │ ├── AdminLogin.jsx
│ │ │ ├── Dashboard.jsx
│ │ │ ├── ApplicationsList.jsx
│ │ │ ├── ApplicationDetail.jsx
│ │ │ └── ContactsList.jsx
│ │ ├── HomePage.jsx # Existing
│ │ ├── JoinPage.jsx # Modified
│ │ └── ...
│ │
│ ├── sections/ # Existing (minimal changes)
│ └── data/ # Existing (may be deprecated in Phase 4)
│
├── .env # NEW (git-ignored)
└── .env.example # NEW (template for devs)
```
---
## ✅ Confirmed Decisions
| Decision | Your Choice |
|----------|-------------|
| **Supabase** | ✅ Already created |
| **Admin System** | ✅ Multi-admin with roles (scalable for future) |
| **Email Notifications** | ✅ Yes — send confirmation when someone applies |
| **Deployment** | 🔄 To be evaluated (cost considerations) |
| **Admin UX** | ✅ Single-page dashboard experience |
### Email Notification Strategy
For email notifications, we have several options:
| Service | Free Tier | Notes |
|---------|-----------|-------|
| **Resend** | 3,000 emails/month | Best DX, simple setup |
| **Supabase Edge Functions + SMTP** | Depends on SMTP provider | More control |
| **Loops** | 1,000 contacts | Built for SaaS |
**Recommendation**: Start with **Resend** — it integrates well with React/Vite and has a generous free tier.
---
## 📅 Timeline Estimate
| Phase | Duration | Deliverable |
|-------|----------|-------------|
| Phase 1 | 2 days | Forms submit to Supabase |
| Phase 2 | 3 days | Admin dashboard with stats |
| Phase 3 | 2 days | Management + bug fixes |
| Phase 4 | 3 days | Dynamic content |
| **Total** | **~10 days** | Full implementation |
---
## ✅ Ready to Begin?
Once you approve this plan and answer the questions above, I will:
1. Guide you through Supabase setup
2. Start Phase 1 implementation
3. Test each phase before moving forward
4. Keep the existing site working throughout
**The existing website will remain fully functional during the entire process.**