The new Next.js (13) MongoDB example is integrated with Typescript. Unfortunately for me, I am not as familiar with the language yet. This repository was created for those using the standard Next.js framework with only JavaScript-related files.
This is based off of the tutorial by Hamed Bahram.
- This application using the vanilla MongoDB library. No Mongoose features and the like.
- This uses the sample data provided by MongoDB. Specifically, this is using the
sample_mflix
database with all of its collections.
- Git clone the repo
- Go to local repo directory
- Run the command
npm init
to install all the necessary packages and libraries - Create your own
.env.local
file in the outermost layer of the folder directory (./next-mongo
) - In the newly-created
.env.local
file, make sure you have these environments:
MONGODB_URI="<db_uri_string>"
NODE_ENV="DEV"
- Run
npm run dev
, which is the designated run script in a developer environment - Test
- Link the repo to the Vercel app
- Create environmental variables,
MONGODB_URI
andNODE_ENV
- Enter their string values respectively (
NODE_ENV
is expected to have the valuePROD
) - Deploy the application
[To be written]