These are chat archives for dry-rb/chat

19th
Jan 2017
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 13:35
We really want a docs for dry-web and dry-web-roda, I've been fighting for almost 4 days to just get it run the way I want :cry:
Yet I didn't managed to deal with persistenceand get the repos under it to start playing with them in console. :(
Oskar Szrajer
@gotar
Jan 19 2017 13:36
is you have any questions fell free to ask
I already wrote few apps in dry-web-roda
should be able to help
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 13:41
waa, thanks :tada:
yes yes, I read the app code: https://github.com/icelab/berg
but didn't get the idea of why the persistencearound relations and repositories. how the flow goes here.
I have a very lightweight app, yet I don't know how the flow goes, as I see lots of require and require_relative in lots of files.
my questions will be very generic as you could see, I am not facing a specific issue, it's just the flow of the whole framework. and what file lead to another and why we do this in the first place.
sorry again for this generic question.
Oskar Szrajer
@gotar
Jan 19 2017 13:47
maybe start from something easier like: https://github.com/gotar/dry-web-skeleton
much easier to understand
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 13:49
thanks a million, that's what I was looking for.
thanks.
Oskar Szrajer
@gotar
Jan 19 2017 13:50
It can be a little out of date I wrote it like half year ago or more
but should be much easier to follow and understand
after that you can go deeper with berg
in berg it's worth to undersnad first web/routes - there are special roda plugin used for view and resolve
view is easy just generate proper page using corresponding lib/{main}/view/... file
those file is a simple class thats tell what html file generate and and values should be visible there
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 13:55
I faced actually few issues of why we have views in /lib
then we have /apps that have it's own /boot /lib etc..
these are a little vague
Oskar Szrajer
@gotar
Jan 19 2017 13:56
resolve is more complicated, it uses operations (lib/{sub_app_dir like main}/operations/....) amd there you have monads (left right) to describe operations like validation, db operations etc) somethimes it connected with extra later transaction (when you have more then one operations, like store in db and then sand verification email)
everything in root directory is shared across other application, setup and prepare core of the app
but it's like engine, heart of system, not real applications
real applications you keep inside apps
in many cases there will be only one app - main
for if you have for example more apps, like admin panel, json api, ...
you will have more, and every of it will have their own specific files
like main app only need read ability from db, do not need any authentication ...
plus every of app has his own container
if you will have any specific questions just catch me (leave direct message) and I will try to provide answer
but starting with berg without knowing components and dry-web is a suicide mission
Oskar Szrajer
@gotar
Jan 19 2017 14:01
try with my small example and the add new layers of complexity when you need it
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 14:16
thanks a million, I am reading your repo, and if I faced something will catch up in a direct message, thank you very much.
Piotr Solnica
@solnic
Jan 19 2017 14:17
@ahmgeek dry web is still very very beta so it makes little sense to invest time into docs but we'll get there later this year
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 14:21
I see, thanks for the hard work folks :thumbsup:
Piotr Solnica
@solnic
Jan 19 2017 15:25
@ahmgeek but didn’t get the idea of why the persistencearound relations and repositories. how the flow goes here <= what flow?
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 17:53
@solnic I didn't read the docs wisely I guess for ROM I wandered about why we wrap repos and relations under Persistent module, why just don't use the relations and repos directly.
it takes a little time I guess getting from rails-way into a new gig.
the flow for me was, why relations, why repo, and why commands.
Piotr Solnica
@solnic
Jan 19 2017 18:08
@ahmgeek gotcha, so relations encapsulate data access, which is db-specific, repos encapsulate domain data access, commands are low level, use them only when you need some advanced functionality that repo API doesn’t provide (that’s in a nutshell)
@ahmgeek also, these are all objects, there’s no class-level APIs in rom
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 18:09
oh, so I can actually insert data into the db using repos ?
Piotr Solnica
@solnic
Jan 19 2017 18:09
(well except some config-related stuff, but it’s very limited)
@ahmgeek yes, and we’re gonna have extended changeset api in rom-repo 1.0.0
you can already install beta versions of rom, rom-sql, rom-repository
I actually recommend doing that if you’re just experimenting and learning :)
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 18:11
:grinning: actually I am creating a read-olny service from our DBs in the work using the stack, I thought it will be good to know them in a read-only app, as it only delivers some reports.
but I'll try the beta
Piotr Solnica
@solnic
Jan 19 2017 18:12
@ahmgeek sure thing, you can have read-only repos, because they ARE read-only by default, full CRUD API is enabled only when you tell a repo to enable it
Ghost
@ghost~545771cbdb8155e6700d0a6f
Jan 19 2017 18:13
great, thanks for the help <3