This README would normally document whatever steps are necessary to get your application up and running.
- Quick summary just boo it!
- Version ver0.01
- Learn Markdown
- Summary of set up
- Configuration
Dependencies
- Gem Packages: sinatra, em-websocket, mongo(module) , bson_ext
- Others: MongoDB
Database configuration
: you need 2 collections(tables) to try this project. Please named the database "Boo" and create a collection with name "accounts" manually. The fields of accounts is {username, password, friends_list}. And initialize at least 2 users with username, password and relationship. Note that you don't need to create collection named "dialog" previously.- An alternative is use our sample database dump. You can find it in root directory of this project. Open your terminal and come to here, use
mongorestore Boo
, then all goes well.
- An alternative is use our sample database dump. You can find it in root directory of this project. Open your terminal and come to here, use
- How to run tests
- Deployment instructions
- Writing tests
- Code review
- Other guidelines
- Repo owner or admin
- Other community or team contact
- Backend Language: Ruby (2.1.2)
- Framework: Sinatra
- Files:
- au_boo_d.rb - authentic server. (Controller)
- ch_boo_d.rb - Boo it! server. (Model)
- views - contains all pages that display works. most of them implemented in HAML format.
- public - contains all resource, such as images, Javascript, and CSS.
- test - some testing files for developing duration.
- Database: MongoDB
- Use 2 terminals and make both of them enter the boo-it directory.
- Use
ruby au_boo_d.rb
andruby ch_boo_d.rb
to launch server respectively. - Open your browser with 2 tabs.
- Connect to url
localhost:4567
for both tabs. Then you got a NOT FOUND message. Please wait for 3 seconds and you'll be redirected to login page. - Enter account info with 2 different users.
- DOUBLE CLICKS to select friend you want to chat with, here, the object was these 2 users.
- Enjoy your conversation!
There are 2 servers serving for service, au_boo_d.rb and ch_boo_d.rb. The former roles as controller. When a user request to server. au_boo_d.rb does authentication and routing if account is valid; while the latter roles as model which interact with database.
When a connection is built. It initially located at root directory(/). There is no service in root directory, so the controller(au_boo_d.rb) will redirect it to page "logout". Since it logout(or say, not actually logout, it just visit this site currently), the page will redirect it to hello.haml, which provides a login portal for users.