Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #139

Open
wants to merge 118 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
d2497cf
feat(wip): first version of unpaywall history
felixleo22 Sep 21, 2023
7812f67
feat: history update
felixleo22 Sep 28, 2023
7f7ef05
wip: rollback work date by date
felixleo22 Oct 4, 2023
9505539
wip: history update
felixleo22 Oct 9, 2023
cada702
feat: rollback work and test done
felixleo22 Oct 13, 2023
e093918
Merge branch 'development' into feat/update-history
felixleo22 Oct 18, 2023
5f71caa
fix: move history functionnality
felixleo22 Nov 3, 2023
2dea231
Merge branch 'development' into feat/update-history
felixleo22 Dec 8, 2023
cbad5e6
refactor: update architecture
felixleo22 Jan 4, 2024
e4c36bf
refactor: make independent unpaywallHistory and history
felixleo22 Jan 5, 2024
19e992a
refactor: update middleware and update getReport function for history…
felixleo22 Jan 5, 2024
d32217e
fix: remove console.log
felixleo22 Jan 5, 2024
1514163
refactor: use same router for both type of data
felixleo22 Jan 9, 2024
f80358f
doc: update openAPI
felixleo22 Jan 9, 2024
9f89451
feat: add parameter to cron controller
felixleo22 Jan 9, 2024
fdf59b5
feat: update history cron config
felixleo22 Jan 11, 2024
55a9a87
fix: replace .json by .yml for openapi.yml
felixleo22 Jan 11, 2024
d1a0fc9
feat: update frontend to add new type of job
felixleo22 Jan 11, 2024
a24e36c
feat(frontend): update interface with history report with cron dialog…
felixleo22 Jan 15, 2024
2c1eb70
feat(frontend): add elastic tab on administration
felixleo22 Jan 15, 2024
827cf2d
fix: healthcheck nginx
felixleo22 Jan 17, 2024
2c75b62
feat: add default value to password to be keepass friendly
felixleo22 Jan 17, 2024
4519220
fix(enrich): cancel job if timeout on job
felixleo22 Jan 17, 2024
c7ca78f
feat(update): don't insert old data than base index in history index
felixleo22 Jan 17, 2024
1b8e171
feat(frontend): add copy button for graphql result
felixleo22 Jan 17, 2024
9a8961f
feat(graphql): remove footer for apollo page
felixleo22 Jan 17, 2024
39fc0e1
feat(dev): log in stdout access for each service
felixleo22 Jan 17, 2024
e28ba6e
div: upgrade RAM for elastic
felixleo22 Jan 23, 2024
026fd74
build: decrease timeout on healthcheck
felixleo22 Jan 23, 2024
49dc169
feat: use shared folder for snapshot
felixleo22 Jan 23, 2024
8cb7982
fix: syntax institution
felixleo22 Jan 23, 2024
4f25f74
feat: use ID with date and DOI for history unpaywall
felixleo22 Jan 23, 2024
af8fe66
feat: add clean option to history job
felixleo22 Jan 23, 2024
a364487
fix: add 's' for timeout
felixleo22 Jan 23, 2024
beb5cc1
fix: update path for file cron
felixleo22 Jan 24, 2024
863e99c
fix(frontend): update format of line in information about elastic
felixleo22 Jan 24, 2024
83483af
fix: forget to save
felixleo22 Jan 24, 2024
bf1dce0
fix(frontend): info about update in progress
felixleo22 Jan 29, 2024
0b920ee
feat(update): add timezone to config
felixleo22 Jan 29, 2024
c81a6df
fix: update app log
felixleo22 Jan 29, 2024
74b1c38
feat: upgrade history update
felixleo22 Feb 2, 2024
580ed24
feat: update unpaywall graphql resolver with date
felixleo22 Feb 6, 2024
539c07e
fix: update lte and gt
felixleo22 Feb 6, 2024
fb02aba
fix: reupdate gte and lte on unpaywall history
felixleo22 Feb 7, 2024
2a65c76
fix: metrics
felixleo22 Feb 13, 2024
f6d234f
fix: update unpaywallHistory resolver to work with ezpaarse middleware
felixleo22 Feb 13, 2024
82e10f0
doc: update readme.md
felixleo22 Feb 20, 2024
5723bf3
feat: add timezone to config
felixleo22 Feb 20, 2024
2bd22d6
test: move test to racine of test directory
felixleo22 Feb 20, 2024
40cfe55
doc: add test
felixleo22 Feb 20, 2024
8c1a550
fix: selector attributes for apikey config
felixleo22 Feb 23, 2024
54775cb
fix: update ping of health
felixleo22 Feb 23, 2024
8e75965
feat: add favicon
felixleo22 Feb 23, 2024
38141ce
fix: countDOI
felixleo22 Feb 26, 2024
9f67d89
test: add test for countDOI
felixleo22 Feb 27, 2024
5e845db
chore: update version of node and redis
felixleo22 Feb 27, 2024
bd44ebe
chore: update package-lock.json
felixleo22 Feb 27, 2024
cb16cd6
fix: update vuetify
felixleo22 Feb 28, 2024
6196da7
build: hot reloading
felixleo22 Feb 28, 2024
d84a366
chore: update package-lock.json
felixleo22 Feb 28, 2024
e6e1691
perf: replace swagger-ui by swagger-ui-dist
felixleo22 Feb 28, 2024
d9f13b0
build: update package-lock.json
felixleo22 Feb 28, 2024
2d6f073
fix(frontend): v-data-table for elastic tab
felixleo22 Mar 4, 2024
7d8f3de
fix: regex for countDOI
felixleo22 Mar 6, 2024
7f5084d
Merge branch 'development' into feat/update-history
felixleo22 Mar 7, 2024
3f9ed2f
test: add multine count DOI
felixleo22 Mar 7, 2024
c08ccce
feat: remove useless chips
felixleo22 Mar 7, 2024
deba96b
feat(frontend): update icon if status cannot be getted
felixleo22 Mar 7, 2024
deb0f0e
feat: add express-rate-limit for login
felixleo22 Mar 7, 2024
70d810b
feat: update data architecture
felixleo22 Mar 8, 2024
fcbdcbe
fix: remove console.log
felixleo22 Mar 8, 2024
26091f0
fix: get report
felixleo22 Mar 8, 2024
8277224
test: use same function for state and report
felixleo22 Mar 8, 2024
f8c9081
feat: update report data table
felixleo22 Mar 8, 2024
a7cbcf7
fix: update regex for countDOI
felixleo22 Mar 8, 2024
fd5b7a9
fix: path for cron file
felixleo22 Mar 11, 2024
7d1f8ba
feat: add ignoreError param on insert
felixleo22 Mar 11, 2024
cf0b521
doc: update openAPI doc
felixleo22 Mar 11, 2024
4bf7063
feat: add ignoreError and cleanFile on insert file job
felixleo22 Mar 11, 2024
b753162
doc: add args on dockerfile
felixleo22 Mar 11, 2024
9e46f2b
fix: move return to if condition
felixleo22 Mar 12, 2024
4746ac6
style
felixleo22 Mar 13, 2024
36ad68e
lint
felixleo22 Mar 15, 2024
8282f7b
dev: update fakeunpaywall for test
felixleo22 Mar 18, 2024
0191439
fix: mail nochangefile
felixleo22 Mar 18, 2024
d42393c
fix(frontend): contact
felixleo22 Mar 18, 2024
873cdea
fix: remove console.log
felixleo22 Mar 18, 2024
45fa38e
lint: update name of resolver
felixleo22 Mar 18, 2024
b3e7f61
test: add test with content of elastic index
felixleo22 Mar 18, 2024
60aa967
lint: rename index by indices
felixleo22 Mar 18, 2024
c778f4e
feat: update elastic card
felixleo22 Mar 18, 2024
f5b04e1
doc: add activity diagram of enrich process
felixleo22 Mar 20, 2024
1e9958c
doc: add open api link on doc
felixleo22 Mar 20, 2024
7cc165d
fix: remove middleware auth to get list of files installed on ezunpay…
felixleo22 Mar 25, 2024
0bb7a72
docs: update schema
felixleo22 Mar 29, 2024
e4929a8
doc: update jsdoc
felixleo22 Mar 29, 2024
ff944f0
test: update history test
felixleo22 Mar 29, 2024
b8446ef
fix: use apollo graphql for count DOI, thx to @wilmouths
felixleo22 Mar 29, 2024
faeebc1
doc: remove command test
felixleo22 Mar 29, 2024
d62102d
fix: order of history result
felixleo22 Apr 4, 2024
2801fe3
refactor: move paths of log and data on config and use it than path.r…
felixleo22 Apr 10, 2024
f19d73a
feat: add toLocalString on report for index
felixleo22 Apr 15, 2024
e360132
feat: add searchbar for apikey
felixleo22 Apr 15, 2024
8767d55
build: update healthcheck
felixleo22 Apr 15, 2024
035a543
build: add healthcheck for nginx
felixleo22 Apr 15, 2024
9e6eea0
build: use wget for healthcheck for nginx
felixleo22 Apr 15, 2024
a8a8ea0
fix(frontend): update globalmetric for i18n
felixleo22 May 16, 2024
245b4fa
fix: start unpaywall update
felixleo22 May 21, 2024
94bcc5b
fix: if data is send with date, dont request the current index
felixleo22 May 28, 2024
107dabe
docs: fix curl
felixleo22 Jun 24, 2024
adc86ec
Merge pull request #137 from ezpaarse-project/feat/update-history
felixleo22 Jun 24, 2024
070802d
refactor: separate healthcheck, separate changefile and snapshot, upd…
felixleo22 Jun 25, 2024
dfe3393
refactor: update name of directory
felixleo22 Jul 2, 2024
7c19625
refactor: arrange files
felixleo22 Jul 2, 2024
74397e7
feat: remove competely health service
felixleo22 Jul 3, 2024
04e7005
doc: update network-flow
felixleo22 Jul 3, 2024
bcfea6c
refactor: remove config.get
felixleo22 Jul 9, 2024
807d15f
fix: update .gitignore and .dockerfile and push forgotten files
felixleo22 Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ezunpaywall.local.env.sh
ezunpaywall.env.local.sh
config/kibana/certificates/
config/elastic/certificates/
certs/instances.yml
Expand Down
147 changes: 47 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# ezunpaywall

Ezunpaywall is an API and database that queries the Unpaywall database containing free scholarly articles.
ezunpaywall is a Unpaywall mirror hosted in France by Inist-CNRS of data from Unpaywall since 2020 and updated daily. Unpaywall is a metadata repository of free and open access electronic resources.
This app is available at https://unpaywall.inist.fr/.

**Table of content**
- [Structure](#Structure)
- [Description](#Description)
- [Network-flow](#Network-flow)
- [Installation](#Installation)
- [Development](#Development)
- [Prerequisites](#Prerequisites)
- [Start](#Start)
- [Tests](#Tests)
- [Deployment](#Deployment)
- [Prerequisites](#Prerequisites)
- [Environment variables](#Environment-variables)
- [apikey](/src/apikey/README.md#ezunpaywall-apikey)
- [enrich](/src/enrich/README.md#ezunpaywall-enrich)
- [frontend](/src/frontend/README.md#ezunpaywall-frontend)
- [graphql](/src/graphql/README.md#ezunpaywall-graphql)
- [health](/src/health/README.md#ezunpaywall-health)
- [mail](/src/mail/README.md#ezunpaywall-mail)
- [update](/src/update/README.md#ezunpaywall-update)
- [Data update](#Data-update)
- [API Graphql](#API-graphql)

## Structure
## Description

Unpaywall is made up of several services which are distributed in several docker containers.
![Structure](/doc/structure.png)
ezunpaywall operates as a service. It is updated daily with its own update service. Data is stored in an elastic index. To access this data, ezunpaywall offers 2 types of access:
- A graphql API for querying unpaywall data via one or more DOIs
- A file enrichment service that allows you to enrich a csv or jsonl file containing a column or a doi key.

for `apikey`, `enrich`, `graphql`, `health`, `mail` and `update` service, a **open api** is available on frontend
These services are accessible via API keys, which can be managed by the API key service. The keys are stored in a redis database and can be accessed by the graphql service and enrich.
A web interface is also available as a demonstrator. It allows you to :
- Show data metrics
- Examples of how to use the graphql API and enrichment service
- openAPI documentation
- A contact form
- A server administration section
- A history of data update reports.
- A healthcare service makes sure that all its services work and communicate well together.

On the front, a nginx acts as a reverse proxy, redirecting all these services to a single entry point.

Each service :
* [graphql](./services/graphql#ezunpaywall-graphql)
* [enrich](./services/enrich#ezunpaywall-enrich)
* [update](./services/update#ezunpaywall-update)
* [apikey](./services/apikey#ezunpaywall-apikey)
* [frontend](./services/frontend#ezunpaywall-frontend)
* [health](./services/health#ezunpaywall-health)
* [nginx](./services/nginx#ezunpaywall-nginx)
* [mail](./services/mail#ezunpaywall-mail)
* [fakeUnpaywall](./services/fakeUnpaywall#ezunpaywall-fakeUnpaywall) (only for dev)

## Network-flow

ezunpaywall is made up of several services which are distributed in several docker containers.
![Network-flow](./doc/network-flow.png)

## Installation

Expand Down Expand Up @@ -69,40 +90,30 @@ To run tests, you need ezunpaywall to be launched in dev mode with fakeUnpaywall

```bash
# there are alias on root folder
$ ~/ezunpaywall npm run test
$ ~/ezunpaywall npm run test:apikey
$ ~/ezunpaywall npm run test:enrich
$ ~/ezunpaywall npm run test:graphql
$ ~/ezunpaywall npm run test:update
npm run test
npm run test:apikey
npm run test:enrich
npm run test:graphql
npm run test:update

# you can run test for each service
$ ~/ezunpaywall/src/apikey npm run test
$ ~/ezunpaywall/src/enrich npm run test
$ ~/ezunpaywall/src/graphql npm run test
$ ~/ezunpaywall/src/update npm run test
ezunpaywall/src/apikey npm run test
ezunpaywall/src/enrich npm run test
ezunpaywall/src/graphql npm run test
ezunpaywall/src/update npm run test
```
### Deployment

#### Prerequisites

The tools you need to let ezunpaywall run are :
* docker
* unpaywall data measured about 130Gb it is necessary to provide the necessary place on the hard drive
* docker compose
* Unpaywall data in elastic with single node in index with 3 shards measured about 130Gb, it is necessary to provide the necessary place on the hard drive (storage for index + unpaywall file if you want to keep them).

#### Environment variables

Create an environment file named `ezunpaywall.local.env.sh` and export the following environment variables. You can then source `ezunpaywall.env.sh`, which contains a set of predefined variables and is overriden by `ezunpaywall.local.env.sh`.
Create an environment file named `ezunpaywall.local.env.sh` and export the following environment variables. You can then source `ezunpaywall.env.sh`, which contains a set of predefined variables and is overridden by `ezunpaywall.local.env.sh`.

Details :
* [apikey](/src/apikey#ezunpaywall-apikey)
* [enrich](/src/enrich#ezunpaywall-enrich)
* [fakeUnpaywall](/src/fakeUnpaywall#ezunpaywall-fakeUnpaywall)
* [frontend](/src/frontend#ezunpaywall-frontend)
* [graphql](/src/graphql#ezunpaywall-graphql)
* [health](/src/health#ezunpaywall-health)
* [mail](/src/mail#ezunpaywall-mail)
* [nginx](/src/nginx#ezunpaywall-nginx)
* [update](/src/update#ezunpaywall-update)

### Adjust system configuration for Elasticsearch

Expand Down Expand Up @@ -136,67 +147,3 @@ docker-compose ps

You can update your data via update snapshots provided by unpaywall on a weekly or daily basis (if you have API key).
in the update service, there is a cron that allows to automatically update the data from unpaywall, weekly or daily.

## API Graphql
### unpaywall

get unpaywall data with [parameters](#Object-structure).
### Examples
#### GET

```js
headers: {
"x-api-key": "<YOUR_API_KEY>"
}
```

`GET "<HOST>/api/graphql?query={unpaywall(dois:["10.1038/2211089b0","10.1038/nature12373"]){doi, is_oa, best_oa_location{ url }}}"`

#### POST

`POST "<HOST>/api/graphql"`

```js
headers: {
"x-api-key": "<YOUR_API_KEY>"
},
body: {
"query": "{unpaywall(dois:[\"10.1038/2211089b0\",\"10.1038/nature12373\"]){doi, is_oa, best_oa_location{ url }}}"
}
```

`POST "<HOST>/api/graphql"`

```js
headers: {
"x-api-key": "<YOUR_API_KEY>"
},
body: {
"query": "query ($dois: [ID!]!){ unpaywall(dois: $dois){is_oa} }",
"variables": {
"dois": ["10.1038/2211089b0","10.1038/nature12373"],
}
}
```

Response
Status: 200

```json
{
"data": {
"unpaywall": [
{
"doi": "10.1038/2211089b0",
"is_oa": true,
"best_oa_location": {
"url": "http://www.nature.com/articles/2211089b0.pdf"
}
}
]
}
}
```
### Object structure

[data-format](https://unpaywall.org/data-format)
Binary file added doc/network-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/structure.png
Binary file not shown.
Loading