AI-Powered Chatbot Platform for Contentstack Integration
ContentPulse is a plug-and-play chatbot platform that seamlessly integrates with Contentstack CMS and leverages advanced Large Language Models (LLMs) like Groq and OpenAI to deliver intelligent, context-aware responses based on your content.
- Live Demo: https://contentpulse-contentpulse-contenpulse.eu-contentstackapps.com/
- NPM Package: https://www.npmjs.com/settings/hemantkadam/packages
- Demo Video: https://youtu.be/oL8AujXvVGY
- GitHub Repository: https://github.com/hemant-i7/ContentPulse
Create a chatbot that:
- Integrates with Contentstack to fetch dynamic content
- Uses LLMs (Groq/OpenAI) for intelligent responses
- Can be easily embedded on any website
- Provides real-time content-based answers to user queries
- π Secure Contentstack Integration: OAuth 2.0 authentication with Contentstack
- π Multi-Stack Support: Users can select from their available Contentstack stacks
- π― Personalized Responses: Chatbot serves content from user's selected stack
- π Dynamic Stack Switching: Change active stack without re-authentication
- π Contentstack Integration: Fetch products, articles, services, and any content type
- π€ AI-Powered Responses: Intelligent answers using Groq and OpenAI APIs
- π± Responsive Design: Works perfectly on desktop and mobile
- π Plug & Play: Easy integration with any website
- π¨ Customizable UI: Light/dark themes and configurable appearance
- π¬ Real-time Chat: Instant responses with typing indicators
- π Session Management: Maintain conversation context
- π‘οΈ Error Handling: Graceful fallbacks when APIs are unavailable
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β β β β
β Frontend βββββΆβ Backend βββββΆβ Contentstack β
β (Next.js) β β (NestJS) β β CMS β
β β β β β β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β β
β LLM APIs β
β (Groq/OpenAI) β
β β
βββββββββββββββββββ
- Node.js 18+ and npm
- Contentstack account and API credentials
- Groq API key or OpenAI API key
-
Clone the repository
git clone https://github.com/your-username/ContentPulse.git cd ContentPulse -
Install dependencies
npm install
-
Set up environment variables
Backend configuration:
cd apps/backend cp .env.example .envEdit
apps/backend/.envwith your credentials:PORT=8000 CONTENTSTACK_API_KEY=your_api_key CONTENTSTACK_ACCESS_TOKEN=your_access_token CONTENTSTACK_ENVIRONMENT=development GROQ_API_KEY=your_groq_key OPENAI_API_KEY=your_openai_key
Frontend configuration:
cd ../frontend cp .env.example .env.localEdit
apps/frontend/.env.local:NEXT_PUBLIC_API_URL=http://localhost:8000
-
Start the development servers
Using Turborepo (recommended):
npm run dev
Or start individually:
# Terminal 1 - Backend cd apps/backend npm run dev # Terminal 2 - Frontend cd apps/frontend npm run dev
-
Open your browser
- Frontend: http://localhost:3000
- Backend: http://localhost:8000
New! ContentPulse now supports Contentstack OAuth authentication for secure, personalized chatbot experiences.
-
Create OAuth App in Contentstack:
- Go to Contentstack Developer Settings
- Create new OAuth App with callback URL:
http://localhost:8000/auth/contentstack/callback - Copy Client ID and Client Secret
-
Update Backend Environment:
# Add to apps/backend/.env CONTENTSTACK_CLIENT_ID=your-client-id CONTENTSTACK_CLIENT_SECRET=your-client-secret CONTENTSTACK_CALLBACK_URL=http://localhost:8000/auth/contentstack/callback JWT_SECRET=your-secure-jwt-secret FRONTEND_URL=http://localhost:3000
-
Install Additional Dependencies (if not already done):
cd apps/backend npm install -
Test OAuth Flow:
- Visit http://localhost:3000
- Click "Login with Contentstack"
- Complete OAuth flow
- Select your Contentstack stack
- Start chatting with personalized content!
π For detailed setup instructions, see OAUTH_SETUP.md
-
Create Content Types in your Contentstack space:
products(with fields: title, description, price, category)articles(with fields: title, content, summary)services(with fields: title, description, features)tours(with fields: title, description, duration, price)
-
Get API Credentials:
- API Key: Found in Settings > Stack > API Key
- Access Token: Create in Settings > Tokens
- Environment: Usually 'development' or 'production'
Option 1: Groq (Recommended for speed)
- Sign up at https://groq.com
- Get your API key from the dashboard
- Add to
GROQ_API_KEYin your.envfile
Option 2: OpenAI
- Sign up at https://openai.com
- Get your API key from the dashboard
- Add to
OPENAI_API_KEYin your.envfile
import Chatbot from '@/components/Chatbot';
function MyWebsite() {
return (
<div>
<h1>My Website</h1>
{/* Your content */}
<Chatbot
theme="light"
height="400px"
welcomeMessage="Hi! How can I help you today?"
apiBaseUrl="http://localhost:8000"
/>
</div>
);
}<Chatbot
theme="dark"
height="500px"
placeholder="Ask me about our products..."
welcomeMessage="Welcome! I can help you find products, articles, and services."
apiBaseUrl="https://your-api.com"
/>POST /api/chat- Send chat messagesGET /api/chat/health- Health checkGET /api/chat/content-types- Get available content typesPOST /api/chat/search- Search specific content
Try these example queries:
- "Show me your products"
- "What services do you offer?"
- "Find articles about technology"
- "I'm looking for tours under $500"
- "Help me find information about..."
curl http://localhost:8000/api/chat/healthcurl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "Show me your products"}'ContentPulse/
βββ apps/
β βββ backend/ # NestJS API server
β β βββ src/
β β β βββ chatbot/ # Chatbot module
β β β β βββ chatbot.controller.ts
β β β β βββ chatbot.service.ts
β β β β βββ chatbot.module.ts
β β β βββ app.module.ts
β β β βββ main.ts
β β βββ .env.example
β βββ frontend/ # Next.js web app
β βββ src/
β β βββ app/
β β βββ components/
β β βββ Chatbot.tsx
β βββ .env.example
βββ packages/
β βββ chatbot-sdk/ # Reusable SDK (future)
βββ package.json
βββ turbo.json
βββ README.md
Production URL: https://contentpulse-contentpulse-contenpulse.eu-contentstackapps.com/
The application is currently deployed and running live! You can test all features including:
- OAuth authentication with Contentstack
- AI-powered chat responses
- Real-time content integration
- Responsive design across devices
- Push to GitHub
- Connect to Vercel
- Set environment variables in Vercel dashboard
- Deploy
-
Railway:
railway login railway init railway add railway deploy
-
Heroku:
heroku create your-app-name heroku config:set CONTENTSTACK_API_KEY=your_key heroku config:set GROQ_API_KEY=your_key git push heroku main
The chatbot supports light and dark themes:
<Chatbot theme="dark" /> // or "light"Override CSS classes for complete customization:
.chatbot-container {
/* Your custom styles */
}
.chatbot-message {
/* Message styling */
}Add new content types by:
- Creating them in Contentstack
- Adding them to
determineContentType()inchatbot.service.ts - Testing with queries
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if needed
- Submit a pull request
This project is licensed under the MIT License.
If you encounter any issues:
- Check the Issues page
- Create a new issue with:
- Environment details
- Error messages
- Steps to reproduce
- Multi-language support
- Advanced content filtering
- Analytics dashboard
- Voice input support
- Integration with more CMS platforms
- Custom webhook support
- Advanced conversation flows
Built with β€οΈ for the developer community
A modern monorepo for ContentPulse applications, built with Next.js (frontend), NestJS (backend), and a reusable chatbot SDK.
ContentPulse/
βββ apps/
β βββ frontend/ # Next.js application
β βββ backend/ # NestJS API server
βββ packages/
β βββ chatbot-sdk/ # Reusable chatbot SDK
βββ package.json # Root workspace configuration
βββ turbo.json # Turborepo configuration
βββ .gitignore # Git ignore rules
- Node.js (v18 or higher)
- npm or yarn
- Clone the repository:
git clone <your-repo-url>
cd ContentPulse- Install dependencies for all packages:
npm installStart all applications in development mode:
npm run devThis will start:
- Frontend (Next.js) on
http://localhost:3000 - Backend (NestJS) on
http://localhost:8000
Build all applications:
npm run buildnpm run dev- Start all apps in development modenpm run build- Build all applicationsnpm run start- Start all applications in production modenpm run lint- Lint all packagesnpm run test- Run tests for all packages
- Tech Stack: Next.js, TypeScript, Tailwind CSS
- Dependencies: axios, @tanstack/react-query
- Port: 3000
- Tech Stack: NestJS, TypeScript
- Dependencies: axios
- Port: 8000
- Tech Stack: TypeScript
- Purpose: Reusable chatbot functionality across applications
- Export: ES modules with TypeScript definitions
- Monorepo Management: Turborepo + npm workspaces
- Frontend: Next.js 15 with TypeScript and Tailwind CSS
- Backend: NestJS with TypeScript
- Package Manager: npm
- Build System: Turborepo for parallel builds and caching
The project uses Turborepo for efficient build caching and parallel execution. Configuration is in turbo.json.
npm workspaces are configured in the root package.json to manage dependencies across all packages.
- Code Style: Follow TypeScript and ESLint rules
- Commits: Use conventional commit messages
- Dependencies: Add shared dependencies at the workspace level when possible
Each application can be deployed independently:
- Frontend: Deploy to Vercel, Netlify, or any static hosting
- Backend: Deploy to Railway, Render, or any Node.js hosting
- SDK: Publish to npm registry for reuse
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
[Add your license here]