Readme env file setup #23

Merged
quoije merged 5 commits from cursor/readme-env-file-setup-eda9 into 2026 2025-12-21 14:33:37 -05:00
+27 -9
View File
@@ -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` &nbsp;&nbsp;&nbsp;&nbsp;(for "verification")<br> Minimal steps:
**GITHUB_OWNER=**`quoije` &nbsp;&nbsp;&nbsp;&nbsp;(for version history)<br>
**GITHUB_REPO=**`oscars-pool` &nbsp;&nbsp;&nbsp;&nbsp;(for version history)<br> ```bash
**JWT_SECRET=**`RANDOM STRING` &nbsp;&nbsp;&nbsp;&nbsp;(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` &nbsp;&nbsp;&nbsp;&nbsp;(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**