Simple chat server written in Go (demo project for "Backend Challenge Hackathon")
- docker
- docker-compose
To run the project locally all you have to do is run:
docker-compose up server
Requires no auth, creates new user if not exists, or sings in existent user by generating JWT Token
{
"user_name": "conorMcGregor",
"password": "illbeatyoass"
}
{
"id": "5d091716db8212e1a2efb33a",
"user_name": "conorMcGregor",
"credentials": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NjA5NjMyMjUsImlhdCI6MTU2MDg3NjgyNSwidXNlcl9pZCI6IjVkMDkxNzE2ZGI4MjEyZTFhMmVmYjMzYSIsInVzZXJuYW1lIjoibmV3dXNlciIsInBhc3N3b3JkIjoiXHVmZmZkXHVmZmZkJ1x1MDAxMlx1ZmZmZFx1ZmZmZEBcdWZmZmRcdTAwMTJRXHVmZmZkXHVmZmZkYdWt3qVv25oifQ.eruNfiyxFSm3H1s4uleY9Cuxw-D6qbjukjwI1kTwn70"
}
Returns a list of existing users
{
"users": [
{
"user_id": "5d061d45c73985d0b598b0a5",
"user_name": "nagibator"
},
{
"user_id": "5d091e4ddb8212e1a2efb33c",
"user_name": "conorMcGregor"
}
]
}
Returns info for specific user
{
"user_id": "5d091e4ddb8212e1a2efb33c",
"user_name": "conorMcGregor"
}
Returns a list of rooms available
[
{
"room_id": "5d07348c594a0972c8010faf",
"room_name": "memes",
"creator_id": "5d062c9120f31443e4cdd449",
"created_at": "2019-06-17T06:34:52.504Z",
"members": [
{
"user_id": "5d091e4ddb8212e1a2efb33c",
"user_name": "conorMcGregor"
}
]
},
{
"room_id": "5d07388c32749f0d3885cb04",
"room_name": "morememes",
"creator_id": "5d062c9120f31443e4cdd449",
"created_at": "2019-06-17T06:51:56.005Z",
"members": []
}
]
Returns info for a given room
{
"room_id": "5d07348c594a0972c8010faf",
"room_name": "memes",
"creator_id": "5d062c9120f31443e4cdd449",
"created_at": "2019-06-17T06:34:52.504Z",
"members": [
{
"user_id": "5d091e4ddb8212e1a2efb33c",
"user_name": "conorMcGregor"
}
]
}
Adds a new chat room
{
"name": "bestoftinder"
}
{
"room_id": "5d092005db8212e1a2efb33d",
"room_name": "bestoftinder",
"creator_id": "5d091716db8212e1a2efb33a",
"created_at": "2019-06-18T17:31:49.428210839Z",
"members": []
}
Removes specific chat room (by room creator)
{
"message": "room removed successfully"
}
Adds current user to a given chatroom
{
“result”: “user successfully joined the room”
}
Removes current user from a given chatroom
{
“result”: “user successfully left the room”
}
Sends message to all connected via Websockets clients
{
"room_id": "5d07348c594a0972c8010faf",
"message": "I’m going to the stars and then past them."
}
{
"result": "message successfully sent"
}
{
"user_id": "5d092005db8212e1a2efb33d",
"room_id": "5d07348c594a0972c8010faf",
"message": "I’m going to the stars and then past them."
}
Chat Bot is an app that listens on websocket connection, and replies to messages that starts with @bot mention
Bot uses Dialogflow as NLU Service for speach generation
To run the project locally all you have to do is run:
docker-compose up chatbot