-
Notifications
You must be signed in to change notification settings - Fork 16
Customization Guide
Actually, Lantern was created for secondary development, developer can do customization work for own web service which is based on this project.
See Configurations for details.
You can modify the database schema to fit for purpose what you want. All of the schema files are stored in the ./models directory which contains member, permissions and role by default.
Models are defined by using Mongoose style object, it looks like below:
var mongoose require('mongoose');
var Schema = mongoose.Schema;
var Foo = new mongoose.Schema({
name: String,
count: Number,
disabled: { type: Boolean, default: false },
updated: { type: Date, default: Date.now }
});
module.exports = mongoose.model('Foo', Foo);You must make it divided into two groups of routes, Restful APIs and Pages.
We usually put all of restful APIs in the ./routes folder.
For isomorphic application, React is doing the page rendering work on client-side and server-side with own route settings. The routes relates to page is set in ./src/js/routes.js
./lib stores all common functions you might use during development.
All of pages need to be rendered on server and client both are put in the ./src directory. It includes less, Images, JavaScript and Translations.
The folder structure:
- js (React Components and FLUX things)
- images
- less (CSS)
- translations
Front-end things are mainly React components and FLUX in the ./src/js directory, so you can see the folder structure like below:
- components
- actions
- stores
- extensions
Lantern is using Fluky as FLUX framework. No matter what you like or not, Fluky is suitable with isomorphic application. The event-based design is making us be able to record behaviors and state which is triggered by React components.
With singleton, we can attach rich functions and methods to Fluky instance, I18n and API requests can be implemented easily.