Skip to content

Project organization

Brenton Ashworth edited this page Dec 15, 2011 · 11 revisions

Project organization

There are four top level directories in this project that a designer or developer will need to work with: public, templates, src and test.

public

public
β”œβ”€β”€ 404.html
β”œβ”€β”€ css
β”œβ”€β”€ design.html
β”œβ”€β”€ images
β”œβ”€β”€ index.html
└── javascripts

The public directory contains files that are publicly available. With a running server, 404.html can be reached at http://localhost:8080/404.html.

JavaScripts generated by the ClojureScript compiler will be put into public/javascripts. Images and CSS should be put into public/images and public/css.

A designer may also want to change the links on the design page. This can be done by editing the public/design.html file and following the conventions in that file..

templates

templates
β”œβ”€β”€ application.html
β”œβ”€β”€ form.html
β”œβ”€β”€ greeting.html
└── toolbar.html

The templates directory contains template HTML files which will become part of the running application. See the Design and templating page for more information about how to use these templates.

src

β”œβ”€β”€ app
β”‚Β Β  β”œβ”€β”€ clj
β”‚Β Β  β”‚Β Β  └── one
β”‚Β Β  β”‚Β Β      └── sample
β”‚Β Β  β”‚Β Β          └── ...
β”‚Β Β  β”œβ”€β”€ cljs
β”‚Β Β  β”‚Β Β  └── one
β”‚Β Β  β”‚Β Β      └── sample
β”‚Β Β  β”‚Β Β          └── ...
β”‚Β Β  └── cljs-macros
β”‚Β Β      └── one
β”‚Β Β          └── sample
β”‚Β Β              └── ...
└── lib
    β”œβ”€β”€ clj
    β”‚Β Β  └── one
    β”‚Β Β      └── ...
    └── cljs
        └── one
            β”œβ”€β”€ browser
            β”‚Β Β  └── ...
            └── ...

Source code is split into two directories: app and lib. The app directory is for code that is specific to the application that you are building. Initially, this directory contains code for the sample application. This code should be changed frequently. The lib directory contains library code that is not specific to the current application.

Even though this library code is "general purpose" and not specific to the application you are building. It may still need to be changed and should be easy for you to change. When useful changes are made to these libraries please consider contributing them back to ClojureScript One. Once this library code becomes mature, it will be extracted into an external library.

In both the app and lib directories, code is organized into clj, cljs and cljs-macros directories for Clojure, ClojureScript and ClojureScript macros (which are just Clojure macros).

test

Test code is located in the test directory. ClojureScript One provides support for testing ClojureScript code and Clojure code from your favorite Clojure testing framework.

Clone this wiki locally