inspired-server
is the first component of the inspired JS toolset.
- Fully RESTful entity server (~50%)
- Code-on-Demand: Use your JS models anywhere
- DB Schema generated automatically from your models
All the documentation is available here: http://inspired-server.readthedocs.org
- Install
inspired-server
via npm - Write some models
- Register your models in your app
You can use your models anywhere, like this:
// Create an entity
var entity1 = new App.Entity.Article()
entity1.body = "Lorem ipsum..."
entity1.save()
.then(function() { ... })
.catch(function() { ... })
// Load an entity by UUID
var entity2 = new App.Entity.Article()
entity2.body = "Lorem ipsum..."
entity2.load('xxxxx-xxxx-xxxxx')
.then(function() { ... })
.catch(function() { ... })
// Check out the docs for collections and entity management
Your models will look somewhat like this:
class MyEntity extends App.Entity.Default
my_field1: new App.Field.String
my_field2: new App.Field.Float
my_field3: new App.Field.Timestamp
... etc ...
module.exports = MyEntity
The following list in non-exhaustive and items appear in no specific order. These items will be moved to the issue queue at some point.
- Implement 100% of REST methods
- Reimplement Minify for bundles
- Auth
- Replace Q with faster promises [1]
- Error handling & normalise error responses
- Make us compatible with express and others
- Serve html docs locally
- Modularize & Cleanup code
[1] http://thanpol.as/javascript/promises-a-performance-hits-you-should-be-aware-of/
Once that's done, we'll be tackling separate modules:
- Front-end & Client widgets
- Declare interfaces
- Routers & Templates that can be rendered client-side or on server (SEO)
- More!
Pull requests will be considered here: https://github.com/inspired-io/inspired-server/pulls. If you want to write substantial functionality, please discuss architecture in a ticket first.
The project uses CoffeeScript and tabs only. More coming soon.
Once you've installed CasperJS you can run the test suite from the server module's root folder, like this:
$ ./tests/run [DSN] [REST_PORT] [META_PORT]
- DSN
- The connection details for the DB, eg: "postgres://username:password@hostname/database" Create an empty DB for testing. The tests should always cleanup after themselves.
- REST_PORT
- The port to run the REST server on during the tests
- META_PORT
- The port to run the META server on during the tests
Here's an example:
$ ./tests/run 'postgres://root@localhost/inspired_server_tests' 18765 19876
Make sure you preview your changes. We recommend using markable.in.
Use the issue queue on Github here: https://github.com/inspired-io/inspired-server/issues