👋🏿 Hi! I’m Yeabsra, a web and mobile developer from Ethiopia. I’ve put together my preferred tech stack and starter template for a Next.js full stack project. It includes Next.js, Mongoose, Zod, Shadcn, Tailwind, and NextAuth, using pnpm. Feel free to use it if you want. Let’s connect and create something awesome together!
- Next.js: The React framework for production.
- Mongoose: Elegant MongoDB object modeling for Node.js.
- Zod: TypeScript-first schema declaration and validation library.
- Shadcn: Custom UI components for Shadcn.
- Tailwind CSS: A utility-first CSS framework.
- NextAuth: Authentication for Next.js.
- pnpm: Fast, disk space efficient package manager.
To get started with this template, follow these steps:
Make sure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/yeabnoah/technerd_NextJs_starter_template.git cd technerd_NextJs_starter_template
-
Install dependencies:
pnpm install
-
Set up environment variables:
change the
.env.example
to.env.local
file in the root of your project and uncomment and the following environment variables:# MongoDB connection string use the guide in the file to setup and link to your database either local or Atlas project MONGODB_URI=your_mongodb_uri # NextAuth configuration NEXTAUTH_SECRET=your_nextauth_secret NEXTAUTH_URL=http://localhost:3000 # Other environment variables
-
Run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
Here's an overview of the project structure:
├── app ├── api ├── auth ├── components # Reusable UI components ├── lib # Library code also Mongoose connection with NextJS ├── models # Mongoose models ├── public # Public assets ├── utils # Utility functions ├── .env.local # Environment variables / change the env.example to env.local
check yourBaseUrl/api/user with GET
and POST
request on postman to validate the DBconnection and api is working
This template uses NextAuth for authentication. You can configure different authentication providers in pages/api/auth/[...nextauth].ts
.
Mongoose is used for MongoDB interaction. Define your Mongoose models in the models
directory.
Zod is used for schema validation. You can define your schemas and use them to validate data throughout your application.
Feel free to submit issues and pull requests. Let's improve this template together!
Let’s connect and create something awesome together! You can reach me at:
- Email: yeabnoah5@gmail.com
- LinkedIn: LinkedIn
- GitHub: Github
- Telegram telegram
Happy coding! 🎉