This example shows how to use Tailwind CSS (v3.0), MongoDB with Next.js. It follows the steps outlined in the official Tailwind docs & MongoDB docs.
Go to .env.local.example
:- file add your MongoDB connection String to MONGODB_URI and rename it to .env.local.
Then, run
npm run dev
# or
yarn run dev
to start the server.
Deploy the example using Vercel or preview live with StackBlitz
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app -e https://github.com/theabhayprajapati/Next.js-TailwindCSS-MongoDB-TS with-mongo-tail-app
# or
yarn create-next-app -e https://github.com/theabhayprajapati/Next.js-TailwindCSS-MongoDB-TS with-mongo-tail-app
Deploy it to the cloud with Vercel (Documentation).