After some fight to decide on the right design, we finally have
a module to handle users details.
The API is JSON-based and it's documented on the top of the
dudeswave_handler.erl file.
The dudeswave_auth module, implements the functions that handle
things at the storage layer, as we would like to reuse those
capabilties in the future.
To add, the "delete" call doesn't handle removing the cookies for
the moment, It'll come with the next commit.
Additionally, after that, a related test suite will be added, in
order to start to test the whole thing locally.
Now, we return a proper answer when creating a user through a
POST request.
Maybe in the future we will convert the APIs to use JSON, like
all cool kids do. However, it doesn't look like it makes much
sense in this case.
The bootstrap will create the various tables, the admin user,
and the initial content of the platform, with the possibility
to add replication for everything.
Those were there when this application didn't use fragmented
tables.
Now, all the buckets are fragmented by default and we provide
the grow/1 and shrink/1 functions to expand the tables along
with the fragment properties.
For now it handles PUTs, to create new users. It's still a
partial implementation and there is no documentation yet.
POST, PATCH and DELETE will arrive later to handle other users
operations.
We want to automate this, for example, when deploying in a docker
container.
A bunch of static files will be loaded into the storage, in order
to be served to the clients.
At this point it handles only GETs, giving back plain text
responses in case of errors.
The intention is to also produce some static pages for those,
where the CSS we will chose applies.
Other APIs will be managed through their respective handlers,
whose routes will be setup before this one.
This is a small abstraction layer on top of mnesia. It simplifies
table management and addition of replicas and nodes.
Some things to add in the near future:
* Removing nodes from a mnesia cluster is not supported.
* Observability and event handling is missing.
While it's possible to perform the aformentioned functions with
the mnesia own APIs, adding some simplifications for day to day
management may be a good idea.
However, the library is already used in another project and it's
good enough for an initial use. It will be extended if and when
required.