This guide provides step-by-step instructions for integrating and setting up the DreamDot platform.
- Prerequisites
- Environment Setup
- Database Configuration
- Service Integration
- Running the Application
- Testing
- Deployment
- Node.js: v20.0.0 or higher
- npm: v10.0.0 or higher
- Git: Latest version
- MongoDB: v6.0 or higher (or MongoDB Atlas account)
- PostgreSQL: v14 or higher (or Neon account)
- MongoDB Atlas: For MongoDB hosting
- Neon (or similar): For PostgreSQL hosting
- Stripe: For payment processing
- ImageKit: For media hosting
- Replit/Vercel: For deployment
# Clone the repository
git clone <repository-url>
cd dreamdot
# Install dependencies for all workspaces
npm install
# Install payment service dependencies
cd apps/payment
npm install
cd ../..Copy the environment template and configure it:
# From root directory
cp .env.example .env
# Edit the .env file with your credentials
# See .env.example for all required variables for all services- Go to MongoDB Atlas
- Create a new cluster
- Set up database user with read/write permissions
- Whitelist your IP address (or use 0.0.0.0/0 for development)
- Get connection string
MongoDB will automatically create these collections:
conversations- Chat conversationsmessages- Encrypted chat messagesitems- Digital itemswritings- Blog posts and articlesdigitalarts- Digital art piecescomics- Comic strips and mangatransactions- Payment transactions
- Go to Neon or your PostgreSQL provider
- Create 5 separate databases:
dreamdot_userdreamdot_socialdreamdot_itemsdreamdot_communitydreamdot_audit
cd apps/web
# Generate Prisma clients
npx prisma generate --schema=src/lib/prisma/schema.user.prisma
npx prisma generate --schema=src/lib/prisma/schema.social.prisma
npx prisma generate --schema=src/lib/prisma/schema.item.prisma
npx prisma generate --schema=src/lib/prisma/schema.community.prisma
npx prisma generate --schema=src/lib/prisma/schema.audit.prisma
# Push schema to databases
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- Sign up at ImageKit
- Create a new account
- Get your credentials:
- Public Key
- Private Key
- URL Endpoint
- Add to
.envfiles
- Sign up at Stripe
- Get your test API keys from Dashboard
- Set up webhook endpoint:
- URL:
https://your-payment-service.com/webhook/stripe - Events to listen:
checkout.session.completed,checkout.session.expired
- URL:
- Get webhook secret
- Add all credentials to
.env
# Install Stripe CLI
brew install stripe/stripe-cli/stripe
# or download from https://stripe.com/docs/stripe-cli
# Login to Stripe
stripe login
# Forward webhooks to local payment service
stripe listen --forward-to localhost:3002/webhook/stripe# From root directory
npm run devTerminal 1 - Next.js App:
cd apps/web
npm run devTerminal 2 - Chat Server:
cd apps/chat
npm run devTerminal 3 - Payment Service:
cd apps/payment
npm run dev- Web App: http://localhost:5000
- Chat Server: http://localhost:3001
- Payment Service: http://localhost:3002
- User can sign up
- User can sign in
- User can sign out
- Session persists on reload
- Create a post
- Comment on a post
- Like a post
- Follow a user
- Unfollow a user
- Block a user
- Unblock a user
- Create a digital item
- Create a writing/blog
- Create digital art
- View items in marketplace
- Search for items
- Start a conversation
- Send text messages
- Messages are encrypted
- Typing indicators work
- Messages persist
- Replenish balance (test mode)
- View transaction history
- Initial balance is correct
- Redeemable balance calculated correctly
Use tools like Postman or curl:
# Test user registration
curl -X POST http://localhost:5000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"password123"}'
# Test follow user
curl -X POST http://localhost:5000/api/social/follow \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"targetUserId":"user-uuid"}'- Connect repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy command:
cd apps/web && npm run build - Start command:
cd apps/web && npm start
- Create new service
- Connect repository
- Set root directory to
apps/chat - Set environment variables
- Build command:
npm install - Start command:
npm start
- Create new service
- Connect repository
- Set root directory to
apps/payment - Set environment variables
- Build command:
npm install - Start command:
npm start
Update all service URLs in production .env:
NEXT_PUBLIC_CHAT_SERVER_URL=https://chat-production-url.com
NEXT_PUBLIC_PAYMENT_SERVER_URL=https://payment-production-url.com
CORS_ORIGIN=https://your-production-domain.com
CLIENT_URL=https://your-production-domain.com
NEXTAUTH_URL=https://your-production-domain.com- Verify connection strings are correct
- Check IP whitelist in MongoDB Atlas
- Ensure databases exist in PostgreSQL
- Check CORS_ORIGIN includes your frontend URL
- Verify Socket.IO path is correct
- Check firewall allows WebSocket connections
- Verify Stripe keys are for correct environment (test/live)
- Check webhook secret matches Stripe dashboard
- Ensure webhook URL is publicly accessible
- Verify ImageKit credentials
- Check file size limits
- Ensure CORS is configured in ImageKit
Enable debug logging:
# Add to .env files
DEBUG=*
NODE_ENV=developmentFor issues and questions:
- Check existing documentation
- Review error logs
- Consult ARCHITECTURE.md
- Check environment variables
After successful integration:
- Customize branding and theme
- Set up monitoring and logging
- Configure backup strategies
- Plan scaling strategy
- Review security settings
- Set up CI/CD pipeline