How karmveershubham/trustify works
Project Type and Purpose
• Trustify is a full-stack trust-based e-commerce platform.
• Frontend: Next.js app with SSR/CSR, TailwindCSS, Redux state management.
• Backend: Express.js REST API with Google OAuth, Passport.js authentication.
• Database: Neo4j graph database representing users and “contacts of contacts.”
• Additional services: Cloudinary for image uploads, Socket.io for real-time notifications.
File Structure
• Top-level “client” directory holds the Next.js application.
• src/app – page routes and dynamic segments for auth, product, user flows
• src/components – UI components, feature modules, layout, magic UI elements
• src/services – Redux slices (auth, cart) and store/provider setup
• src/lib & src/validations – shared utilities, API clients, input schemas
• Top-level “server” directory holds the Express API.
• config – Cloudinary, Socket.io, constant values
• neo4j – driver setup for the graph database
• middlewares – auth checks, image upload handling
• controllers – request handlers for auth, contacts, listings, notifications, tests
• routes – REST endpoints mapped to controllers
• models – Neo4j node definitions and queries
Extract Insights from the README
• Emphasizes trust graph built on Neo4j, RESTful design, Google OAuth.
• Highlights key user flows: registration/login → building trust connections → listing/purchasing products → real-time notifications.
A. Main Components
• Browser Client (Next.js SSR/CSR)
• API Gateway / Express Server
• Neo4j Graph Database
• Cloudinary Image Service
• External Auth Provider (Google)
• Real-time Layer (Socket.io)
B. Relationships & Data Flow
1. Browser ↔ Next.js App: user visits pages, static assets served.
2. Next.js App → Express API: REST calls for login, listings, contacts, etc.
3. Express API → Neo4j: CRUD operations on User, Listing, Notification nodes/relationships.
4. Express API → Cloudinary: image upload/download via upload middleware.
5. Express API ↔ Google OAuth: token exchange, user profile fetch during auth.
6. Express API ↔ Browser (WebSocket): real-time notifications pushed to authenticated clients.
C. Architectural Patterns & Principles
• Separation of Concerns: Presentation (Next.js) vs. Business Logic (Express controllers) vs. Data (Neo4j).
• Modularization: service layers (e.g., productService, validation), Redux slices.
• Middleware pipeline in Express for auth, file upload, error handling.
• Dynamic routing in Next.js for product/user pages.
D. Key Technologies & Frameworks
• Next.js – routing, SSR/CSR hybrid, API calls
• TailwindCSS – styling utility classes
• Redux – global state (auth, cart)
• Express.js – API framework
• Passport.js & Google OAuth – authentication
• Neo4j Driver – graph database connectivity
• Cloudinary SDK – media storage
• Socket.io – real-time push notifications