π A fullstack modern javascript framework πΌπ
The framework is based on MVC for project structure and RPC for communication between the server and the client.
For a new project, just clone this repository :
git clone https://github.com/TiksiJS/tiksi.git
Now you should have these directories in your project folder :
- controllers
- lib
- src
- views
- etc ...
To run our server, run the command run
in the cli.js :
node cli.js run
Now, you should see in your console the message :
Server listening to port 8000, http://localhost:8000/
Because when the router receive "/", in the file routes.json
, it is defined that he must display the HomeController.index :
{
"home": {
"path": "/",
"controller": "HomeController.index",
"view": "HomeView"
}
}
Where is the HomeController.index ?
Just here, in controllers/HomeController.js
:
exports.HomeController = {
index() {
return {
name: 'tiksi'
};
}
};
Here, we say that when the server call the function index()
, he get the data
name: 'tiksi'
Wait, where is the Hello in front of tiksi ?!
The hello is a member of the view : he is just here for diplay, so it's defined in the views/HomeView :
Hello {{ name }} ! Welcome to the HomeView view.
The views are defined in twig. In twig, to display a variable, you must do {{ variable name }}
Voila ! You have now a server running on tiksi based on mvc structure !
Go to Wiki tab andd read about the backend (RPC system ) or about the proxy and enjoy !