Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Paste library is a web-based paste bin like service that allows users to paste and share text. I made this app to explore the MERN stack. During the development, I learned how to generate and map a short URL to a set of data with the least collision. The aim was to achieve maximum convenience and privacy.

License

Notifications You must be signed in to change notification settings

Deepak-Kharah/paste-library-mern

Repository files navigation

Paste Library

GitHub license project status

Paste library is a web-based paste bin like service that allows users to paste and share text. I made this app to explore the MERN stack. During the development, I learned how to generate and map a short URL to a set of data with the least collision. The aim was to achieve maximum convenience and privacy. So, the metric used was to complete the entire process within just two clicks.

Table of content

Installation

  1. Fork the repository, then clone from your repository.

  2. Create MongoDB server with the username super (!Important) from MongoDB atlas.

  3. Make sure you have node.js installed on your system. Download node.js if required.

    # to check if node.js exist
    node -v
  4. Go to the cloned paste-library-mern folder in your local machine and open terminal.

  5. Enter following command to install dependencies for both backend and frontend

    npm install
    cd client # paste-library-mern/client
    npm install
    cd .. # paste-library-mern/
  6. Make a copy of .env.example and rename it .env in the same directory.

  7. Replace .env file values except for DEFAULT_USER_ID.

  8. Run following commands in the terminal to run the web-application.

    # first terminal
    # paste-library-mern/
    npm start
    # second terminal
    cd client # paste-library-mern/client
    npm start

    If successful you'll see this msg in the two terminals

    Server started on port 5000
    MongoDB connected
    Compiled successfully!
    
    You can now view client in the browser.
    
    Local:            http://localhost:3000
    On Your Network:  http://192.168.xxx.xxx:3000
    
    Note that the development build is not optimized.
    To create a production build, use npm run build.
  9. Create new default anonymous user by going to url localhost:3000/register with any credentials you like. This will be used for all dump creation for logged out user.

  10. Go to your Atlas dashboard and click on collections now find users database and copy _id. Now, paste this in .env > DEFAULT_USER_ID.

    Note: copy only the string inside ObjectId()

Usage

Go to localhost:3000/ to view the project running and use it like any other web-application.

first look

Tech stack

Front end

  • HTML
  • CSS
  • ReactJS

Backend

  • NodeJS
  • ExpressJS

Database

  • MongoDB

Server

  • Heroku

Deployment

This web-application is deployed using Heroku under the domain pastelibrary.tk

Screenshots

screenshot of login page

screenshot of login page

screenshot of login page

screenshot of login page

License

This web-application is licensed under MIT. For more info refer to LICENSE file in the root directory.

About

Paste library is a web-based paste bin like service that allows users to paste and share text. I made this app to explore the MERN stack. During the development, I learned how to generate and map a short URL to a set of data with the least collision. The aim was to achieve maximum convenience and privacy.

Topics

Resources

License

Stars

Watchers

Forks