saurshaz / riot-play

Riot and Server side dynamism
2 stars 0 forks source link

#################################################

RIOT-PLAY

#################################################

js-standard-style

js-standard-style


About the project


Client Side ES6 has been the standard (app folder) Server side ES6 usage has been kept to minimal (actually i was also thinking whether i shall be doing this in ES5 only) for purposes of this to be useful to someone (in my team) or otherwise :-)

-- Do a npm install npm i

-- start mongo server (if not already running). mongod -- in 1st terminal tab run ./riotserve (to serve frontend content with a auto reload watch) from one directory above the repo directory -- in 2nd terminal tab runnpm run server` from the repo directory (to start backend node server)

to start in stage

Completed Apps

TODO apps

Jump to http://localhost:6600/home#home for demo home page Demo

Jump to http://localhost:6600/view/hello/testapp/fyler/dev.html?p=pane1&cid=appbrowser&a=b&c=d for testapp page Demo

what it has ?



How a component logic looks ?


    import StoreWatcher from '../event-manager/mixins/storex'

    <comp1>
        <div>
            <p> Hello World </p>
            .... ... 
        </div>
    </comp1>

     let self = this

     // for validations
     //  - add a validationform
     //  - add a validate function in the handlers['<tag-name>'] section to set result
     //                into state.<store>.<validationform>.validated property
     self.stores = ['user'] // stores to watch
     self.validationform = ['loginform'] // validation form . this will have validated field

     // for store watching
     // import StoreWatcher from ../../event-manager/mixins/storex
     // self.mixin(StoreWatcher)
     self.mixin(StoreWatcher)

More


project structure can be like (with these special directories and files) (for anything that is non-editable .. use comments for now. in future, we may use a better strategy) (a linter may be built, based on regex to see if saved copy is good or not. best not to let wrong edit happen)

- server
    - core (visible but non-editable to end-users)
        - fn1 
        - fn2
        ....
    - thirdparty (visible and partially editable to end-users)
        - fn1
        - fn2
        ....
- client
    - functions
        - core (visible but non-editable to end-users)
            - fn1
            - fn2
            ....
        - thirdparty (visible and mostly/partially editable to end-users. restrict things that can disturb)
            - fn1
            - fn2
            ....
    - components  (visible and totally editable to end-users)
        - a.html
        - b.html
        - .....
    - router (visible and partially editable to end-users. based on user's entries app will route)
        - index.js
    - config (visible and editable to end-users. based on user's entries app will initialize)
        - main.js
    - index.html (main file) (visible and partially editable to end-users. based on user's entries app will start)
    - state-manager (visible and partially editable to end-users. based on user's entries app will link to events and data)
        - app-store
        - event_mapping
        - event_constants
Anything else
- ...
- ...