Skip to content

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.

Notifications You must be signed in to change notification settings

riju-talk/DreamDot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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)

  1. Users Database (POSTGRESS_DB_USER)

    • Authentication, profiles, user analytics
    • Security, sessions, certificates
  2. Social Database (POSTGRESS_DB_SOCIAL)

    • Posts, comments, likes
    • Following/blocking relationships
    • Notifications
  3. Items Database (POSTGRESS_DB_ITEMS)

    • Item metadata, transactions, reviews
    • Favorites, collections, monetization
  4. Community Database (POSTGRESS_DB_COMMUNITY)

    • Communities, memberships
    • Community posts and discussions
  5. 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:all

The application will be available at:


πŸ“š Documentation


πŸ—οΈ 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:dev

Build 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 key
  • JWT_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

  1. Set up OAuth credentials:

  2. 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"
  3. 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"
  4. 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
  5. 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:

  1. Check the Integration Guide
  2. Review the Architecture Documentation
  3. Consult the Environment Variables
  4. Contact the development team

Built with ❀️ using Next.js, Socket.IO, and Stripe

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published