# Engines friendly framework from scratch

**URL:** <https://www.ruby-forum.com/t/engines-friendly-framework-from-scratch/90070>\
**Category:** Engines Development\
**Created:** [March 25, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/engines-friendly-framework-from-scratch/90070 "2007-03-25T19:31:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [March 25, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/engines-friendly-framework-from-scratch/90070/1 "2007-03-25T19:31:52Z")

</div>

Hi,

I’ve been thinking about web frameworks because I will write a small  
one in JavaScript to share code between client and server. I would  
like to be able layer an application like engines allow in Rails. What  
would an optimal directory structure for this?

So far I have this something like this where a top-level  
config/environment.js would control layer loading order. The plugins  
directory of a layer could be used to distribute sub-layers upon which  
the depends.

- layers/
  - app/
    - config/
    - controllers/
    - db
    - doc
    - lib
    - models/
    - public/
    - plugins/
    - test/
    - views/

  - authentication/
    - config/
    - controllers/
    - db
    - doc
    - lib
    - models/
    - public/
    - plugins/
    - test/
    - views/

- config/
- log/
- tmp/

Any ideas or suggestions?

Thanks,  
Peter
