How fizasayyed/betterworld works
Main System Components
A. Frontend Layer (Next.js Application)
• Client-side Components
• Server-side Components
• Authentication System
• API Integration Layer
B. Backend Layer (Node.js Application)
• API Routes
• Controllers
• Models
• Database Integration
• Payment Processing
Detailed Component Breakdown
Frontend Section:
• Core Pages (/, /donate, /donate/create/payment/stripe)
• Authentication Components (SignIn/SignOut)
• UI Components Layer
• Form Management (useFormStore)
• API Client Services
Backend Section:
• API Routes Layer
• Controllers (Payment, User, Webhook)
• Models Layer (Payment, User)
• Database Connection
• Configuration Management
External Services Integration
• Stripe Payment Processing
• Authentication Provider (NextAuth.js)
• Database System
Connection Flows
• Frontend → Backend API calls
• Backend → Database operations
• Payment Flow: Frontend → Stripe → Webhook → Backend
• Authentication Flow: User → NextAuth → External Provider
Specific Implementation Details
• Next.js 13+ App Router architecture
• RESTful API endpoints
• Stripe payment integration
• NextAuth.js authentication flow
• Database models and relationships
Component Relationships
Key relationships:
• Frontend form components → API client → Backend controllers
• Payment controller → Stripe integration → Webhook handling
• User authentication → Protected routes
• Database models → Controller operations