Trên GitHub, strongloop/loopback-example-offline-sync đã đạt 286 sao, ngôn ngữ JavaScript. Offline sync, change tracking, and replication.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
⚠️ This LoopBack 3 example project is no longer maintained. Please refer to LoopBack 4 Examples instead. ⚠️
An example running LoopBack in the browser and server, demonstrating the
following features:
offline data access and synchronization
routes shared between the AngularJS app and the HTTP server
Install and Run
You must have node and git installed. It's recommended to have mongod
installed too, so that the data is preserved across application restarts.
Clone the repo.
cd loopback-example-offline-sync
npm install - install the root package dependencies.
npm install grunt-cli -g - skip if you have Grunt CLI already installed.
npm install bower -g - skip if you already have Bower installed.
bower install - install front-end scripts
mongod - make sure mongodb is running if you want to run with
NODE_ENV=production.
grunt serve - build and run the entire project in development mode.
open http://localhost:3000 - point a browser at the running application.
Project layout
The project is composed from multiple components.
common/models/ contains definition of models that are shared by both the server
and the client.
client/lbclient/ provides an isomorphic loopback client with offline synchronization.
The client needs some client-only models for data synchronization. These
models are defined in client/lbclient/models/.
client/ngapp/ is a single-page AngularJS application scaffolded using yo angular, with a few modifications to make it work better in the full-stack
project.
server/ is the main HTTP server that brings together all other components.
Also сontains the REST API server; it exposes the shared models via
REST API.
Build
This project uses Grunt for the build, since that's what
yo angular creates.
There are three major changes from the generic Gruntfile required for this
full-stack example:
grunt serve uses the server/ component instead of grunt connect.
lbclient component provides a custom build script (lbclient/build.js)
which runs browserify to produce a single js file to be used in the
browser. The Gruntfile contains a custom task to run this build.
The definition of Angular routes is kept in a standalone JSON file
that is used by the server/ component too. To make this JSON file
available in the browser, there is a custom task that builds
ngapp/config/bundle.js.
Targets
grunt serve starts the application in development mode, watching for file changes
and automatically reloading the application.
grunt test runs automated tests (only the front-end has tests at the
moment).
grunt build creates the bundle for deploying to production.
grunt serve:dist starts the application serving the production bundle of the
front-end SPA.
grunt jshint checks consistency of the coding style.
Adding more features
Define a new shared model
The instructions assume the name of the new model is 'MyModel'.
Create a file models/my-model.json, put the model definition there.
Use models/todo.json as an example, see
loopback-boot docs for
more details about the file format.
(Optional) Add models/my-model.js and implement your custom model
methods. See models/todo.js for an example.
Add an entry to rest/models.json to configure the new model in the REST
server:
{
"MyModel": {
"dataSource": "db"
}
}
Define a client-only model to represent the remote server model in the
client - create lbclient/models/my-model.json with the following content:
{
"name": "RemoteMyModel",
"base": "MyModel"
}
Add two entries to lbclient/models.json to configure the new models
for the client:
strongloop/loopback-example-offline-sync có bao nhiêu sao?
strongloop/loopback-example-offline-sync có 286 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/strongloop/loopback-example-offline-sync. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
strongloop/loopback-example-offline-sync có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho strongloop/loopback-example-offline-sync. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
strongloop/loopback-example-offline-sync còn đang phát triển không?
Commit gần nhất trên strongloop/loopback-example-offline-sync là 6.7 năm trước (theo timestamp GitHub). Repo có 107 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
strongloop/loopback-example-offline-sync là gì?
strongloop/loopback-example-offline-sync (strongloop/loopback-example-offline-sync) là dự án JavaScript trên GitHub. Theo mô tả gốc: Offline sync, change tracking, and replication.
strongloop/loopback-example-offline-sync viết bằng ngôn ngữ gì?
strongloop/loopback-example-offline-sync chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về loopback-example-offline-sync?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về loopback-example-offline-sync.