Chat Bot Project Setup Guide

Chat Bot Project Setup Guide

This guide provides step-by-step instructions for setting up the chat bot project on Glitch.

Introduction to Web Servers and REST APIs

What is a Web Server?

What Does a Web Server Do?

How Web Servers Work

REST API Overview

Example Project on Glitch

Let's move our chat bot server code to Glitch:

Setting up on Glitch

  1. Create a New Project:
    • Go to Glitch.
    • Click on "New Project" and choose a template. For this guide, use "hello-webpage" (or any basic starter project).
  2. Cloning or Importing Code:
    • Import from GitHub: If your project is in a GitHub repository, use "Import from GitHub" to clone it directly.
    • Manually Upload Files: Alternatively, copy and paste the provided server.py, requirements.txt, and simple_frontend.html into your Glitch project files.

Configuring the Environment

Add any required environment variables (like API keys) via the "Secrets" section in Glitch.

Running the Project

  1. Setting up Dependencies:
    • Ensure the requirements.txt file lists all necessary Python packages.
    • Click "Terminal" or "Console" to manually install dependencies: pip install -r requirements.txt.
  2. Starting the Server: Run the server using the command: python server.py.
  3. Accessing the Frontend: Create or upload your simple_frontend.html file. Click "Show" to access the frontend in a new tab.

Testing the Server

Practice Time

Encourage the students to:

Summary

Resources