RedTea Web Framework
(I know black tea is the correct name for the type of tea in English, but I think "Red" being funny more than it. Chinese English Joke :-P)
An easy-use web framework for front-end developer.
RedTea is NOT a MVC web framework, it aims to provide a new way to develop web service without server-side knowledge.
When you start to write a web service based on RedTea, there are four parts you must understand:
- User Interface
You can design web page and implement application UI here in jade language.
Brower-side script. Used to control UI components in client-side.
URL path route.
DO NOT suggest to define complex rules. It's better to use routing to select UI and Runner only.
Server-side APIs, it will be exported and able to be used in browser-side.
Developer can write a browser-side script to use these APIs directly, to exchange data between server and client.
Good Development Flow with RedTea?
We consider the good development flow with RedTea is:
- Design what you want to see
- Implement requirements based on UI
- Process user's data in server-side
Comparison with MVC:
- Design Model in server-side (How can you design a good model when you have no idea about complete requirement?)
- Design View for UI
- Design Controller for communication between Model and View (GET/POST Routing stuffs, Ajax APIs... etc)
- Rework Model again and again for requirements
- Rework View again and again because Model was changed
- Your Controller will be disgusting after you rework Model and View many times
In RedTea, Following steps then you can enjoy writing a web service:
- Make a URL path route to put your page, ex: "/myfirstpage". (Route)
- Design a page layout for user interface (UI)
- Implement Class/Function in server-side if data needs to be processed by server. (API Wrapper)
- Modify your browser-side script to call server-side APIs with class method to push/pull data to/from server (Runner)
- Done! Drink a cup of red tea! :-)