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.
-
Create MongoDB server with the username super (!Important) from MongoDB atlas.
-
Make sure you have
node.js
installed on your system. Download node.js if required.# to check if node.js exist node -v
-
Go to the cloned
paste-library-mern
folder in your local machine and open terminal. -
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/
-
Make a copy of
.env.example
and rename it.env
in the same directory. -
Replace
.env
file values except forDEFAULT_USER_ID
. -
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.
-
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. -
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()
Go to localhost:3000/ to view the project running and use it like any other web-application.
- HTML
- CSS
- ReactJS
- NodeJS
- ExpressJS
- MongoDB
- Heroku
This web-application is deployed using Heroku under the domain pastelibrary.tk
This web-application is licensed under MIT. For more info refer to LICENSE file in the root directory.