Giter Club home page Giter Club logo

nextjs-boilerplate's Introduction

Next.js Boilerplate with MongoDB mongoose and SEO

This is a Next.js boilerplate project bootstrapped with create-next-app using mongoose for MongoDB database connection and schemas.

GitHub Repo stars GitHub followers

About

This project was developed by Nils-Christopher Wiesenauer (NurNils) to simply create new Next.js projects with SEO and an API connected to a MongoDB using mongoose.

โš™๏ธ The project is created with Next.js with MongoDB. More info

๐Ÿ“„ To create sitemap(s) and robots.txt the sitemap generator next-sitemap is used.

๐Ÿ“ˆ mongoose is used for elegant mongodb object modeling

๐Ÿ’ฌ JSend is used as a specification for a simple, no-frills, JSON based format for application-level communication

๐ŸŽจ Prettier is used for code formatting

๐Ÿ“ Licensed under MIT: Do almost anything you want with this project files

Table of Contents

MongoDB

MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era. This example will show you how to connect to and use MongoDB as your backend for your Next.js app.

If you want to learn more about MongoDB, visit the following pages:

Installation and Usage

Set up a MongoDB database

Set up a MongoDB database either locally or with MongoDB Atlas for free.

Set up environment variables

Copy the env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Set each variable on .env.local:

  • MONGODB_URI - Your MongoDB connection string. If you are using MongoDB Atlas you can find this by clicking the "Connect" button for your cluster.

Run Next.js in development mode

npm install
npm run dev

# or

yarn install
yarn dev

Your app should be up and running on http://localhost:3000 Ensure that you have provided the correct MONGODB_URI environment variable.

When you are successfully connected, you can refer to the MongoDB Node.js Driver docs for further instructions on how to query your database.

Learn More

To learn more about Next.js, take a look at the following resources:

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.