update readme, clarified app structure and corrected commands

This commit is contained in:
41666 2019-03-10 03:52:19 -05:00
parent 85b3df5a92
commit 5f75051af3

View file

@ -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.)