This project demonstrates how to create a chatbot using React for the frontend and Rasa for the backend. The backend is implemented in Python 3.8 using virtualenv
for environment management.
- Node.js
- Python 3.8
- pip
- virtualenv
git clone https://github.com/your-username/react-rasa-chatbot.git
cd react-rasa-chatbot
cd backend
python3.8 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
requirements.txt
should include:
rasa==3.0.0
rasa-sdk==3.0.0
rasa train
rasa run
If you have custom actions, start the action server:
rasa run actions
cd ../frontend
npm install
npm start
In the React app, update the Rasa server URL to match where your Rasa server is running. This is usually done in the src/App.js
file or wherever the Rasa server endpoint is specified.
const rasaServer = 'http://localhost:5005/webhooks/rest/webhook';
react-rasa-chatbot/
│
├── backend/
│ ├── actions/
│ ├── data/
│ ├── models/
│ ├── config.yml
│ ├── domain.yml
│ ├── endpoints.yml
│ └── requirements.txt
│
└── frontend/
├── public/
├── src/
├── package.json
└── README.md
To stop the Rasa server and React development server, use Ctrl+C
in their respective terminal windows.
deactivate
- Ensure that both the Rasa and React servers are running on different ports.
- Verify that the Rasa server URL is correctly configured in the React app.
Feel free to contribute by submitting pull requests or issues to this repository. Ensure that your code adheres to the project's coding standards and includes tests where applicable.
This project is licensed under the MIT License.