partial.js logo
Latest version
v1.3.1 (RC2)

Project directory

Website / Web application project has simply directory structure. Many directories are optional.

Directory structure
partial.js web project - directory structure

Directory: contents

optional Directory contains content files. Content file is a plain HTML file with .html extension and you can render it in views. Content file doesn't contain special markup, is render as a raw HTML and it serves for banners or static content.

Documentation: view @{content()}

Directory: controllers

required Directory contains all controller files. Controller defines the different actions that your users can interact with. In each controller you can define routes, flags, functions, models, etc..

How do controllers work?
Documentation: FrameworkController

Directory: databases

optional This directory is optional and contains all NoSQL embedded databases. If you don't use NoSQL embedded databases, remove this directory. NoSQL embedded database is implemented in partial.js core.

Documentation: FrameworkNoSQL

Directory: definitions

optional This directory is optional and contains all framework definitions. Defition can affect framework functions or your custom classes. When is framework ready all definition files are loaded.

How do definitions work?

Directory: logs

optional This directory is optional and contains all log files. Log file is a plain text file and the file name contains date about its creation yyyy-MM-dd.log. You can create a log file with: framework.log('my description') or
controller.log('my description').

Documentation: framework.log()
Documentation: controller.log()

Directory: modules

optional Modules directory contains all application modules. The module can contain classes, functions or constants. Each controller can call module or module can create own route.

How do modules work?
Documentation: framework.module()
Documentation: controller.module()

Directory: public

optional This directory is published into the internet and directory contains all static files (JavaScripts, CSS files, Pictures, Fonts, Documents, Videos, Uploads, etc.).

Directory: resources

optional If you create web pages that will be read by speakers of different languages, you must provide a way for readers to view the page in their own language. This way is resources. A resource file is a plain text file that contains the strings. Resource file has same syntax as a config file.

How do resources work?
Documentation: framework.resource()
Documentation: controller.resource()
Documentation: view @{resource()}

Directory: templates

optional This directory contains templates. Template is a HTML file with special marks. Templates are suitable for repeating data (such as list of products, comments, etc.).

How do templates work?
Documentation: controller.template()
Documentation: view @{template()}

Directory: tests

optional Test directory contains scripts for assertion testing. In assertion test you can test every controller and its routes in your web application. Tests are independent on your web application in release mode.

Directory: tmp

optional Tmp is a temporary directory. Framework stores compiled files, internal cache and form uploads in this directory. This directory is often cleaning.

Directory: views

optional Views are used for rendering a response to a request. View is HTML file with special framework marks. In views is defined layout of web pages.

How do views work?
Documentation: Views
Documentation: view @{view()}

Directory: workers

optional Workers are used for other helper work.

Documentation: framework.worker()