A futuristic, space-themed AI platform for personalized promotions and intelligent customer support
Features • Workflows • Installation • Usage • API Reference • Tech Stack
This project combines cutting-edge AI technology with an immersive space-themed interface to deliver two powerful functionalities:
- Promotion AI: Generate personalized promotional messages for targeted marketing campaigns
- Customer Support AI: Provide intelligent, context-aware customer service with order management
Both systems feature speech recognition, text-to-speech capabilities, and real-time AI processing powered by OpenAI's GPT models.
- Personalized promotional message generation
- Dynamic content creation based on customer data
- Text-to-speech conversion for audio promotions
- Customizable offers and product recommendations
- Intelligent query understanding and response
- Order tracking and management
- Natural language processing for customer inquiries
- Voice interaction with speech-to-text and text-to-speech
- Futuristic space-themed interface
- Voice input/output capabilities
- Real-time AI responses
- Responsive and accessible design
Objective: Deliver personalized promotional messages to individual customers based on their profiles and targeted campaigns.
graph LR
A[User Input] --> B[Frontend]
B --> C[POST Request]
C --> D[Backend Processing]
D --> E[OpenAI GPT]
E --> F[Generated Message]
F --> G[Frontend Display]
F --> H[Text-to-Speech]
H --> I[Audio Playback]
-
Frontend Interaction
- User provides customer details through the space-themed interface
- Input includes: customer name, product, discount offer, and promotional link
- Data sent via POST request to backend
-
Backend Processing
- Receives customer data and promotional parameters
- Constructs personalized message using OpenAI's GPT model
- Applies dynamic templating for natural, engaging content
Example:
Input: {
"name": "John",
"product": "Smartphone X",
"offer": "20% off",
"link": "https://example.com"
}
Output: "Hi John! We're thrilled to offer you an exclusive 20%
discount on Smartphone X. Don't miss out! Visit https://example.com
to grab your deal."- Output
- Generated message displayed in the UI
- Optional audio conversion using TTS for voice promotions
- Message can be saved or sent directly to customer
Objective: Assist customers by answering queries and providing detailed order information.
graph LR
A[Customer Query] --> B[Speech/Text Input]
B --> C[Frontend Processing]
C --> D[POST Request]
D --> E{Query Type}
E -->|General| F[AI Response]
E -->|Order Related| G[Order Lookup]
G --> H[orders.json]
H --> I[Order Details]
I --> F
F --> J[Text Response]
J --> K[Text-to-Speech]
K --> L[Audio Playback]
-
Frontend Interaction
- User speaks or types their query in the interface
- For order queries: name and order ID are provided
- Data transmitted to backend via POST request
-
Backend Processing
For General Queries:
- AI analyzes query intent using GPT model
- Generates response based on customer service prompt
- Returns helpful, context-aware answer
For Order-Related Queries:
- Backend searches
orders.jsonfor matching order ID - If found: retrieves order details (status, items, delivery info)
- If not found: generates apologetic response with troubleshooting tips
- AI integrates order data into natural language response
-
Output
- AI-generated response displayed as text in UI
- Response converted to speech for audio playback
- Accessible format ensures clear communication
- Web Speech API captures user voice input
- Real-time conversion from speech to text
- Seamless integration with query processing
- Hands-free interaction for accessibility
- Converts all responses to natural-sounding audio
- Supports promotional messages and support responses
- Base64-encoded audio streaming
- Multiple voice options available
- JSON-based order storage (
orders.json) - Real-time order retrieval and lookup
- Dynamic order creation through API
- Scalable data structure for order tracking
- Node.js (v14 or higher)
- npm or yarn
- OpenAI API key
- Clone the repository
git clone https://github.com/yourusername/ai-promotion-support.git
cd ai-promotion-support- Install dependencies
npm install-
Configure environment variables
Create a
.envfile in the root directory:
OPENAI_API_KEY=your_openai_api_key_here
PORT=3000-
Set up orders database
Create
orders.jsonin the data directory:
{
"orders": [
{
"orderId": "12345",
"customerName": "John Doe",
"product": "Smartphone X",
"status": "Shipped",
"deliveryDate": "2025-12-10"
}
]
}- Start the application
npm start-
Access the application
Open your browser and navigate to
http://localhost:3000
- Navigate to the Promotion AI section
- Enter customer details:
- Customer name
- Product name
- Discount offer
- Promotional link
- Click Generate Promotion
- View the personalized message
- Optional: Click Play Audio to hear the promotion
- Navigate to the Customer Support section
- Choose input method:
- Type your query, or
- Click the microphone icon to speak
- For order queries, provide:
- Your name
- Order ID
- Submit your query
- Receive AI-generated response
- Optional: Listen to audio response
POST /api/promotion
Request:
{
"name": "John",
"product": "Smartphone X",
"offer": "20% off",
"link": "https://example.com"
}
Response:
{
"message": "Hi John! We're thrilled to offer...",
"audio": "base64_encoded_audio_string"
}POST /api/support
Request:
{
"query": "Where is my order?",
"name": "John Doe",
"orderId": "12345"
}
Response:
{
"response": "Your order #12345 is currently...",
"audio": "base64_encoded_audio_string",
"orderDetails": { ... }
}GET /api/orders/:orderId
POST /api/orders - Create new order
- HTML5, CSS3, JavaScript
- Web Speech API
- Responsive Design
- Space-themed UI/UX
- Node.js
- Express.js
- OpenAI GPT API
- JSON-based data storage
- OpenAI GPT-4
- Natural Language Processing
- Text-to-Speech (TTS)
- Speech Recognition
.
├── public/
│ ├── index.html
│ ├── styles.css
│ └── script.js
├── src/
│ ├── routes/
│ │ ├── promotion.js
│ │ └── support.js
│ ├── services/
│ │ ├── ai.js
│ │ ├── tts.js
│ │ └── orders.js
│ └── app.js
├── data/
│ └── orders.json
├── .env
├── package.json
└── README.md
- API keys stored securely in environment variables
- No customer data logged or stored permanently
- HTTPS recommended for production deployment
- Input validation and sanitization implemented
- Multi-language support
- Advanced analytics dashboard
- CRM integration
- Email/SMS notification system
- Machine learning for intent classification
- Database integration (PostgreSQL/MongoDB)
- User authentication and authorization
- Rate limiting and API security
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Ashish Rautela - GitHub
- OpenAI for GPT API
- Web Speech API contributors
- Space-themed design inspiration
Made with ❤️ and AI