https://github.com/amanastel/chatapp
Group chat app built with django-channels
https://github.com/amanastel/chatapp
chat-app chat-application django django-channels mysql python python3 user-experience
Last synced: 7 months ago
JSON representation
Group chat app built with django-channels
- Host: GitHub
- URL: https://github.com/amanastel/chatapp
- Owner: Amanastel
- Created: 2023-09-10T19:25:01.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-18T20:48:23.000Z (about 2 years ago)
- Last Synced: 2025-01-13T02:41:23.315Z (9 months ago)
- Topics: chat-app, chat-application, django, django-channels, mysql, python, python3, user-experience
- Language: Python
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chat App
Group chat app built with Django, django-channels, and rest_framework## Table Of Contents
- [Chat App](#chat-app)
- [Table Of Contents](#table-of-contents)
- [Installation](#installation)
- [Setup](#setup)
- [Features](#features)
### Installation
- Clone this repository https://github.com/amanastel/ChatApp
```sh
git clone https://github.com/amanastel/ChatApp
cd chat-app
```
- Activate the local environment
```sh
virtualenv env
source env/bin/activate
```
- Install the requirements
```sh
pip3 install -r requirements.txt
```
- Migrate the database
```sh
./manage.py makemigrations
./manage.py migrate
```### Setup
Go to app/settings.py to set your Redis url
```py
CHANNEL_LAYERS = {
"default":{
"BACKEND":"channels_redis.core.RedisChannelLayer",
"CONFIG":{
"hosts":[('localhost', 6379)],
}
},
}
```
You can run the server by using command
```sh
./manage.py runserver
```Create your bot!
```
./manage.py create_botUsername for your bot : ganteng
File name to generate : bot_ganteng.py
Bot Description : Test
Message Handler (e.g : /hello,/fush,/foo) : /hello,/world
File created /home/vvvv/project/app/bots/bot_ganteng.py
User for bot created!```
The command will automatically create a user for the bot, and save a file to execute bot commandsYou can customize the response bot in the file that was created
```pythonasync def execute_command(argument, group_room_code):
return "Change this response!"
```Activate your bot in room settings!
### Features
- Login and Register
- Any logged in user can create a room
- Authenticated user can generate new room code, and delete their own room
- Basic Bot feature
- Messages saved to database
- Messages from not logged in user will no saved to database