riju-talk/DreamDOT
A next-gen social media and blogging platform that empowers creators to publish, connect, and earn through dynamic subscriptions, pay-per-view content, and immersive community interaction. Designed for scale, speed, and seamless engagement.
DreamDot - Creative Content Platform
A full-stack social media platform for creators to share, collaborate, and monetize their digital content with end-to-end encrypted chat and integrated payments.
DreamDot empowers creators to publish and monetize their art, writings, and thoughts in one unified platform. Whether you're a digital artist, indie author, blogger, or creative thinker โ DreamDot offers the tools to connect, share, and earn from your creativity.
๐ Features
Social Platform
- Posts & Feeds: Share updates, images, and content with followers
- Comments & Likes: Engage with community content
- Following System: Follow creators you love
- Blocking: Control who can interact with you
- User Profiles: Customizable profiles with avatars, banners, and bios
- Communities: Create and join groups
Marketplace
- Digital Items: Upload and sell digital downloads
- Writings: Publish articles, blogs, and stories with rich text editor
- Digital Art: Share and sell illustrations, photography, and designs
- Comics: Create and publish webcomics, manga, and graphic novels
- Monetization Options:
- Free content
- One-time purchase
- Subscription-based access
End-to-End Encrypted Chat
- Private Messages: 1-on-1 encrypted conversations
- Community Chats: Group conversations with E2EE
- Media Sharing: Send encrypted images, videos, and audio
- Real-time: Instant delivery with typing indicators
- Zero Knowledge: Server never sees message content
- Socket.IO: WebSocket-based real-time communication
Payment System
- Stripe Integration: Secure payment processing
- Balance Management:
- Initial balance: $50,000 for all new users (non-redeemable)
- Replenish balance: Add funds via Stripe checkout
- Redeem balance: Withdraw earned funds only
- Transaction History: Track all payments
- Credit System: Use credits for marketplace purchases
Creator Analytics
- Engagement insights
- Earnings dashboard
- Follower growth metrics
๐ ๏ธ Tech Stack
| Layer | Technologies |
|---|---|
| Frontend | Next.js 15 (App Router), TypeScript, Tailwind CSS 4, shadcn/ui, Quill.js |
| Backend | Next.js API Routes, Express.js, Socket.IO, Prisma ORM, NextAuth.js |
| Databases | PostgreSQL (5 schemas), MongoDB (chat & content) |
| Auth | |
| Encryption | Web Crypto API, TweetNaCl (E2EE chat) |
| Payments | Stripe |
| Media | ImageKit |
| Real-time | Socket.IO |
๐๏ธ Database Architecture
PostgreSQL (5 Separate Schemas)
-
Users Database (
POSTGRESS_DB_USER)- Authentication, profiles, user analytics
- Security, sessions, certificates
-
Social Database (
POSTGRESS_DB_SOCIAL)- Posts, comments, likes
- Following/blocking relationships
- Notifications
-
Items Database (
POSTGRESS_DB_ITEMS)- Item metadata, transactions, reviews
- Favorites, collections, monetization
-
Community Database (
POSTGRESS_DB_COMMUNITY)- Communities, memberships
- Community posts and discussions
-
Audit Database (
POSTGRESS_DB_AUDIT)- Admin logs, system events
- Audit trails
MongoDB
- Chat: Conversations, encrypted messages
- Content: Full item content (writings, art, comics)
- Transactions: Payment transaction details
๐ Quick Start
Prerequisites
- Node.js 20.0.0 or higher
- npm 10.0.0 or higher
- MongoDB (Atlas recommended)
- PostgreSQL (Neon recommended)
- Stripe account (for payments)
- ImageKit account (for media)
Installation
# Clone the repo
git clone https://github.com/yourusername/dreamdot.git
cd dreamdot
# Install dependencies (this automatically generates Prisma clients via postinstall)
npm install
# Set up environment variables
cp .env .env.local # Or edit .env directly
# Edit the .env file with your credentials
# See below for all required variables
# Push database schemas (first time only)
cd apps/web
npx prisma db push --schema=src/lib/prisma/schema.user.prisma
npx prisma db push --schema=src/lib/prisma/schema.social.prisma
npx prisma db push --schema=src/lib/prisma/schema.item.prisma
npx prisma db push --schema=src/lib/prisma/schema.community.prisma
npx prisma db push --schema=src/lib/prisma/schema.audit.prisma
# Return to root and start all services
cd ../..
npm run dev:allThe application will be available at:
- Web App: http://localhost:5000
- Chat Server: http://localhost:3001
- Payment Service: http://localhost:3002
๐ Documentation
- Architecture Guide - Detailed system architecture and design decisions
- Integration Guide - Step-by-step setup and integration instructions
- Environment Variables - Configuration reference
๐๏ธ Project Structure
dreamdot/
โโโ apps/
โ โโโ web/ # Next.js frontend application
โ โ โโโ src/
โ โ โ โโโ app/ # Next.js App Router pages & API routes
โ โ โ โ โโโ api/ # Backend API routes
โ โ โ โ โ โโโ auth/ - Authentication
โ โ โ โ โ โโโ social/ - Follow, block, comments
โ โ โ โ โ โโโ items/ - Marketplace items
โ โ โ โ โ โโโ posts/ - Social posts
โ โ โ โ โโโ (pages)/ - Frontend pages
โ โ โ โโโ lib/ # Utilities and database clients
โ โ โ โโโ mongoose/ - MongoDB models
โ โ โ โ โโโ models/
โ โ โ โ โโโ Writing.js
โ โ โ โ โโโ DigitalArt.js
โ โ โ โ โโโ Comic.js
โ โ โ โ โโโ Item.js
โ โ โ โโโ prisma/ - PostgreSQL schemas
โ โ โโโ components/ # React components
โ โ โโโ ui/ - shadcn/ui components
โ โ โโโ rich-text-editor.tsx
โ โ โโโ balance-management.tsx
โ โ โโโ create-content.tsx
โ โโโ chat/ # Socket.IO chat server
โ โ โโโ src/
โ โ โโโ controllers/
โ โ โโโ models/
โ โ โโโ services/
โ โ โโโ socket.ts
โ โโโ payment/ # Stripe payment service
โ โโโ src/
โ โโโ routes/
โ โ โโโ payment.js - Payment endpoints
โ โ โโโ webhook.js - Stripe webhooks
โ โโโ models/
โ โ โโโ Transaction.js - Transaction model
โ โโโ server.js
โโโ packages/
โ โโโ ui/ # Shared UI components
โ โโโ typescript-config/# TypeScript configurations
โ โโโ eslint-config/ # ESLint configurations
โโโ ARCHITECTURE.md # Architecture documentation
โโโ INTEGRATION_GUIDE.md # Setup guide
โโโ .env.example # Environment variables template
๐ง Development
Run Services Individually
# Terminal 1: Next.js App
npm run dev
# Terminal 2: Chat Server
npm run chat:dev
# Terminal 3: Payment Service
npm run payment:devBuild for Production
# Build all apps
npm run build
# Build specific app
npm run build --workspace=apps/web๐ข Deployment
Recommended Setup
- Next.js App: Vercel or Replit Autoscale
- Chat Server: Railway, Render, or VPS
- Payment Service: Railway, Render, or VPS
- MongoDB: MongoDB Atlas
- PostgreSQL: Neon, Supabase, or managed PostgreSQL
See INTEGRATION_GUIDE.md for detailed deployment instructions.
๐ Security Features
- End-to-End Encryption: Chat messages encrypted with Web Crypto API
- Password Hashing: bcrypt with salts
- JWT Authentication: Secure session management
- CORS Protection: Configured allowed origins
- Input Validation: All user inputs sanitized
- Stripe Integration: PCI-compliant payment processing
- Balance Separation: Initial vs. redeemable balance
๐ API Endpoints
Authentication
POST /api/auth/signup - Register new user
POST /api/auth/signin - Login
GET /api/auth/me - Get current user
Social Features
POST /api/social/follow - Follow user
DELETE /api/social/follow - Unfollow user
POST /api/social/block - Block user
DELETE /api/social/block - Unblock user
POST /api/social/comments - Create comment
GET /api/social/comments - Get comments
DELETE /api/social/comments - Delete comment
POST /api/posts/create - Create post
Marketplace
POST /api/items/create - Create item (writing/art/comic/digital)
GET /api/items/[id] - Get item details
PUT /api/items/[id] - Update item
DELETE /api/items/[id] - Delete item
Payments
POST /api/payment/create-checkout-session - Start Stripe checkout
POST /api/payment/redeem-balance - Redeem earned funds
GET /api/payment/transactions/:userId - Get transaction history
POST /webhook/stripe - Stripe webhook handler
Chat (Socket.IO Events)
send_message - Send encrypted message
message - Receive encrypted message
typing - User is typing
presence - User online/offline status
message_ack - Message acknowledgment
๐ Environment Variables
All services (Web App, Chat Server, Payment Service) use the same root .env file for configuration.
Required Variables
NEXTAUTH_SECRET- NextAuth secret keyJWT_SECRET- JWT token secret (shared across all services)MONGO_CLUSTER- MongoDB connection string (used by all services)POSTGRESS_DB_*- PostgreSQL database URLs (5 databases for web app)IMAGEKIT_*- ImageKit credentials (for web app media uploads)STRIPE_SECRET_KEY- Stripe API key (payment service)STRIPE_WEBHOOK_SECRET- Stripe webhook secret (payment service)NEXT_PUBLIC_CHAT_SERVER_URL- Chat server URL (web app)NEXT_PUBLIC_PAYMENT_SERVER_URL- Payment server URL (web app)CORS_ORIGIN- Allowed origins (chat and payment services)CLIENT_URL- Frontend URL (payment service)
OAuth Configuration (Optional)
DreamDot supports Google and GitHub OAuth authentication via NextAuth. OAuth providers are disabled by default and can be enabled via feature flags.
Enabling OAuth Providers
-
Set up OAuth credentials:
- Google: Get credentials from Google Cloud Console
- GitHub: Get credentials from GitHub Developer Settings
-
Add credentials to
.env:# Google OAuth GOOGLE_CLIENT_ID="your_google_client_id" GOOGLE_CLIENT_SECRET="your_google_client_secret" # GitHub OAuth GITHUB_ID="your_github_client_id" GITHUB_SECRET="your_github_client_secret"
-
Enable OAuth providers with feature flags:
# Server-side feature flags (for NextAuth) GOOGLE_OAUTH_ENABLED="true" # Set to "true" to enable Google OAuth GITHUB_OAUTH_ENABLED="true" # Set to "true" to enable GitHub OAuth # Client-side feature flags (for UI buttons) NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED="true" NEXT_PUBLIC_GITHUB_OAUTH_ENABLED="true"
-
Configure OAuth callback URLs:
- Google: Add
http://localhost:5000/api/auth/callback/google(dev) and your production URL - GitHub: Add
http://localhost:5000/api/auth/callback/github(dev) and your production URL
- Google: Add
-
Restart the development server for changes to take effect.
OAuth Feature Flags
- Server-side flags (
GOOGLE_OAUTH_ENABLED,GITHUB_OAUTH_ENABLED): Control whether providers are registered in NextAuth - Client-side flags (
NEXT_PUBLIC_GOOGLE_OAUTH_ENABLED,NEXT_PUBLIC_GITHUB_OAUTH_ENABLED): Control whether OAuth buttons appear in the UI - Both flags must be set to
"true"for OAuth to work - Setting flags to
"false"or omitting them disables OAuth entirely
โจ Vision
DreamDot is more than a platform โ it's a canvas for the dreamers. We believe in building a creative economy where expression meets ownership, and where your passion can power your livelihood.
๐ฏ Roadmap
- Social media features (posts, comments, likes)
- Follow/unfollow system
- Block/unblock functionality
- Marketplace with multiple item types
- Rich text editor for writings
- End-to-end encrypted chat
- Payment system with Stripe
- Balance management (replenish/redeem)
- Mobile applications
- Video streaming
- AI-powered recommendations
- Advanced analytics dashboard
- Multi-language support
- Subscription tiers for creators
- Advanced moderation tools
๐ค Contributing
This is a private project. For questions or issues, contact the development team.
๐ License
All rights reserved.
๐ Support
For support and questions:
- Check the Integration Guide
- Review the Architecture Documentation
- Consult the Environment Variables
- Contact the development team
Built with โค๏ธ using Next.js, Socket.IO, and Stripe