-
Notifications
You must be signed in to change notification settings - Fork 114
The Zetta Codebase
Matthew Dobson edited this page Jul 29, 2016
·
1 revision
Here is a general run down of the Zetta codebase.
The bulk of zetta is created with libraries we've created ourselves. Here are the base libraries and orgs that you should look at and follow.
- Argo -> https://github.com/argo
- argo/argo
- argo/argo-resource
- argo/argo-siren-formatter
- Medea -> https://github.com/medea
- Zetta -> https://github.com/zettajs -> There are many separate modules that are also baked into zetta.
- SPDY (not built by us)-> https://github.com/indutny/node-spdy
- WS (not built by us)-> https://github.com/websockets/ws
- zetta.js -> Main zetta class exposed for use in scripts
- zetta_runtime.js -> File that exposes everything for developers to consume
Directory that stores code coverage scripts and version release scripts.
Directory that holds the bulk of the zetta implementation.
- device_registry.js -> Leveldb based registry implementation for storing devices that have been exposed by the zetta server.
- event_broker.js -> Centralized class for gathering subscriptions from clients and apps and connecting those subscriptions to the appropriate zetta node.
- event_socket.js -> Class that sends websocket stream messages
- http_scout.js -> Vestigial
- http_server.js -> The base http server that wires up the API and accepts websocket connections
- logger.js -> Base logger class. Exposes logging functionality, and hooks to override behavior.
- peer_client.js -> Establishes connections from a hub zetta node to a cloud zetta node.
- peer_registry.js -> Leveldb based registry that holds information on peers that have been connected to.
- peer_socket.js -> Recieves connections from hub zetta nodes.
- pubsub_service.js -> Centralized places where events are gathered on a zetta server. Streams, server events, and transitions go through this to be propogated to objects in js, or to other zetta nodes via event broker.
- query.js -> Vestigial
- query_topic.js -> Parses device query stream topics
- registration_resource.js -> Vestigial
- registry.js -> Base class for the registries. Flat file leveldb. Subclass this for additional registries.
- runtime.js -> Essentially this is the
server
variable passed into apps. Allows for device queries and other hooks into zetta that aren't exposed in the server file. - spdy_agent.js -> Subclasses default http agent in nodejs to expose the spdy socket.
- virtual_device.js -> Abstraction for devices that are queried from another server.
- web_socket.js -> Basic websocket implementation to move away from WS eventually.
Holds our unit tests. They are written in Mocha.
Holds our API object templates. Uses the argo-formatter module
- device.siren.js -> Device template serves the
/servers/<id>/devices/<deviceId>
route - devices.siren.js -> Device list template serves the
/servers/<id>/devices
route - metadata.siren.js -> Metadata api to describe device models
/servers/<id>/devices/<type>/meta
- server.siren.js -> Server template serves the
/servers/<id>
route - type.siren.js ->
Holds our API resource business logic. Uses the argo-resource module
- devices.js -> Devices route handler
- peer_management.js -> Peer management route handler
- root.js -> Root route handler
- servers.js -> Servers route handler
Need help? Visit the Zetta Discuss List !
Need help? Visit the Zetta Discuss List ! |
---|
About Zetta
Videos and webcasts
- NEW! Building with Zetta
Tutorials
- NEW! Zetta tutorial series
- Quick start
- Configure a simple device
- Build a mock LED device
- Use the browser client
- Deploy a Zetta server to Heroku
Understanding Zetta
Writing Zetta drivers
- Finding Zetta device drivers
- Create a device driver from starter code
- More coming soon...
Using streams
Reference