Important notes:
- Please read this confluence page which explains the architecture of how RDocumentation works.
- 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.
rdocumentation.org provides the R community with centralized, quality and easy to search documentation.
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.
You can check docs for the API by running the app locally and going to http://localhost:3000/docs/
- Newly parsed packages are added to the
rdocs-app-worker
SQS queue every hour. - That queue is configured to hit the
/task
path which calls theprocessMessage
method of the WorkerController - That
processMessage
method adds topics to the mysql database - 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.
You'll need docker and docker-compose to run this stack locally
- Copy the .env.sample to .env and change relevant variables
- 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"
)
- If you already have a mysql db running on port 3306, update the
- Make sure you are using version 2 of docker-compose, then run
docker-compose create
to create the redis and mysql container docker-compose start
to fire up a local redis an mysql- Use the same node version in your terminal as the Dockerfile is using:
nvm use 8.16
npm install
- Run the database migrations by doing
npm run migrate
npm run start-dev
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
. You will also need to go in the "Driver properties" tab of the connection window, and set allowPublicKeyRetrieval
to true. When you are done, click on Finish. The server host should just be localhost
.
If you get an error: SequelizeConnectionError: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
follow these steps:
- 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 ps
and grabing the container id for mysqldocker exec -it <mysql_container_id> bash
mysql -u root -p
- Enter:
password
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'password';
flush privileges;
- Commits to master are deployed to staging
- Tags that use
vx.y.z
are deployed to production
This application runs on the DataCamp infrastructure. Our custom CI flow will:
- Build a docker image
- Upload it the ECR
- Deploy the new version to ECS
See the LICENSE file for license rights and limitations (MIT).