~skiqqy/apiCosmic

794e8e7099d8be6d2c9fdc4d750d71fe89fe3dc4 — Stephen Cochrane 11 months ago c0dfae4 master
Updated README
1 files changed, 22 insertions(+), 0 deletions(-)

M README.md
M README.md => README.md +22 -0
@@ 4,6 4,28 @@

> Backend for cosmic

## Modules

The core concept around the cosmic API is the module. At a high level, a Module
is a class that an abstract java project/program may implement, then this
project may be added to cosmics classpath, then at runtime cosmic will detect
And serve the module.

A module is essentually a rest API entry point to some abstract java
application. To create a module, the application must do two things.

Annotate the module with the [`@Module`](https://git.sr.ht/~skiqqy/libCosmic/tree/master/item/src/main/java/xyz/skiqqy/cosmic/lib/module/Module.java) annotation. This allows cosmic to detect
and load the module. The other is the module must extend and implement a
[`ModuleConf`](https://git.sr.ht/~skiqqy/libCosmic/tree/master/item/src/main/java/xyz/skiqqy/cosmic/lib/module/ModuleConf.java) class. This conf is then pass to the single constructor used
to instantiate the Module.

The config should then be given to cosmic so that it may instantaite the module
at start up.

I have left out alot of detail to try condense this, it is best to read the
source code directly to see how this happens (I will soon have a demo out
showing this in action).

## Installing

```