This codebase is the completed code for an article that covers how you can build a modern application with NextJs and MongoDB. The app you will build is called a Macro Compliance Tracker. The app allows you to track your calories and macros, as well as acceptable ranges to be in compliance. Read the article to find out how and why.
- A recent version of Node.js.
- MongoDB. Try MongoDB Atlas for free. You can use code ADO200 for a $200 credit.
If you want to add sample data. You can find it in the included data.json file. Import it into your database.
- Clone the repo
- Navigate to the
mct
directory. - Run
npm install
in your terminal to install dependencies. - Run
npm run dev
to start the local development server. - Update the
{YOUR-MONGODB-CONNECTION-STRING}
string in thedatabase.js
file located in themiddleware
directory with your MongoDB connection string. - Ensure the
client.db('{DATABASE-NAME}')
string in thedatabase.js
file matches the database name you wish to use.
Navigate to localhost:3000
to see your application in action.