Skip to content

Commit 1f3a1dc

Browse files
authored
Merge pull request #486 from datacamp/chore/update-readme
Update readme to explain how the API works
2 parents dbff389 + aed0911 commit 1f3a1dc

3 files changed

Lines changed: 69 additions & 45 deletions

File tree

CONTRIBUTING.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

README.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,50 @@
1-
![rdocumentation_site_banner](https://cloud.githubusercontent.com/assets/1741726/17966806/d52c646a-6ac3-11e6-8f61-60379cfd70bb.png)
1+
# RDocumentation API
22

3-
rdocumentation.org provides the R community with centralized, quality and easy to search documentation.
4-
5-
R documentation sifts through all CRAN, GitHub and BioConductor packages hourly, parses the documentation files and indexes them in an Elasticsearch database. This makes rdocumentation.org the best online resource to browse all R package documentation.
6-
7-
The RDocs project is completely open-source. This repository contains the source code for the NodeJS web application that serves [www.rdocumentation.org](https://www.rdocumentation.org). For other codebases, you can check out [`CONTRIBUTING.md`](CONTRIBUTING.md).
8-
9-
## Features
10-
- Quick search through all packages and functions
11-
12-
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
13-
14-
- Complete search through all packages and function
15-
16-
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
17-
18-
- Easily assess package quality
3+
_Important notes:_
194

20-
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
5+
1. Please read this [confluence page](https://datacamp.atlassian.net/wiki/spaces/PRODENG/pages/2314469377/RDocumentation) which explains the architecture of how RDocumentation works.
6+
2. This repo is now only used for its API. Please disregard all the UI code here. THe UI now lives in [datacamp/rdocumentation-2.0](https://github.com/datacamp/rdocumentation-2.0).
217

22-
- Post *community examples* to help the community understand how to use a function
23-
24-
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
25-
26-
27-
## What this app does
8+
rdocumentation.org provides the R community with centralized, quality and easy to search documentation.
289

29-
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
10+
R documentation sifts through all CRAN, GitHub and BioConductor packages hourly, parses the documentation files and indexes them in an Elasticsearch database. This makes rdocumentation.org the best online resource to browse all R package documentation.
3011

31-
## Documentation
12+
## How the API works
3213

33-
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
14+
You can check docs for the API by running the app locally and going to http://localhost:3000/docs/
3415

35-
## Issue/Feature request
36-
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
16+
1. Newly parsed packages are added to the `rdocs-app-worker` SQS queue every hour.
17+
2. That queue is configured to hit the `/task` path which calls the `processMessage` method of the WorkerController
18+
3. That `processMessage` method adds topics to the mysql database
19+
4. After a query is sent to the API to request a topic, that topic is stored in Redis so that it's returned faster next time.
3720

3821
## Development
3922

4023
### Using docker
24+
4125
You'll need docker and docker-compose to run this stack locally
4226

4327
- Copy the .env.sample to .env and change relevant variables
28+
- If you already have a mysql db running on port 3306, update the `DATABASE_PORT` to another value as well as the port mapping in docker-compose.yml (e.g. change it to `"3308:3306"`)
4429
- `docker-compose create` to create the redis and mysql container
4530
- `docker-compose start` to fire up a local redis an mysql
31+
- Use the same node version in your terminal as the Dockerfile is using: `nvm use 8.16`
32+
- `npm install`
4633
- Run the database migrations by doing `npm run migrate`
4734
- `npm run start-dev`
4835

36+
Once the db is running, you can use a mysql client like dbeaver to access it. Connect to it based on the environment variables you have in `docker-compose.yml`. The server host should just be `localhost`.
37+
38+
### Troubleshooting
39+
40+
If you get an error: `SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client`
41+
follow these steps:
42+
43+
1. Access your mysql container: you can do it either through the docker app by clicking on the "cli" button of the container, or in your terminal by running `docker exec -it <mysql_container_id> bash`
44+
2. `mysql -u root -p`
45+
3. Enter: `password`
46+
4. `ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'`
47+
4948
## How to deploy
5049

5150
- To deploy to stating (rdocumentation.datacamp-staging.com), merge to master
@@ -56,18 +55,11 @@ The rdocumentation app is hosted on DataCamp's infrastructure, on our AWS ECS cl
5655
## What the CI does
5756

5857
This application runs on the DataCamp infrastructure. Our custom CI flow will:
58+
5959
- Build a docker image
6060
- Upload it the ECR
6161
- Deploy the new version to ECS
6262

63-
## How to contribute
64-
65-
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
66-
- Report when some packages are missing/outdated/incorrect by creating an issue.
67-
- Report bugs.
68-
- Help us improves by proposing features.
69-
- Directly contribute by forking the repo and making changes.
70-
7163
## License
7264

7365
See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).

views/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
The information on this page comes from the original Readme when this app was used for its UI as well, but since the UI now lives in [datacamp/rdocumentation-2.0](https://github.com/datacamp/rdocumentation-2.0), this Readme is just there to remind you the good old' days of RDocumentation.
2+
3+
## Features
4+
5+
- Quick search through all packages and functions
6+
7+
![screen shot 2016-08-25 at 14 07 05](https://cloud.githubusercontent.com/assets/1741726/17968459/41bee176-6acd-11e6-9431-3aec36ffd8c8.png)
8+
9+
- Complete search through all packages and function
10+
11+
![screen shot 2016-08-25 at 14 08 52](https://cloud.githubusercontent.com/assets/1741726/17968498/7ce9a6aa-6acd-11e6-9276-4d5ced4523b3.png)
12+
13+
- Easily assess package quality
14+
15+
![screen shot 2016-08-25 at 14 11 27](https://cloud.githubusercontent.com/assets/1741726/17968583/df47301a-6acd-11e6-9a28-5167b768fbf1.png)
16+
17+
- Post _community examples_ to help the community understand how to use a function
18+
19+
![screen shot 2016-08-25 at 14 14 37](https://cloud.githubusercontent.com/assets/1741726/17968654/492bb8f2-6ace-11e6-8a64-c620e9e98efa.png)
20+
21+
## What this app does
22+
23+
This application is part the rdocumentation project. This app is responsible for storing the RDocumentation data, and bring it to the users through a web interface (the rdocumentation.org site) or through an api (See https://www.rdocumentation.org/docs/ for the public API)
24+
25+
## Documentation
26+
27+
Documentation of the differents endpoints can be found here: http://www.rdocumentation.org/docs/
28+
29+
## Issue/Feature request
30+
31+
Please post a new issue at https://github.com/datacamp/rdocumentation-app/issues for any bug that you encounter or a feature that you would like to see in rdocumetation.org.
32+
33+
## How to contribute
34+
35+
We welcome any contributions that could improves rdocumentation.org. There is multiple ways of contributing:
36+
37+
- Report when some packages are missing/outdated/incorrect by creating an issue.
38+
- Report bugs.
39+
- Help us improves by proposing features.
40+
- Directly contribute by forking the repo and making changes.

0 commit comments

Comments
 (0)