add video backend server, fix styling and more #54
@@ -18,14 +18,34 @@ Little nodejs + mongodb app that I hack together with ChatGPT and Cursor to keep
|
|||||||
- Version endpoint backed by latest GitHub commit (cached)
|
- Version endpoint backed by latest GitHub commit (cached)
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
Config those in your .env file:
|
Create a `.env` file at the project root (same folder as `package.json`).
|
||||||
|
|
||||||
**DOG_NAMES=**`woof, WOOF, Woof` (for "verification")<br>
|
Minimal steps:
|
||||||
**GITHUB_OWNER=**`quoije` (for version history)<br>
|
|
||||||
**GITHUB_REPO=**`oscars-pool` (for version history)<br>
|
```bash
|
||||||
**JWT_SECRET=**`RANDOM STRING` (for authentication token)<br>
|
npm install
|
||||||
**MONGO_URI=**`mongodb+srv://USER:[email protected]/?retryWrites=true&w=majority&appName=Cluster69`<br>
|
node index.js
|
||||||
**OMDB_API=**`1234567` (for movie info)
|
```
|
||||||
|
|
||||||
|
Add this to your `.env` (**required**: `MONGO_URI`, `JWT_SECRET`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# required
|
||||||
|
MONGO_URI=mongodb://127.0.0.1:27017/oscars-pool # MongoDB connection string
|
||||||
|
JWT_SECRET=replace-with-a-random-string # JWT signing secret (auth)
|
||||||
|
|
||||||
|
# optional
|
||||||
|
DOG_NAMES=woof,WOOF,Woof # simple registration "verification"
|
||||||
|
OMDB_API=your_omdb_key # OMDb API key (movie info)
|
||||||
|
GITHUB_OWNER=quoije # version history
|
||||||
|
GITHUB_REPO=oscars-pool # version history
|
||||||
|
```
|
||||||
|
|
||||||
|
Generate a good `JWT_SECRET`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
openssl rand -hex 32
|
||||||
|
```
|
||||||
|
|
||||||
## Database (MongoDB)
|
## Database (MongoDB)
|
||||||
This app uses **MongoDB** via Mongoose. Provide a connection string in `MONGO_URI`.
|
This app uses **MongoDB** via Mongoose. Provide a connection string in `MONGO_URI`.
|
||||||
@@ -35,5 +55,3 @@ This app uses **MongoDB** via Mongoose. Provide a connection string in `MONGO_UR
|
|||||||
- Atlas: `mongodb+srv://USER:[email protected]/<dbName>?retryWrites=true&w=majority`
|
- Atlas: `mongodb+srv://USER:[email protected]/<dbName>?retryWrites=true&w=majority`
|
||||||
- Local: `mongodb://127.0.0.1:27017/<dbName>`
|
- Local: `mongodb://127.0.0.1:27017/<dbName>`
|
||||||
- Collections are created/managed automatically from the models in `models/` (e.g. `User`, `Movie`, `Setting`, `PlaybackProgress`).
|
- Collections are created/managed automatically from the models in `models/` (e.g. `User`, `Movie`, `Setting`, `PlaybackProgress`).
|
||||||
|
|
||||||
run with **node .\index.js**
|
|
||||||
|
|||||||
Reference in New Issue
Block a user