-
Notifications
You must be signed in to change notification settings - Fork 19
How it works
- Client is in the browser.
- Asynchronous web server handles request from client and communicates with connected newebes.
- Server actions are available through REST web services.
- Communications between Newebe nodes are also based on REST principles.
- A document database stores the data.
- All data is represented in a document. Newebe communicates with each other by sending documents directly to one another.
Client side architecture is based on Backbone JS framework :
- Models handle data locally.
- Model could have a view linked to it to display any instance of it efficiently in the UI.
- A view for the whole application manages widgets, models and database interactions.
- A router makes the app to have the right behavior when a route is written in the hashpart of the URL.
Every application of Newebe has separate, modular code.
- Platform: A module wrapping all other modules allowing the user to browse applications via a menu.
- Profile: handles profile data.
- Contact: manages contacts.
- News: publishes microposts.
- Pictures: publishes pictures.
- Notes: saves personal notes.
- Activities: Displays activities from newebe owner and contacts. Launches synchronization process.
The server is a set of resources triggered via HTTP requests.
This is how client calls are processed :
- Checks authentication through a cookie if needed.
- Checks to confirm sent data is correct.
- If everything is OK, requested data is sent in response.
- When something is created or modified (micropost posting, profile edit...), data is sent to trusted contacts.
To facilitate view building, server serves HTML pages for each application that contains the layout. Data is filled with client code. Pages are rendered twice: layout is rendered from server template and data displayed through client.
Server sends requests to contacts and handles requests from contacts. When a request is received, the server checks to see if contact key is listed in the trusted contact list, then it handles it.
Database is handled by CouchDB, a scheme-free database (NoSQL) that stores data as document (JSON objects). Each table is built with two javascripts function.
CouchDBkit is a python library, that allows access to DB as with an ORM (Object-relational mapping).
Newebe uses both CouchDB and CouchDBkit in a very simple way. To learn more, read the CouchDB documentation.