- React.js: Front-end
- Next.js: API routes and server-side rendering
- MongoDB: Permanently storing data
- Next-Auth and Auth0: Single Sign On (SSO) setup
- eslint: Automatically identifying and fixing code errors
- prettier: Setting a common code style and fixing any issues
A running instance of MongoDB is required this project.
- Decide if you want to run MongoDB locally or remotely
- Locally
- Download MongoDB Community Server
- Go through the installation instructions.
- Leave the port at default 27017
- Remotely
- Create a MongoDB instance on MongoDB Atlas
- In Security → Network Access: add the IP address
0.0.0.0/0
(all IPs) - In Security → Database Access: Add new database user
- In Data Storage → Clusters: Find your cluster and click
Connect
→Connect your application
and copy the connection string, set the username and password, and set this asDATABASE_URL
in.env.local
- It's very helpful to install MongoDB Compass to see your database contents
- Create a
Regular Web Application
in Auth0. - In the app settings, add
http://localhost:3000/api/auth/callback/auth0
(and also the prod callback replacing http:///localhost:3000) toAllowed Callback URLs
- Clone this project to your computer
- Navigate to this project in terminal and enter
npm install
- Run
npm run secrets
to sync secrets to.env.local
- OR Rename
.env.local.example
to.env.local
and fill it out with the dev config - NOTE: Windows users will need to run
npm run secrets:login
andnpm run secrets:sync
instead of the above command
- For dev, update
.env.local
- For production, add the env vars to your host, NEVER commit
.env
to your VCS
To understand this code better, read the Code Tour.
- Run
npm install
- Run
npm run dev
- Setup your host/vm and the necessary env vars
- Run
npm install
- Run
npm run start