hoangvvo / nextjs-mongodb-app

A Next.js and MongoDB web application, designed with simplicity for learning and real-world applicability in mind.
https://nextjs-mongodb.now.sh/
MIT License
1.52k stars 285 forks source link
boilerplate full-stack javascript mongodb nextjs real-life

Next.js

Next.js ❤️ MongoDB

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhoangvvo%2Fnextjs-mongodb-app&env=MONGODB_URI,CLOUDINARY_URL,NODEMAILER_CONFIG,WEB_URI&envDescription=Environment%20Variables&envLink=https%3A%2F%2Fgithub.com%2Fhoangvvo%2Fnextjs-mongodb-app%23environmental-variables&demo-title=nextjs-mongodb-app%20demo&demo-description=A%20demo%20deployed%20on%20Vercel&demo-url=https%3A%2F%2Fnextjs-mongodb.vercel.app%2F) An [**Next.js**](https://github.com/zeit/next.js/) and [**MongoDB**](https://www.mongodb.com/) web application, designed with simplicity for learning and real-world applicability in mind. :rocket: [Check out the demo](https://nextjs-mongodb.vercel.app/) :rocket:

Features

🐇 Fast and light without [bulky](https://bundlephobia.com/result?p=express@4.17.1), [slow](https://github.com/fastify/benchmarks#benchmarks) Express.js. ✨ Full [API Routes](https://nextjs.org/blog/next-9#api-routes) implementation and 👻 Serverless ready 🤠 Good ol' Middleware pattern, compatible with Express ecosystem, powered by [next-connect](https://github.com/hoangvvo/next-connect) 💋 [KISS](https://en.wikipedia.org/wiki/KISS_principle): No fancy stuff like GraphQL, SASS, Redux, etc. ✍️ Come with explanatory blog posts 📙 Can be adapted to any databases besides MongoDB (Just update [api-lib/db](api-lib/db))

:lock: Authentication and Account

- [x] Session-based authentication ([Passport.js](https://github.com/jaredhanson/passport)) - [x] Sign up/Log in/Sign out API - [x] Authentication via email/password - [ ] Authentication via OAuth (Google, Facebook, etc.) - [x] Email verification - [x] Password change - [x] Password reset via email

:woman::man: Profile

- [x] Profile picture, username, name, bio, email - [x] Update user profile

:eyes: Social

- [x] View others' profiles - [x] Posts and comments
Have any features that interest you, [make an issue](https://github.com/hoangvvo/nextjs-mongodb-app/issues). Would like to work on a feature, [make a PR](https://github.com/hoangvvo/nextjs-mongodb-app/pulls).

Guide

This project accompanies the following posts:

Also check them out on dev.to.

Although the project is written to be secure, its simplicity requires careful considerations for usage in sensitive productions. File an issue if you spot any security problems.

Dependencies

This project uses the following dependencies:

Environmental variables

Environmental variables in this project include:

Development

Start the development server by running yarn dev or npm run dev. Getting started by create a .env.local file with the above variables. See Environment Variables.

Deployment

This project can be deployed anywhere Next.js can be deployed. Make sure to set the environment variables using the options provided by your cloud/hosting providers.

After building using npm run build, simply start the server using npm run start.

You can also deploy this with serverless providers given the correct setup.

Contributing

Please see my [contributing.md](CONTRIBUTING.md).

License

[MIT](LICENSE)