-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_documentation.txt
More file actions
128 lines (110 loc) · 10.5 KB
/
project_documentation.txt
File metadata and controls
128 lines (110 loc) · 10.5 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
**Project Documentation: Nodes Social Network**
"Nodes" is a social networking application built using Next.js (App Router), React, TypeScript, Tailwind CSS, and Shadcn UI. It provides users with features for connecting with others, joining communities, participating in meetups, sharing posts, and engaging in direct messaging. The application also includes features for managing user profiles, searching for content and users, receiving notifications, and studying through interactive content.
**Key Features (Prototyped/Partially Implemented):**
* **User Authentication:** Currently uses a dummy authentication system (`src/components/auth/auth-provider.tsx`) with `localStorage` for managing mock accounts. Real Firebase Authentication integration was initiated but reverted due to persistent API key configuration issues.
* **User Profiles:** Users can create and manage their profiles, including personal information, posts, saved content, and liked content. A simulated verification status is displayed. Profile updates interact with the dummy auth system.
* **Connections:** Users can (simulate) connecting with other users. AI-powered suggestions for connections are available via a Genkit flow. Display of actual connected friends is pending backend implementation.
* **Communities & Meetups:** Users can (simulate) creating and discovering communities and meetups. Forms for creation interact with mock data arrays. Search results display mock communities/meetups.
* **Posting and Feed:** Users can create and share various post types (thoughts, ideas, photos). Posts are currently managed using mock data. The home feed shows posts from "Everyone," (mock) "Friends," or (mock) "Communities." Features for commenting, liking, sharing, and saving posts are primarily mock interactions, with comments being the exception (see Chat/Messaging).
* **Messaging (Chat):**
* The chat list (`/messages`) fetches and displays existing chats from a **Firebase Firestore `chats` collection** in real-time.
* The individual chat page (`/messages/[chatId]`) fetches messages for a specific chat from Firestore and allows sending new messages to Firestore in **real-time**.
* Initiating new chats and advanced features are pending.
* **Notifications:** Users receive mock notifications.
* **Search:** Users can search for mock users, communities, and meetups. Filters are available.
* **Settings:** Users can manage account settings, including appearance (theme), liked posts (mock), blocked accounts (mock), and a simulated account verification process.
* **Study Hub:** Includes features for interactive study content based on user's domain (from mock profile data), discussion threads for questions (mock comments), and a weekly participation leaderboard (mock data). A mock code editor UI is present for relevant domains.
* **App Updates Page:** A section to inform users about new and upcoming features (using mock update data).
* **AI Integration:** Utilizes Genkit for features like connection suggestions (currently operating on mock inputs/outputs).
* **Firebase Rules:** Drafted for Firestore and basic placeholder for Storage. These require manual deployment to a Firebase project.
**Technology Stack (Current):**
* **Frontend:** Next.js, React, TypeScript, Tailwind CSS, Shadcn UI components.
* **Backend Simulation:** Most data is mocked in `src/lib/mock-data.ts`. Authentication is a dummy implementation.
* **Partial Backend (Firebase):**
* Real-time chat list and individual chat messaging use Firebase Firestore.
* **AI:** Genkit.
**Project Structure:**
The project follows a standard Next.js application structure:
* `src/app`: Contains the application's pages and routing.
* `src/components`: Reusable React components, organized by feature.
* `src/lib`: Utility functions, constants, and mock data (`src/lib/mock-data.ts`).
* `src/hooks`: Custom React hooks.
* `src/types`: TypeScript type definitions.
* `src/ai`: AI-related code, including Genkit flows.
* `public`: Static assets.
* `firestore.rules`, `storage.rules`: Firebase security rule definitions.
* `project_evolution_and_next_steps.txt`: Detailed guide for future development towards a production application.
---
**Project Changelog & Progress (Conceptual Dates):**
**Phase 1: Initial Prototyping & Core UI (Conceptual: Early May 2024)**
* **Features:**
* Basic Next.js app setup.
* Core UI layout with sidebar navigation.
* Name changed from "RadiusConnect" to "Nodes"; logo updated.
* Implemented mock data for users, posts, notifications, communities, meetups, study questions, app updates.
* Created pages for Home Feed (everyone, friends, communities - mock), Discover, Search (users, communities, meetups - mock), Profile, Settings (profile, appearance, liked posts, blocked accounts, verification - all mock).
* Implemented forms for creating posts, communities, meetups (all writing to mock data).
* Dummy authentication system implemented using `localStorage` and a mock user list.
* "Accounts" page for managing dummy accounts.
* Post card with mock interactions (like, comment, share, save).
* User profile card with mock interactions (connect, message, block).
* Connections page listing mock friends.
* Connection suggestion page using Genkit (mock inputs).
* Notifications page displaying mock notifications.
* Study Hub with domain filtering, mock questions, mock comments, mock leaderboard.
* App Updates page displaying mock updates.
* **Errors Fixed:** Initial setup issues, basic styling.
**Phase 2: Firebase Integration Attempts & Reversions (Conceptual: Mid May 2024)**
* **Features/Changes:**
* Initiated Firebase integration: Auth, Firestore for user profiles, Storage for images.
* **Reversion 1:** Due to persistent `auth/api-key-not-valid` errors (related to `.env.local` setup), Firebase Auth and Firestore user profiles were reverted to the dummy authentication system to unblock development.
* Initiated migration of Post creation/fetching to Firestore.
* **Reversion 2:** Post data Firestore migration was also reverted to mock data due to the same API key issues.
* **Key Challenge:** Correct Firebase project setup and API key configuration in the local environment (`.env.local`) proved to be a blocker for full Firebase integration at this stage.
**Phase 3: Real-time Chat with Firestore & UI Refinements (Conceptual: Mid-Late May 2024)**
* **Features:**
* Successfully integrated Firebase Firestore for the **real-time chat system**:
* Defined `Chat`, `Message`, `ChatParticipant` types.
* `/messages` page now fetches and lists chats from Firestore in real-time.
* `/messages/[chatId]` page now fetches and displays messages for a specific chat from Firestore in real-time, and allows sending new messages to Firestore.
* Removed `mockChats` and `mockMessages` from `mock-data.ts`.
* Added detailed `project_evolution_and_next_steps.txt` documentation.
* Drafted initial `firestore.rules` and basic `storage.rules`.
* Updated `firestore.rules` for enhanced security (ownership, auth checks, validation). Temporarily simplified `storage.rules`.
* **Errors Fixed:**
* Multiple import errors related to `mockChats` removal from various components.
* `PaintBrush` icon import typo in `mock-data.ts`.
* Added `placehold.co` to `next.config.js` image domains.
* Resolved "Maximum update depth exceeded" in `StudyPage` related to `useEffect` dependencies.
* Fixed various HTML nesting errors (`<div>` in `<p>`) causing hydration issues (e.g., in `UserProfileCard`, `PostCard`, `NotificationItem`, `ChatListItem`).
* Fixed `UserPlus is not defined` error in `AppLayout`.
* Fixed "cannot reassign to an imported binding" error for `globalMockPosts` in `UserPostsList` by centralizing mock data modification.
* Addressed accessibility warning regarding `DialogTitle` in `SheetContent` (mobile sidebar).
**Phase 4: Performance Optimizations & Feature Enhancements (Conceptual: Late May 2024 - Current)**
* **Features:**
* Implemented lazy loading (`next/dynamic`) for dialogs, modals, and various tab content sections to improve initial page load times.
* Memoized several presentational components (`React.memo`) to prevent unnecessary re-renders.
* Applied `useCallback` for event handlers in memoized components.
* Refined Study Hub: updated domain categories (DSA, Web Dev), added mock code editor UI for relevant questions.
* Profile page: Changed profile sections (view, edit, posts, saved, communities, meetups) to be managed by a dropdown menu.
* Profile form: Changed domain and stream inputs to `Select` dropdowns with predefined options.
* User Profile Card: Enhanced to show verification status of other users.
* **Errors Fixed:**
* Further addressed hydration errors by ensuring client-side rendering for `formatDistanceToNow`.
**Current Status & Next Steps:**
* **Frontend:** Most UI components and pages are prototyped. Many features still rely on mock data, except for the core real-time chat functionality (list and individual chat view/send) which uses Firestore.
* **Backend:**
* Firebase Firestore is actively used for the chat feature.
* Comprehensive Firestore security rules (`firestore.rules`) are drafted and ready for deployment.
* Firebase Storage rules (`storage.rules`) are currently placeholders and need to be secured.
* Full backend integration (authentication, all data to Firestore, storage for all uploads, server-side logic) is the primary next step as outlined in `project_evolution_and_next_steps.txt`.
* **Key Blockers (to be resolved by the developer):**
* Correct configuration of Firebase project credentials in `.env.local` to resolve `auth/api-key-not-valid` errors and enable full Firebase integration.
* Manual deployment of `firestore.rules` and future `storage.rules` to the Firebase project.
* **Immediate Focus for further development (once Firebase config is stable):**
1. Re-integrate Firebase Authentication.
2. Migrate Post interactions (likes, comments) to Firestore, respecting security rules.
3. Migrate Community and Meetup creation/management to Firestore.
4. Implement a proper Connections system using Firestore.
5. Make Notifications real-time and driven by Firestore events.
For a detailed guide on implementing the backend and making the application production-ready, please refer to the `project_evolution_and_next_steps.txt` file in the root directory.