Skip to content

Commit

Permalink
monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
ridhwaans committed Oct 22, 2022
1 parent 8725ba4 commit 85b2bec
Show file tree
Hide file tree
Showing 125 changed files with 29,056 additions and 23,784 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
12 changes: 7 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/build
/node_modules
package.json
package-lock.json
README.md
**/build
**/dist
**/node_modules
**/package.json
**/package-lock.json
**/README.md
packages/server
23 changes: 8 additions & 15 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,19 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018,
"ecmaVersion": "latest",
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"overrides": [
{
"files": ["client/**/*.js"],
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false,
"ecmaFeatures": {
"jsx": true
},
"babelOptions": {
"presets": ["@babel/preset-react"]
}
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"files": ["packages/client/**/*.js"],
"rules": {
"react/prop-types": 0
"react/prop-types": 0
}
}
]
}
}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# general
.env
**/prisma/data/*.db
**/prisma/data/*.db-journal
**/*.db
**/*.db-journal

# dependencies
node_modules/
Expand Down
8 changes: 4 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/build
/node_modules
package.json
package-lock.json
**/build
**/node_modules
**/package.json
**/package-lock.json
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"importOrder": ["^components/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
}
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@

## ⚙️ Setup

Run `npm install`
Run `npm run install`, then `npm run install-packages`

In `.env`, set a working API key for TMDb API and Spotify Web API, set the media paths, and set tha base url of the homehost client

###### **`.env`**
######

```env
# packages/client/.env
REACT_APP_HOMEHOST_BASE = "http://localhost:5000"
REACT_APP_IMAGE_BASE = "https://image.tmdb.org/t/p/"
REACT_APP_TMDB_BASE = "https://www.imdb.com/title/"
REACT_APP_IMDB_BASE = "https://www.imdb.com"
# packages/server/.env
TMDB_KEY = '<api_key>'
SPOTIFY_CLIENT_ID = '<client_id>'
SPOTIFY_CLIENT_SECRET = '<client_secret>'
Expand All @@ -76,9 +78,12 @@ CLIENT_BASE_URL = 'http://localhost:3000'

If you dont have keys, you can request API authorization from Spotify at https://developer.spotify.com/documentation/web-api/, and TMDb at https://developers.themoviedb.org/3/getting-started/introduction

### Naming conventions
### Media

Your media must appear in the locations set by `.env`. Each media must be in a unique location and cannot share the same directory path(s)

#### Naming conventions

🎥 **Movies**

```
Expand Down Expand Up @@ -112,20 +117,18 @@ Tracks not found on Spotify can be put in a directory titled `Unknown Album` san
```

### Database

Run `npm run db:squash` to create the database and necessary migrations
Run `npm run start` to start the application in dev mode

Run `npm run init-db` to create migrations from schema, apply them, generate the database client
_homehost_ scans the media paths and adds the files to the database
Wait for the async job to finish generating metadata and save
To browse data, run `npm run db:browse` and go to `http://localhost:5555`
To reset the database and clear all data, run `npm run db:reset`
To browse data, run `npm run browse-db` and go to `http://localhost:5555`
To clear all data, run `npm run clear-db`

### Run

Run `npm run start` to start the application in dev mode
Run `npm run start` to start the application
By default, the server port is `5000`, client port is `3000`
Run `npm run start:prod` to start the application as prod
By default, client and server will run on `5000`
Run `npm run start:prod` to start the application as prod (default port is `5000`)
While running, _homehost_ continuously saves and retrieves information for any media that was added, moved or removed

### Routes
Expand Down Expand Up @@ -173,11 +176,11 @@ While running, _homehost_ continuously saves and retrieves information for any m

## Development

Works best in <img src="client/src/assets/logos/Chrome.svg" width="16" height="16" title="Google Chrome"> Chrome. Coming to Desktop, iOS, Android.
Works best in <img src="packages/client/assets/logos/Chrome.svg" width="16" height="16" title="Google Chrome"> Chrome. Coming to Desktop, iOS, Android.

## Powered by

<p><img src="client/src/assets/logos/Spotify_Green.svg" width="200" height="150" title="Spotify Web API">&emsp;<img src="client/src/assets/logos/TMDB_Green.svg" width="150" height="150" title="TMDb API"></p>
<p><img src="packages/client/assets/logos/Spotify_Green.svg" width="200" height="150" title="Spotify Web API">&emsp;<img src="packages/client/assets/logos/TMDB_Green.svg" width="150" height="150" title="TMDb API"></p>

## License

Expand All @@ -197,4 +200,4 @@ If any images posted here are in violation of copyright law, please contact us a

Most of the sourced material is posted according to the “fair use” doctrine of copyright law for non-commercial news reporting, education and discussion purposes. We comply with all takedown requests.

You may not use the Service for any illegal or unauthorized purpose. You must not, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright or trademark laws).
You may not use the Service for any illegal or unauthorized purpose. You must not, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright or trademark laws).
Loading

0 comments on commit 85b2bec

Please sign in to comment.