The effect
The source address
Github.com/hu-ke/nw-to…
Technology stack
vue2 + node-webkit + koa2 + mongodb
Data is stored
Data stores are determined by user login status. If the user has logged in, data is stored on a remote server. If the user does not log in, the data is stored in localStorage.
The project structure
| - nw - todo app | | - client / / client | | - assets / / all kinds of static resources | | - CSS / / style resources | | - images / / picture resources | | - js / / js resources | | - Data. The js / / define the data storage structure of the | | -- fetch. Js / / API request file | | - index. The js / / business logic file | | -- taskManager. Some methods of js / / operation mission | | - Vue. Min. Js/library/dependent vue | | -- TodoManager. App / / application file (which can be directly open) | | - app - screenshot. PNG / / rendering | | - index. The HTML page / / | | - Package. The json / / configuration file | | - README. Md / / client documentation | | - server / / server | | - controllers / / controller | | - index. The js | | - Tasks. Js / / task management | | -- users. Js / / user management | | - global / / global configuration | | - middlewares / / middleware | | - models | | -- tasks. Js / / Task model | | -- users. Js / / user model | | -test| | - API. Test. Js / / interface test file | | - utils | | - index. The js/method/tools | | -. Babelrc / / ES6 grammar compiler configuration | | -. Eslintrc/code/specification | | - Package. The json / / project and tool depends on the configuration file | | -- server. Js / / service start entry | | - README. Md / / server documentation | | - README. Md / / documentationCopy the code
The client
run
You can open the todomanager.app file and run it just like you would open a regular Mac app.
The development of
TodoManager.app/Contents/MacOS/node-webkit .
Copy the code
The service side
The deployment of
The server is already deployed on my own server and I don’t need you to deploy it. Of course, if you want to deploy the server on your own server, you need to:
1. Install mongodb 2. Change the client/js/fetch. 3. Start the Node service.
Install dependencies
npm install
Copy the code
Start the
npm start
Copy the code
test
npm test
Copy the code
function
- [x] Register login
- [x] Local/server data storage
- [x] Real-time editing
- [x] Renames the task
- [x] Adds/removes a task
- [x] Changes the task status
show
Log in
The editor
added
The function of this project is relatively simple. Since I haven’t written node services or Node-WebKit desktop applications before, this project is a sneak peek at both. If there are deficiencies in the project, we hope to correct them. What good proposal also can carry ha ~