help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
slack-bot-assistant
RSK World
slack-bot-assistant
Slack Bot Assistant - Python + Slack API + SQLite + PHP Dashboard + Bot Commands + Automation
slack-bot-assistant
  • static
  • templates
  • .env.example73 B
  • .gitignore61 B
  • LICENSE1.2 KB
  • README.md1.9 KB
  • RELEASE_NOTES.md1.3 KB
  • app.py1.7 KB
  • bot_logic.py4.3 KB
  • database.py1.8 KB
  • models.py2.2 KB
  • requirements.txt58 B
app.py
app.py
Raw Download
Find: Go to:
# Project: E-commerce Chatbot
# Developed by: Molla Samser
# Team: Rima Khatun (Designer & Tester)
# Website: https://rskworld.in
# Email: support@rskworld.in
# Year: 2026
# "Empowering E-commerce with AI"

import os
from flask import Flask, render_template, request, jsonify
from dotenv import load_dotenv
from database import db, init_db
from bot_logic import get_bot_response, search_products
from models import Product, Order

load_dotenv()

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///instance/ecommerce.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

# Ensure instance folder exists
if not os.path.exists('instance'):
    os.makedirs('instance')

init_db(app)

@app.route('/')
def index():
    return render_template('index.html')

@app.route('/chat')
def chat_page():
    return render_template('chat.html')

@app.route('/admin')
def admin_page():
    return render_template('admin.html')

@app.route('/api/chat', methods=['POST'])
def chat():
    data = request.json
    user_message = data.get('message')
    history = data.get('history', [])
    
    assistant_response = get_bot_response(user_message, history)
    
    return jsonify({
        'response': assistant_response
    })

@app.route('/api/products')
def api_products():
    query = request.args.get('q', '')
    if query:
        products = search_products(query)
    else:
        products = [p.to_dict() for p in Product.query.all()]
    return jsonify(products)

@app.route('/api/orders')
def api_orders():
    orders = [o.to_dict() for o in Order.query.all()]
    return jsonify(orders)

if __name__ == '__main__':
    app.run(debug=True)
68 lines•1.7 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer