CodeBot is a chatbot that helps beginners learn how to code. To make the otherwise daunting task of learning how to code for the first time easier, CodeBot incorporates witty replies, GIFs & human-readable errors to create an incredibly fun experience for a complete novice. Currently, it goes through a few basic exercises in Python (adapted from Codecademy) while answering any questions on the way. The back-end runs on Node.js, MongoDB & api.ai while the front-end is written in vanilla HTML, CSS & JavaScript. The initial prototype for CodeBot was built during the Facebook Singapore Hackathon 2016.
- Install Node.js & npm
- Update
npm
using$ npm install npm -g
- Update
- Install MongoDB
- Install RoboMongo (Optional)
$ brew install node # Install Node.js
$ brew install mongodb # Install MongoDB
$ brew cask install robomongo # Install RoboMongo (Optional)
$ brew services start mongodb # Start MongoDB
- Clone this repo or download the .zip here.
- Navigate to this repo on your terminal and run
$ npm install
to install all the dependencies. - Start MongoDB using the instructions here.
- Initialize the database using
$ node dbCreator.js
. - Create a directory —
/userScripts
— and an empty file namedtest.py
inside to process the user's submitted Python scripts. - Run CodeBot on
http://localhost:3000/
using$ node index.js
.
$ npm install
$ brew services start mongodb # Start MongoDB (via Homebrew)
$ node dbCreator.js
$ mkdir userScripts && cd userScripts && touch test.py && cd ..
$ node index.js
| - modules
| | - codeChecker.js // Checks User Submitted Python Code
| | - levenshtein.js // Word Distance Calculator (dependency of codeChecker.js)
| | - messageHandler.js // Handles User Messages over Chat
| | - pythonDict.js // Dictionary of Python Keywords (dependency of codeChecker.js)
| - node_modules // Node.js Dependencies (see package.json)
| - public // Front-End Files (served at '/')
| | - assets // Images, GIFs, etc.
| | - css // CSS Stylesheets
| | | - main.css
| | - js // Client-Side Scripts
| | | - main.js
| | - favicon.ico // Favicon
| - userScripts // User Submitted Python Code
| | - test.py
| - dbCreator.js // Initializes Database
| - index.html // Client-Side Chat Interface
| - index.js // Node.js Entry Point
See contributing guidelines here.
- All Python Errors → Human-Readable Errors
- Refine Curriculum / Database Content
- Improve Existing Bot Replies
- Add More Variation in Bot Replies
- Make Bot Instructions for Exercises Friendlier
- Improve In-line Code Styling for Instructions & Example Code
-
Clean UpcodeChecker.js
-
Clean Up Front-End Code -
Post-Hackathon Cleanup of Code & Git History -
Add Setup Instructions to README -
Remove Hardcoding innextExercise()
-
Splitindex.js
into Separate Files -
Redo Database Structure