-
-
Notifications
You must be signed in to change notification settings - Fork 29
[DEPRECATED] Dev Documentation (English)
To install the project on your machine, it's simple: Clone this repository locally:
git clone https://github.com/kaido/deskofus.git
Install dependencies with npm:
npm install
Commands | Description |
---|---|
npm start |
Execute the application in your command line tool (NB: in some CLI inquirer is KO) |
node lib/app.js |
Same as npm start but work on every CLI |
npm run pkg-win |
Package the app into windows executable (no more need nodejs to be launched) |
npm run pkg-linux |
Package the app into linux executable (no more need nodejs to be launched) |
npm run pkg-mac |
Package the app into macos executable (no more need nodejs to be launched) |
npm run pkg-all |
Package the app for Windows, Linux and MacOS in one time |
To understand the project and subsequently to contribute to it, you need to understand first its tree structure.
Crawlit
└───README.md
└───assets (only few images for styling the repo)
└───package.json
└───LICENSE
|
└───lib
│ └───app.js
| └───getItems.js
| |
│ └───cli-view
│ │ │ cmd.js
│ │ │ cmdSwitch.js
│ │ │ ...
│ └───item-crawler
│ │ getEquipments.js
│ │ getMounts.js
│ │ ...
└───node_modules
At the root of the project under lib/
you will find the app.js
file which contains our main
code (launch the app, load properties and global configuration of the application). In this same folder you will find the getItems.js
file which manage the items scraping logic.
The cli-view
folder will contain the renderer
code of our application and all the interactions with the app. Inside we can find :
-
cmd.js
file : manage interactions between the user and the program. -
cmdSwitch.js
file : manage all categories links (Dofus & Dofus-Touch).
This folder contains one file per categories and each file parse a category of the encyclopedia (request + storage).
To develop a module, there are few rules to respect :
- Add the category's links to the file
cmdSwitch.js
incmd-view/
(don't forget to add french & english version if need it). - Add the category's name into the switch in the function
getData()
of the filegetItems.js
. - Update the
cmd.js
file and add your category to the selection choice also create your questions if need it (look at the other categories as example). - Create a new file under
item-crawler/
. - Define the file name as
getCategory.js
. - Define the DOM scraping logic (look at the other files as example).
Enjoy guys ! Don't hesitate to ask questions or to use the discord ! 😃