Skip to content

Commit dad5c03

Browse files
committed
refactor: documentation, readme
1 parent f234429 commit dad5c03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1040
-701
lines changed

README.md

+66-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,76 @@ workflow (a logical succession of algorithms) can be created and edited. This
1717
workflow will then be saved and installed on the DIVA platform and be run from
1818
there.
1919

20-
## Installation
20+
## Getting Started
2121

22-
Once the repository is cloned, run `yarn` to install the dependencies.
22+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
2323

24-
To run the platform on development mode, run the command `yarn dev`. It will start the webpack server, build the source files and run the platform in out default browser.
24+
### Prerequisites
2525

26-
To build the final files, run `yarn build` or `yarn dist` for a compressed version. The resulting files will be saved in the `public` folder.
26+
You will need to install **yarn** to run the interface.
2727

28+
### Installing
29+
30+
Once yarn is installed, you can install the interface with:
31+
```
32+
yarn init
33+
```
34+
35+
If necessary, update `service.xml` so that it contains correct services description.
36+
37+
Once all the dependencies are installed, run the following command to run the interface locally:
38+
39+
```
40+
yarn dev
41+
```
42+
/!\ Don't forget to precise GET parameters `id` ! On production mode, `id` must match an existing workflow.
43+
44+
You should open the running server with url :
45+
```
46+
http://localhost:3000?id=6
47+
```
48+
49+
### Maintainance
50+
51+
Since git hooks are installed, you will need to have a clean code which match prettier and eslint requirements.
52+
To prettify your code, run
53+
```
54+
yarn prettier:write
55+
```
56+
And to check the validity of your code against eslint, run
57+
```
58+
yarn eslint
59+
```
60+
61+
If no error is detected, you will be able to commit your changes.
62+
63+
## Running the tests
64+
65+
Run
66+
67+
```
68+
yarn test
69+
```
70+
71+
## Deployment
72+
73+
This command allows you to create a distribution version of the interface. It is the one you can install directly in the `resource` of the Oppidum website.
74+
75+
```
76+
yarn dist
77+
```
78+
79+
The resulting files will be saved in the `public` folder.
80+
81+
## Built With
82+
83+
* [Vue.js](https://vuejs.org/v2) - The web framework used
84+
* [Webpack](https://webpack.js.org/) - Bundler
85+
* [Yarn](https://yarnpkg.com/lang/en/) - Dependency Management
86+
87+
## Authors
88+
89+
* **Kim Lan Phan Hoang** - *Initial work* - klphanh@gmail.com
2890

2991
## Implemented features
3092
### Interface

src/js/api/requests.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
/**
2+
* This file contains all requests to fetch or send
3+
* data to DIVA Services
4+
*/
5+
16
import { Decorators, API } from "divaservices-utils";
27
import { WEBSERVICES_XML_FILEPATH } from "../../config";
38
import { webservices } from "../constants/globals";
9+
import { PRODUCTION_MODE } from "../constants/constants";
410

511
export const getServices = async () => {
6-
if (process.env.NODE_ENV === "production") {
12+
if (process.env.NODE_ENV === PRODUCTION_MODE) {
713
return await API.getServices();
814
} else {
915
const filepath = WEBSERVICES_XML_FILEPATH;
@@ -13,7 +19,7 @@ export const getServices = async () => {
1319
};
1420

1521
export const getWorkflowById = async (id, asXml = false) => {
16-
if (process.env.NODE_ENV === "production") {
22+
if (process.env.NODE_ENV === PRODUCTION_MODE) {
1723
if (asXml) {
1824
return await API.getWorkflowByIdJSON(id);
1925
} else {
@@ -38,6 +44,9 @@ export const getWorkflowById = async (id, asXml = false) => {
3844
<Name>inputImage</Name>
3945
<Path>qwertz/2299942_0.jpg</Path>
4046
</Data>
47+
<Parameter>
48+
<Name>skewsteps</Name>
49+
<Value>543</Value></Parameter>
4150
</Inputs>
4251
</Step>
4352
<Step>
@@ -65,7 +74,7 @@ export const getWorkflowById = async (id, asXml = false) => {
6574
};
6675

6776
export const getCollections = async () => {
68-
if (process.env.NODE_ENV === "production") {
77+
if (process.env.NODE_ENV === PRODUCTION_MODE) {
6978
return await API.getCollections();
7079
} else {
7180
// const filepath = "collections.xml";

0 commit comments

Comments
 (0)