Skip to content

Latest commit

 

History

History
114 lines (70 loc) · 4.23 KB

README.md

File metadata and controls

114 lines (70 loc) · 4.23 KB

Next.js

Next.js ❤️ MongoDB

Deploy with ZEIT Now

A full-fledged app made with Next.js and MongoDB

Features

  • Session
  • Sign up/Sign in/Sign out

👩👨 Profile

  • Profile picture, name, bio, email
  • Edit profile

🔧 Account

  • Email verification
  • Password change
  • Password reset

👀 Users and social

  • Other user profile
  • Posting
  • PM?

Have any features that interest you, make an issue. Would like to work on a feature, make a PR.

Dependencies

This project uses the following dependencies:

  • next.js - v9.3 or above required for API Routes and new new data fetching method.
  • react - v16.8 or above required for react hooks.
  • react-dom - v16.8 or above.
  • swr - required for state management
  • mongodb - may be replaced by mongoose.
  • passport, passport-local - required after #39 for authentication
  • next-connect - recommended if you want to use Express/Connect middleware and easier method routing.
  • express-session, connect-mongo - required for session, may be replaced with other session libraries such as cookie-session or next-iron-session.
  • bcryptjs - optional, may be replaced with any password-hashing library. argon2 recommended.
  • validator - optional but recommended.
  • multer - may be replaced with any middleware that handles multipart/form-data
  • cloudinary - optional, only if you are using Cloudinary for image upload.
  • @sendgrid/mail - optional, only if you are using SendGrid to send emails.

Environmental variables

The environment variables will be inlined during build time and thus should not be used in front-end codebase.

Required environmental variables in this project include:

  • process.env.MONGODB_URI The MongoDB Connection String (with credentials)
  • process.env.EMAIL_FROM The email address to send your emails from.
  • process.env.DB_NAME The name of the MongoDB database to be used.
  • process.env.WEB_URI The URL of your web.
  • process.env.SESSION_SECRET (only if you use express-session) The secret to be used in express-session.
  • process.env.CLOUDINARY_URL (optional, Cloudinary only) Cloudinary environment variable for configuration. See this.
  • process.env.SENDGRID_API_KEY (optional, SendGrid only) SendGrid API Key. See this.

Development

Start the development server by running yarn dev or npm run dev. The project supports using .env. Getting started by create a .env file with the above variables.

.env

I include my own MongoDB, Cloudinary, SendGrid environment variables in .env.example for experimentation purposes. Please replace them with your owns and refrain from sabotaging them. You can try them in development by renaming it into .env.

In production, it is recommended to set the environment variables using the options provided by your cloud/hosting providers. Do not use or commit .env.

Contributing

Please see my contributing.md.

License

MIT