Skip to content

Commit

Permalink
Merge pull request #312 from AdrieanKhisbe/improved-doc
Browse files Browse the repository at this point in the history
Improved doc
  • Loading branch information
geek committed Jan 15, 2016
2 parents 1358b2d + 83c395d commit d059894
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
3 changes: 2 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License

Copyright (c) 2010 Richard Rodger
Copyright (c) 2015-2016 Richard Rodger and Seneca.js contributors
Copyright (c) 2010-2014 Richard Rodger

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 5 additions & 2 deletions LTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Long Term Support

1. Every LTS release is actively maintained and any critical bugs fixed. The LTS period is yet to be determined, but will be at least 12 months from the initial LTS release.
1. Every LTS release is __actively maintained__ and any __critical bugs fixed__.
The LTS period is yet to be determined, but will be _at least 12 months_ from the initial LTS release.

2. There are no restrictions on adding new features or enhancements to LTS releases.
3. Even after a release is no longer in LTS, the seneca maintainers will do their due diligence and fix any critical security vulnerabilities if they arrise.
3. Even after a release is no longer in LTS, the seneca maintainers will do their _due
diligence_ and _fix any critical security vulnerabilities_ if they arise.
48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
[![Coverage Status][coveralls-badge]][coveralls-url]
[![Gitter][gitter-badge]][gitter-url]

Seneca is a toolkit for organizing the business logic of your app. You can break down your app into "stuff that happens", rather than focusing on data models or managing dependencies.
## About Seneca
_Seneca_ is a toolkit for organizing the business logic of your app. You can break down your app into "stuff that happens", rather than focusing on data models or managing dependencies.

Seneca provides a toolkit for writing micro-services in Node.js. Seneca provides:
_Seneca_ provides a toolkit for writing micro-services in Node.js.

_Seneca_ provides:

- __pattern matching:__ a wonderfully flexible way to handle business requirements

Expand All @@ -19,9 +22,15 @@ Seneca provides a toolkit for writing micro-services in Node.js. Seneca provides

- __plus:__ a deep and wide ecosystem of [plugins][]

Use this module to define commands that work by taking in some JSON, and, optionally, returning some JSON. The command to run is selected by pattern-matching on the the input JSON. There are built-in and optional sets of commands that help you build Minimum Viable Products: data storage, user management, distributed logic, caching, logging, etc. And you can define your own product by breaking it into a set of commands - "stuff that happens".
Use this module to define commands that work by taking in some JSON, and, optionally, returning some JSON.
The command to run is selected by pattern-matching on the the input JSON.
There are built-in and optional sets of commands that help you build Minimum Viable Products:
data storage, user management, distributed logic, caching, logging, etc.
And you can define your own product by breaking it into a set of commands - "stuff that happens".

That's pretty much it. ;)

That's pretty much it.
## About Seneca Support

- __Node:__ 0.10, 0.12, 4, 5

Expand Down Expand Up @@ -60,10 +69,10 @@ npm run test

So that it doesn't matter,

* who provides the functionality,
* where it lives (on the network),
* what it depends on,
* it's easy to define blocks of functionality (plugins!).
* __who__ _provides_ the functionality,
* __where__ it _lives_ (on the network),
* __what__ it _depends_ on,
* it's __easy__ to _define blocks of functionality_ (plugins!).

So long as _some_ command can handle a given JSON document, you're good.

Expand All @@ -84,12 +93,12 @@ seneca.act({ cmd: 'salestax', net: 100 }, function (err, result) {
```

In this code, whenever seneca sees the pattern
<code>{cmd:'salestax'}</code>, it executes the function associated
`{cmd:'salestax'}`, it executes the function associated
with this pattern, which calculates sales tax. Yah!

The _seneca.add_ method adds a new pattern, and the function to execute whenever that pattern occurs.
The `seneca.add` method adds a new pattern, and the function to execute whenever that pattern occurs.

The _seneca.act_ method accepts an object, and runs the command, if any, that matches.
The `seneca.act` method accepts an object, and runs the command, if any, that matches.

Where does the sales tax rate come from? Let's try it again:

Expand All @@ -115,7 +124,7 @@ seneca.act({ cmd: 'salestax', net: 100 }, function (err, result) {
})
```

The _config_ command provides you with your configuration. This is
The `config` command provides you with your configuration. This is
cool because it doesn't matter _where_ it gets the configuration from
- hard-coded, file system, database, network service, whatever. Did
you have to define an abstraction API to make this work? Nope.
Expand All @@ -139,7 +148,7 @@ seneca.act('cmd:salestax', { net: 100 }, function (err, result) {
})
```

This is a very convenient way of combining a pattern and parameter data.
This is a _very convenient way of combining a pattern and parameter data_.

### Programmer Anarchy

Expand All @@ -162,7 +171,7 @@ seneca.add({ cmd: 'config' }, function (args, callback) {
seneca.listen()
```

The _listen_ method starts a web server that listens for JSON
The `listen`` method starts a web server that listens for JSON
messages. When these arrive, they are submitted to the local Seneca
instance, and executed as actions in the normal way. The result is
then returned to the client as the response to the HTTP
Expand All @@ -189,9 +198,9 @@ seneca.act('cmd:salestax,net:100', function (err, result) {
})
```

On the client-side, calling _seneca.client()_ means that Seneca will
On the client-side, calling `seneca.client()` means that Seneca will
send any actions it cannot match locally out over the network. In this
case, the configuration server will match the _cmd:config_ pattern and
case, the configuration server will match the `cmd:config` pattern and
return the configuratin data.

Again, notice that your sales tax code _does not change_. It does not
Expand All @@ -200,12 +209,10 @@ how.

You can do this with every command.


### Keeping the Business Happy

The thing about business requirements is that they have no respect for
common sense, logic or orderly structure. The real world is
messy.
common sense, logic or orderly structure. The real world is messy.

In our example, let's say some countries have single sales tax rate,
and others have a variable rate, which depends either on locality, or product category.
Expand Down Expand Up @@ -274,8 +281,9 @@ For more examples of Seneca in action, take a look at:
* [nodezoo.com](//nodezoo.com/#q=seneca)
* [Well!](//github.com/nearform/well)


## Contributing
The [Senecajs org][] encourages open participation. If you feel you can help in any way, be it with
The [Senecajs org][] __encourages open participation__. If you feel you can help in any way, be it with
bug reporting, documentation, examples, extra testing, or new features feel free to [create an issue][github issue],
or better yet, [submit a pull request][github pull request].

Expand Down
18 changes: 14 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"author": "Richard Rodger (http://richardrodger.com/)",
"contributors": [
"Richard Rodger (http://richardrodger.com)",
"Wyatt Preul",
"Dean McDonnell",
"Wyatt Preul (https://github.com/geek)",
"Dean McDonnell (https://github.com/mcdonnelldean)",
"Peter Elger",
"Cristian Ianto",
"Dominic Tarr",
Expand All @@ -34,9 +34,19 @@
"Maciej Małecki (http://mmalecki.com)",
"Jake Pruitt",
"Marian Radulescu",
"Alexandru Mircea",
"Alexandru Mircea (https://github.com/mirceaalexandru)",
"Adrian Rossouw (http://daemon.co.za)",
"Aleksandar Ostojić"
"Aleksandar Ostojić",
"Maxence Dalmais (https://github.com/maxired)",
"Marius Ursache (https://github.com/bamse16)",
"Martin Betak (https://github.com/matobet)",
"Marian Radulescu (https://github.com/marianr)",
"Glen Keane (https://github.com/thekemkid)",
"Tane Piper (https://github.com/tanepiper)",
"Cristian Kiss (https://github.com/ckiss)",
"Paolo Chiodi (https://github.com/paolochiodi)",
"Matteo Collina (https://github.com/mcollina)",
"Adrien Becchis (https://github.com/AdrieanKhisbe)"
],
"dependencies": {
"archy": "1.0.0",
Expand Down

0 comments on commit d059894

Please sign in to comment.