This is a Next.js project bootstrapped with create-next-app
.
Note this Project was developed on a MacOSX system so the install steps may vary depending on your system. To get the most accurate steps I would recommend you use a MacOSX or UNIX system and utilize the NPM package manager
- Node.js installed on your machine
- A package manager (npm, yarn, pnpm)
- MongoDB account
- Mailtrap account
Clone the repository
init the project with your package manager of choice, for example:
npm init
# or
yarn init
# or
pnpm init
Dependencies should install on their own when you init the project but just incase here are the main dependencies you need to install:
npm install axios bcryptjs nodemailer jsonwebtoken react-hot-toast mongoose
# or
yarn add axios bcryptjs nodemailer jsonwebtoken react-hot-toast mongoose
#or
pnpm add axios bcryptjs nodemailer jsonwebtoken react-hot-toast mongoose
After you need to create a MongoDB account & database
- create a cluster using the free tier and name it whatever you want
- Select the closest server to you (if ur in cali then choose oregon)
- you can leave the tags blank, click create cluster
- dont create the user just yet, just click the cluster you just made on the LHS navigation bar
setting up Security options for MongoDB
- on the LHS navigation bar click on Network Access (under security)
- click on add IP address
- (at the moment) Task hero isnt production ready or is hosted on a server with a static IP, simply use the IP: 0.0.0.0/0 to allow all IP addresses to access for now
- click confirm
Setting Up user Access:
- on the LHS navigation bar click on Database Access (under security)
- click add new database user
- create a username and password, try to strictly use numbers and letters to avoid any URL encoding issues
- scroll to 'Built in role' and select Read and Write to Database
- click add user
Connecting MongoDB to TaskHero
- click on the cluster you created
- click on connect
- Click the compass icon Option
- Copy the URL provided by MongoDb, note the password field in the URL isnt provided, you need to enter that yourself (i.e. replace the '' with the one you made in earlier steps)
- paste mongoDB url into the .ENV file specified below
Setting up Mailtrap
- create a mailtrap account
- create a new inbox
- click on the inbox you just created and it should show the Integration options
- Click SMTP, then in code samples choose Node.js
- in the credentials copy the username & password into the .ENV file specified below
Following you need to create a .env
file in the projects root directory with
the following contents
MONGO_URI=your_mongo_uri
JWT_SECRET=your_jwt_secret #can be anything you want
#for local hosting
DOMAIN=http://localhost:3000 #default port
MTRAP_USER=your_mailtrap_user
MTRAP_PASS=your_mailtrap_pass
First, run the development server:
npm run dev
# or
yarn run dev
# or
pnpm run dev
# or
bun run dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page auto-updates as you edit the file.
This project uses next/font
to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!