Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/machine
User software environment for the Web
https://github.com/pfrazee/machine
Last synced: 17 days ago
JSON representation
User software environment for the Web
- Host: GitHub
- URL: https://github.com/pfrazee/machine
- Owner: pfrazee
- Created: 2014-02-25T02:46:11.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-10T04:02:06.000Z (over 10 years ago)
- Last Synced: 2024-04-14T14:46:50.454Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.17 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Machine
Run `./machine setup` to prep, `npm start` (or `./machine start`) to run server and `npm test` (or `./machine test`) to run tests.
Config is stored in `./config.json`, which is created after setup and should be modified. Its values can be overriden with `./machine start` params, type `./machine` to see the full list of config/switches.
#### LevelDB structure
Here's how I went with it. `./lib/db.js` gives a good overview.
- The server's dataset is split up into directories
- Main database has an entry for each directory. The directory ID is the keyname. It contains data about the dir (eg perms/owner)
- Each dir has two sublevels (check level-sublevel for explanation): a meta sublevel and a document sublevel.
- The ID for an added document is shared between the meta and document sublevel. Makes it easy to lookup the other.
- A single ID counter is maintained to assign time-of-insertion-ordered IDs for the entire DB. A given sublevel will have gaps in its id-space, but that doesnt matter so long as they are constantly increasing. [Based on this suggestion](http://stackoverflow.com/questions/16554808/leveldb-iterate-keys-by-insertion-order)#### About the frontend
Frontend JS is compiled with browserify. Run `./machine build` to rebuild. Also, all templates are in `./static` as .html files, and they are loaded into memory at server load. If you make changes to them, you either restart the server, or run `./machine reload` to trigger a config and template reload. (Not ideal, I know. Maybe we can add a dev-flag to always load templates from disk each request.)
#### v1 Checklist
Done:
- Directories and documents
- Dirs: create/delete/get/getMeta
- Docs: create/delete
- Auth with Persona
- Owner perms on directoriesTodo:
- Frontend
- Overall styles
- Directory rendering
- 3rdparty App Auth
- Directory SSE streams