GitHunt
CO

cotts/chat-api-bot

chat-api-bot

Chat API that can integrate with Bot modules



Archievements

  • Authenticated Users
  • Multiple Chat Rooms
  • Can be integrated to bots

Available Routes


  • POST /api/v1/user/ - Create User
  • POST /api/v1/user/login - Authenticate user
  • GET /ai/v1/message/:roomId - Retrieve the latest 50 messages given a room : roomId

P.S. : All routes requires and authorization token authorization : 't0k3nh3r3'



Bots

This API services use the bot list below:

  • Stock Bot - check out here
    • Command to call bot inside the rooms: /stock=STOCK_CODE



How to run

1- Install dependencies

npm i
##or
yarn

2- Set environment keys

PORT=         # Server Port:Default 5000
DB_HOST=      # Database Host (mongoDB)
DB_USER=      # Database user
DB_PASS=      # Database password
DB_NAME=      # Database name
APIKEY=       # Authorization APIKEY
PASSWORD_KEY= # Password Encryption Key
CORS_LIST=    # Socket CORS sites authorized
ROOMS_LIST=   # Socket Rooms List
BOT_LIST=     # Authorized Bot List

3 - Run Service

3.1 - In Development Mode

npm run dev
#or
yarn dev

3.2 - In Production Mode

npm start
#or
yarn start


TBD

  • Unit Tests
  • Increase token validation
  • Set up socket Token

Languages

JavaScript98.9%Shell1.1%

Contributors

MIT License
Created March 8, 2021
Updated March 10, 2021
cotts/chat-api-bot | GitHunt