Skip to content

Commit 85b2bec

Browse files
committed
monorepo
1 parent 8725ba4 commit 85b2bec

125 files changed

Lines changed: 29056 additions & 23784 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
/build
2-
/node_modules
3-
package.json
4-
package-lock.json
5-
README.md
1+
**/build
2+
**/dist
3+
**/node_modules
4+
**/package.json
5+
**/package-lock.json
6+
**/README.md
7+
packages/server

.eslintrc

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,19 @@
55
"es6": true
66
},
77
"parserOptions": {
8-
"ecmaVersion": 2018,
8+
"ecmaVersion": "latest",
99
"sourceType": "module"
1010
},
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:react/recommended"
14+
],
1115
"overrides": [
1216
{
13-
"files": ["client/**/*.js"],
14-
"parser": "@babel/eslint-parser",
15-
"parserOptions": {
16-
"requireConfigFile": false,
17-
"ecmaFeatures": {
18-
"jsx": true
19-
},
20-
"babelOptions": {
21-
"presets": ["@babel/preset-react"]
22-
}
23-
},
24-
"extends": ["eslint:recommended", "plugin:react/recommended"],
17+
"files": ["packages/client/**/*.js"],
2518
"rules": {
26-
"react/prop-types": 0
19+
"react/prop-types": 0
2720
}
2821
}
2922
]
30-
}
23+
}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# general
44
.env
5-
**/prisma/data/*.db
6-
**/prisma/data/*.db-journal
5+
**/*.db
6+
**/*.db-journal
77

88
# dependencies
99
node_modules/

.prettierignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/build
2-
/node_modules
3-
package.json
4-
package-lock.json
1+
**/build
2+
**/node_modules
3+
**/package.json
4+
**/package-lock.json

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"importOrder": ["^components/(.*)$", "^[./]"],
88
"importOrderSeparation": true,
99
"importOrderSortSpecifiers": true
10-
}
10+
}

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,19 @@
5151

5252
## ⚙️ Setup
5353

54-
Run `npm install`
54+
Run `npm run install`, then `npm run install-packages`
5555

5656
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
5757

58-
###### **`.env`**
58+
######
5959

6060
```env
61+
# packages/client/.env
6162
REACT_APP_HOMEHOST_BASE = "http://localhost:5000"
6263
REACT_APP_IMAGE_BASE = "https://image.tmdb.org/t/p/"
63-
REACT_APP_TMDB_BASE = "https://www.imdb.com/title/"
64+
REACT_APP_IMDB_BASE = "https://www.imdb.com"
6465
66+
# packages/server/.env
6567
TMDB_KEY = '<api_key>'
6668
SPOTIFY_CLIENT_ID = '<client_id>'
6769
SPOTIFY_CLIENT_SECRET = '<client_secret>'
@@ -76,9 +78,12 @@ CLIENT_BASE_URL = 'http://localhost:3000'
7678

7779
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
7880

79-
### Naming conventions
81+
### Media
8082

8183
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)
84+
85+
#### Naming conventions
86+
8287
🎥 **Movies**
8388

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

114119
### Database
115-
116-
Run `npm run db:squash` to create the database and necessary migrations
117-
Run `npm run start` to start the application in dev mode
120+
121+
Run `npm run init-db` to create migrations from schema, apply them, generate the database client
118122
_homehost_ scans the media paths and adds the files to the database
119123
Wait for the async job to finish generating metadata and save
120-
To browse data, run `npm run db:browse` and go to `http://localhost:5555`
121-
To reset the database and clear all data, run `npm run db:reset`
124+
To browse data, run `npm run browse-db` and go to `http://localhost:5555`
125+
To clear all data, run `npm run clear-db`
122126

123127
### Run
124128

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

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

174177
## Development
175178

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

178181
## Powered by
179182

180-
<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>
183+
<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>
181184

182185
## License
183186

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

198201
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.
199202

200-
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).
203+
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).

0 commit comments

Comments
 (0)