From 5f75051af382c17a8aea37f23c9c1b0212e9e418 Mon Sep 17 00:00:00 2001 From: Kata Date: Sun, 10 Mar 2019 03:52:19 -0500 Subject: [PATCH] update readme, clarified app structure and corrected commands --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f3ddbe0..79fb56a 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,23 @@ yarn dev ``` tooling notes: -- we use flow-type for UI code, but not on server. this may change, but i doubt it. +- we use flow-type, and in development, it is ideally transparent. - `./ui` has hot-reloading via next.js -- `./api` has hot-reloading built in. +- `./api` and `./rpc` have hot-reloading built in. - if this isn't ideal for you, set `NO_HOT_RELOADING=1` this backend framework is one i've been building on for a long time and has a shitload of magic and auto-importing involved. for the most part, unless you make a new Service class, you do not need to define it's import anywhere. -`Roleypoly.js` is the main app, `index.js` in any backend folder is scaffolding up for the app or package. +there is websocket stuff, but i don't use it anywhere. if you have a good use, go for it... but scalability was not in mind. it may be at some point. + +**A tour** +- `Roleypoly.js` is the main app +- `index.js` is the setup code, does some things that the app doesn't ever need to care about. +- `api` folder includes most routing. Most of these may be phased out into the new RPC system, but it does not solve everything, so this will exist into eternity. +- `rpc` folder includes magically imported RPC routes. generally, if it exists here, it's callable from client code as-is, sans the first argument. function return is 1:1 what it'll spit out on client. +- `services` folder is various services, such as Discord, Sessions, and other data-fetcher/sorter classes. Most of these are on AppContext. +- `models` folder is magically imported sequelize model files. +- `ui` is the Next.js app. This is operationally unable to parse anything outside of it's root, so shared libs must be non-transpiled, non-flowtyped JS code, luckily this is rarely ever needed. ### for production @@ -43,6 +52,7 @@ If you want an unedited latest version of roleypoly, it is available on the Dock If you're not into Docker and/or want to deploy your own, simply run ``` +yarn build yarn start ``` and you're off to the production races (sort of, you'll want to set up a `.env` file.)