Paste - A simple pastebin clone
This is a simple pastebin clone built with Next.js and MongoDB.
This is an educational project to learn Next.js and MongoDB. It is not intended to be used in production.
This application leverages Next.js and MongoDB to seamlessly store and retrieve user-submitted code snippets. Snippets are securely stored in a MongoDB database and can be conveniently accessed through a unique URL generated upon submission, with Next.js efficiently managing the MongoDB connection.
Also supports Dark/Light mode.
git clone https://github.com/turing0/paste-bin.git
- Create a free account on MongoDB Atlass.
- Create a new cluster.
- Create a new database user.
- Get the connection string.
Create a file named .env.local
in the root directory of the project. Add the following environment variables to the file.
SECRET_KEY= # A random string used for encryption.
BASE_URL= # The URL of the app. ex: https://paste.laphel.com/
MONGODB_URI= # The connection string to your MongoDB instance.
npm install
Then, run the application in the command line and it will be available at http://localhost:3000
.
npm run dev
Deploy the example using Vercel:
This repo is MIT licensed.