/url-shortener

This is a mono-repo app for a url-shortening service. Backend is built with MongoDB (chosen for its easiness in setting up a connection via the variables in the .env file), front-end is built with create-react-app. It uses tailwind for styling/css .

Primary LanguageJavaScript

URL-SHORTENER APP

This is a mono-repo app for a url-shortening service. Backend is built with MongoDB (chosen for its easiness in setting up a connection via the variables in the .env file), front-end is built with create-react-app. It uses tailwind for styling/css .

To run the code, you need to download the repo via git clone. Once downloaded, set your MongoDB environment variables in the .env (create a .env file in the root of the backend directory) file (you'll need to set the variable names to DB_USER, DB_PASSWORD, DB_CLUSTER and DB_NAME). You can find the example of what you'll need in the db.js file located in backend/dbConfig directory of this repo.

To begin with, you also have to seed your DB. I've left a seeds.js file inside the backend directory so you can do this quickly. You can quickly seed your MongoDB collection by running node seeds.js from within the backend directory.

Once you have set up your environment variables, you'll need to install all the dependencies. The repo has been set up so you can do this in 3 commands -- first, run npm install at the root directory. Second, run npm run install-all to install all the dependencies in the backend & front end folders. And finally, now you can run both the client and server app by running npm run start-all from the root directory of the application. There is also a script to run the server on nodemone, just use npm run start-dev.

If you're running into any issues, make sure your current directory is not /frontend , or /backend.

Front-end was designed trying to replicate the structure of TinyURL .

TECH STACK

Node.JS ExpressJS MongoDB Tailwind ReactJS

RESOURCES

Resource 1 Resouce 2 Resource 3