If you don't know what Chatible is, it's a Messenger bot that allows you to chat with someone random. I love its idea, but I don't want to chat with a total stranger. It would be great if we have something in common. Studying at the same school sounds good, so I cloned Chatible for my school, which I call PTNK Chatible (PTNK stands for my school name).
Currently only Vietnamese is supported. English will be added soon.
Chatible clone written in TypeScript, based on Node, Express and Mongo
- Deploy to Heroku using the deploy button.
- Create a cluster on MongoDB Atlas. Whitelist IP addresses.
- Create an app on Facebook. Install Webhook. Get app secret and tokens.
- Set Heroku's
Config Vars. Check here to know which variables you need to set.
- Admin dashboard (code)
- Pair by gender (e.g. male with female)
- Send cute dog/cat pictures
- Customizable message templates
- Cache database in memory to increase performance
- Developed with performance in mind
- Allow editing profile via Messenger Webview
- Limiting rate of requests sent out to avoid being converted to high-MPS page
This project is licensed under the MIT License - see the LICENSE.md file for details
PTNK Chatible is written in TypeScript, run on Node.js.
express is used to handle webhook events from Facebook.
The database is the most interesting thing. Data is stored in MongoDB Atlas. mongoose is used to interact with MongoDB Atlas. However, MongoDB Atlas is slow. To work around this, I store the entire database in megahash, a super-fast C++ hash table with wrappers for Node.js.
I have plan to switch to a proper cache module. I'm considering node-cache.
For deployment, I use Heroku Hobby Dyno from GitHub Student Pack.
I want to express my gratitude to GitHub and Heroku. This project will be much harder to complete without them.