This project is a simple yet powerful PasteBin clone that allows users to create, store, and share code snippets or any text-based content. It provides a user-friendly interface for managing pastes, complete with features for searching, editing, and deleting them. This application solves the problem of quickly sharing code snippets or text notes with others, offering a convenient and organized way to store and access them.
- Create Pastes: Easily create new pastes with a title and content. ✍️
- View Pastes: Display individual pastes with their title, content, and creation date. 👓
- Edit Pastes: Modify existing pastes to keep your snippets up-to-date. ✏️
- Delete Pastes: Remove pastes that are no longer needed. 🗑️
- Search Pastes: Quickly find pastes by searching for keywords in the title or content. 🔍
- Share Pastes: Generate shareable links for easy sharing. 🔗
- Responsive Design: Works seamlessly on various devices. 📱💻
- Frontend:
- React: JavaScript library for building user interfaces.
- Redux Toolkit: For state management.
- React Router DOM: For handling routing and navigation.
- Tailwind CSS: For styling the user interface.
- react-hot-toast: For displaying toast notifications.
- Backend:
- Node.js: JavaScript runtime environment.
- Express: Web application framework for Node.js.
- Mongoose: MongoDB object modeling tool.
- cors: Middleware for enabling Cross-Origin Resource Sharing.
- dotenv: Loads environment variables from a
.envfile.
- Database:
- MongoDB: NoSQL database for storing paste data.
Follow these steps to get the project up and running on your local machine.
- Node.js (v16 or higher)
- npm (Node Package Manager)
- MongoDB installed and running
-
Clone the repository:
git clone <repository-url> cd pastebin-clone
-
Install dependencies for the client:
cd client npm install -
Install dependencies for the server:
cd ../server npm install -
Create a
.envfile in theserverdirectory with the following variables:PORT=5000 # Or any other port you prefer MONGO_URI=<your-mongodb-connection-string>Replace
<your-mongodb-connection-string>with your actual MongoDB connection string.
-
Start the backend server:
cd server npm start -
Start the frontend development server:
cd client npm startThe frontend application should now be running at
http://localhost:3000(or another port if specified).
pastebin-clone/
├── client/
│ ├── public/
│ │ └── ...
│ ├── src/
│ │ ├── components/
│ │ │ ├── Home.jsx
│ │ │ ├── Navbar.jsx
│ │ │ ├── Paste.jsx
│ │ │ └── ViewPaste.jsx
│ │ ├── redux/
│ │ │ └── pasteSlice.js
│ │ ├── App.jsx
│ │ ├── index.js
│ │ ├── store.js
│ │ └── ...
│ ├── package.json
│ └── ...
├── server/
│ ├── controllers/
│ │ └── pasteController.js
│ ├── models/
│ │ └── Paste.js
│ ├── routes/
│ │ └── pasteRoutes.js
│ ├── index.js
│ ├── package.json
│ └── .env
├── .gitignore
├── README.md
└── ...
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive commit messages.
- Push your changes to your fork.
- Submit a pull request.
This project is licensed under the MIT License.