Recent NodeJS with npm or pnpm (recommended).
A mongodb instance must be up and running.
It is recommended to also install mongodb compass to set up and explore the database.
git clone https://github.com/PWEB-3-3-2022/back
cd back
pnpm install
VSCode or Webstorm.
It is also recommended to setup your IDE to work with ESLint.
Set MONGODB_CONN
environment variable to your mongodb instance connection string. (
e.g. mongodb://localhost:27017/tcflix-test
)
Use a locally deployed mongodb instance or the one in mongodb atlas. If using the one on mongodb atlas please use the
database tcflix-test
.
Set TOKEN_KEY
to a 64 chars hex string as the key to encrypt auth tokens.
Set B2_KEY_ID
to the backblaze key id and B2_KEY
to the backblaze key.
node app.js
- (Optional) Create an issue
- Create a feature branch (e.g. feat/change)
- Run the linter against your code before pushing (
npm run lint
&npm run lint -- --fix
) - Push your commits to this new branch
- Create a pull request
- Wait for merge
// Create the fts index in mongosh
db.media.createIndex({"title": "text", "description": "text", "genres": "text", "cast": "text"}, {name: "fts", weights: {"title": 10, "description": 4, "genres": 4, "cast": 8}})