# datareade

- 1200 - Oh baby, how does The Reade do it!

https://github.com/joonhocho/tscpaths - for the server application, maybe. I'm not sure.

This repository is a monorepo using lerna, and it works fantastically well for my purposes.

It contains a server component, a data component, as well as a media generator component.

@dottjt/server - Server to distribute and perform tasks
@dottjt/datareade - (data and some basic content generators)
@dottjt/mediareade (generate video, audio)

A bunch o' data.
// TODO - Actually describe what it is I do. try build again

## Setup Deployment

- npm i
- npx lerna bootstrap (installs all the package dependencies)

Due to the limitations of the system, you will need to run `npm run link` on watch. I'll configure that at some point :P

### Package

The package is super simple to deploy. Literally all you have to do is run:

- `npm run deploy:package`

...and that is literally it. As long as it compiles, it will work

### Server

The server requires a lot more work, but that's just the nature of it.

### Step 0. Remove need to use password to access server
https://www.hongkiat.com/blog/ssh-to-server-without-password/

- `cat id_rsa.pub | ssh root@198.199.67.180 'cat - >> ~/.ssh/authorized_keys'.`

#### Step 1. Setup Let's Encrypt.

Go into the server and setup all the SSL certificates for the server.
<!-- https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx -->

- `ssh root@198.199.67.180`
- `cd /docker/letsencrypt-docker-nginx/src/letsencrypt/`
- `mv docker-compose.yml && mv nginx.conf`
- `sudo docker-compose up -d`

sudo docker run -it --rm \
-v /docker-volumes/etc/letsencrypt:/etc/letsencrypt \
-v /docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt \
-v /docker/letsencrypt-docker-nginx/src/letsencrypt/datareade.juliusreade.com:/data/letsencrypt \
-v "/docker-volumes/var/log/letsencrypt:/var/log/letsencrypt" \
certbot/certbot \
certonly --webroot \
--email julius.reade@gmail.com --agree-tos --no-eff-email \
--webroot-path=/data/letsencrypt \
-d datareade.juliusreade.com

sudo docker run -it --rm \
-v /docker-volumes/etc/letsencrypt:/etc/letsencrypt \
-v /docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt \
-v /docker/letsencrypt-docker-nginx/src/letsencrypt/letsencrypt-site:/data/letsencrypt \
-v "/docker-volumes/var/log/letsencrypt:/var/log/letsencrypt" \
certbot/certbot \
certonly --webroot \
--email youremail@domain.com --agree-tos --no-eff-email \
--webroot-path=/data/letsencrypt \
-d ohhaithere.com -d www.ohhaithere.com

### Step 2. Setup Relevant Folders in the Server

- `mkdir /docker/letsencrypt-docker-nginx/src/`
- `

/etc/nginx/sites-available

### Step 4. Clone Repo




TODO I just realised, I will probably need a separate types package so I can export those.

"@dottjt/datareade": "latest"

npm publish --access public

https://www.npmjs.com/package/app-root-path


// Image Manipulation
https://github.com/oliver-moran/jimp

//

### NOTES

- All applications within the DigitalOcean instance sit here. `cd /docker/letsencrypt-docker-nginx/src/`

# Reddit API details
refresh and access tokens create (the ones in the ENV is )
https://not-an-aardvark.github.io/reddit-oauth-helper/

# libpng jpeg librsvg pixman-dev
    # build-base \
    # g++ \
# cairo pango giflib


curated_curated_social_feed_items // would have a reference to an item, either as a podcast, or as a social feed. I wouldn't have to get this via axios, it should already be in this system.

aggregated_curated_social_feed_items // would be via an API.




yo yo yo kek wek hekarsta arst arst a rs  asrt

There are Changes to this i.ra

webpackag is not being used.

- @dottjt/server (Github Repo)
- @dottjt/datareade (data, upload and generators)
- @dottjt/media (generate video, audio)

Here is a change

A bunch o' data.
// TODO - Actually describe what it is I do. try build again

There you go.

## Setup Deployment

### Package

The package is super simple to deploy. Literally all you have to do is run:

- `npm run deploy:package`

...and that is literally it. As long as it compiles, it will work

### Server

The server requires a lot more work, but that's just the nature of it.

### Step 0. Remove need to use password to access server
https://www.hongkiat.com/blog/ssh-to-server-without-password/

- `cat id_rsa.pub | ssh root@198.199.67.180 'cat - >> ~/.ssh/authorized_keys'.`

#### Step 1. Setup Let's Encrypt.

Go into the server and setup all the SSL certificates for the server.
<!-- https://www.humankode.com/ssl/how-to-set-up-free-ssl-certificates-from-lets-encrypt-using-docker-and-nginx -->

- `ssh root@198.199.67.180`
- `cd /docker/letsencrypt-docker-nginx/src/letsencrypt/`
- `mv docker-compose.yml && mv nginx.conf`
- `sudo docker-compose up -d`

sudo docker run -it --rm \
-v /docker-volumes/etc/letsencrypt:/etc/letsencrypt \
-v /docker-volumes/var/lib/letsencrypt:/var/lib/letsencrypt \
-v /docker/letsencrypt-docker-nginx/src/letsencrypt/datareade.juliusreade.com:/data/letsencrypt \
-v "/docker-volumes/var/log/letsencrypt:/var/log/letsencrypt" \
certbot/certbot \
certonly --webroot \
--email julius.reade@gmail.com --agree-tos --no-eff-email \
--webroot-path=/data/letsencrypt \
-d datareade.juliusreade.com

### Step 2. Setup Relevant Folders in the Server

- `mkdir /docker/letsencrypt-docker-nginx/src/`
- `

/etc/nginx/sites-available

### Step 4. Clone Repo




TODO I just realised, I will probably need a separate types package so I can export those.

"@dottjt/datareade": "latest"

npm publish --access public

https://www.npmjs.com/package/app-root-path


// Image Manipulation
https://github.com/oliver-moran/jimp

// woah. 

### NOTES

- All applications within the DigitalOcean instance sit here. `cd /docker/letsencrypt-docker-nginx/src/`

# Reddit API details
refresh and access tokens create (the ones in the ENV is )
https://not-an-aardvark.github.io/reddit-oauth-helper/

# libpng jpeg librsvg pixman-dev
    # build-base \
    # g++ \
# cairo pango giflib


curated_curated_social_feed_items // would have a reference to an item, either as a podcast, or as a social feed. I wouldn't have to get this via axios, it should already be in this system.

aggregated_curated_social_feed_items // would be via an API.
