zh Kooboo Logo Documents

Develop

 

If the user is developing a regular website, it is recommended to use the built-in content management system.
 
If the user is developing a backend application that requires user authentication, the following login and database usage recommendations apply
 
User Login
 
By using system permission control, you can configure the site as a login-required site in the system settings. 
 
 
Organization: Only users belonging to the same organization as the site creator can access the site.
Site user: Only members who have joined the site's user group can access the site. 
Login user: Only individuals who have logged in with a Kooboo account can access the site.
 
After user login, you can retrieve user information through the following API:
 
 
k.account.user.current
k.account.organization.current
k.account.organization.current.departments
 
If you want to manually control user login, you can also use APIs for that purpose.
 
k.account.login(username: string, password: string): Kooboo.Data.Models.User
k.account.isLogin
k.account.ensureLogin("redirecturl");
 
Database
 
Use SQLite or IndexedDB for easy sharing and installation. Avoid databases like MS SQL or MySQL that require separate installation by users.
 
API example
 
k.DB.sqlite.newtable.add(obj)
k.DB.indexedDb.newtable.add(obj);