# What are the advantages of backend code in frontend development?
The interfaces agreed at the frontend and backend need to be adjusted in the actual development process. At this time, the code written at the back end may face the dilemma of being rewritten many times, wasting a lot of time in vain! In the process of development, the frontend processes data according to actual needs, eliminating communication with the backend, and the natural efficiency is much higher!
# How does Aca.ts realize the development of backend code in the frontend?
App development, most of the time dealing with databases, aca.ts can bridge the API of database query to the frontend, so that the way the frontend accesses the database is the same as the way the backend accesses the database, and there is no difference for developers. The backend function (we call it remote function) will also be automatically generated into the interface with the same name as the frontend, so that the frontend code can also use the function with the same name as the backend, so that the frontend code can be moved to the backend straightly after it is relatively stable to form a new remote function.
# Why only provide typescript API?
TS has a good code prompt function, which can greatly reduce the debugging time.
# How does the frontend access the backend? Need to define routes?
The backend database query API and remote functions will generate functions with the same name (namespace support) as the frontend. The body of this function is the fetch method. When the relevant parameters are passed to the backend, a function called APIBridge will process the passed parameters as functions with the same name as the frontend, and return after calling. There is no need to define routes.
# How do remote functions get context?
The first parameter of the function is the context, which will be omitted when generating the frontend function with the same name.
# How does the node.js package refer to the web frontend?
It is suggested that the node.js to be referenced JS package is uniformly encapsulated in a remote function, so that the front end can be used through the interface provided by this function.
# How do ORM documents represent multiple databases?
Each top-level namespace represents a database. If you need multiple databases, you need multiple top-level namespaces.
# Why are there few databases supported at present?
Aca.ts bottom layer calls knex.js deals with databases and uses the returning method extensively, so only databases with this method are supported.
# Can Aca.ts only run on the frontend?
Aca.ts must start a backend service. The frontend interface is actually a function of the same name that accesses the backend. So you can't just run on the frontend.
# Can Aca.ts be used only on the backend?
Yes, this is a standard database ORM.
# The frontend can access the database. Is the data safe?
It is no different from traditional development. The frontend access to the database is bridged to the backend, which can intercept the data and do the corresponding security verification.