A Next.js app, where users can track the items they have in their pantry.
To run the app locally, clone the repo and install the dependencies with npm install
.
The app requires some env variables to run properly, so you will need to create up a .env.local
file in the root of the project.
This file should contain the following values:
MONGODB_URI=*mongodb connection string*
JWT_SECRET=*random string to hash the tokens*
JWT_EXPIRATION=*token expiration period*
SENDGRID_API_KEY=*sendgrid api key sending mail*
RAPID_API_KEY=*rapid api key to use the GeoDB Cities API*
RAPID_API_HOST=*rapid api host address*
Regarding the rubrics for the React project, this app:
- Was created with Next.js
- Uses several different data types
- Has dynamic routes, following Next.js built-in routing
- Consumes the GeoDB Cities API and renders the data
- Allows users to sort the fetched data from GeoDB API
- Uses different input fields: text fields and drop-down lists
- Implements error handling for all api requests
- Uses functional components, and built-in react hooks, such as useState, useReducer and useEffect
- Has a Nav element to aid user navigation
- API keys are not exposed
- Styled with tailwind.css
- Responsive
Additionally:
- The app is full-stack, using API Routes for the back-end
- Stores data in MongoDB, including user data
- Requires user authorization by JWT to retrieve/change their data
- Tokens are parsed with a Higher Order Function, that works simillar to express middleware
- Is deployed in vercel