|
| 1 | +<!--Please do not remove this part--> |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +# URL Shortening Application in Flask |
| 6 | + |
| 7 | +## 🛠️ Description |
| 8 | +This project is about developing a url shortening application in **Flask** and **MongoDB**. User will paste their long URLs in this application and will get a shortened url, which will redirect to the same long url once used in a browser. |
| 9 | + |
| 10 | +## ⚙️ Languages or Frameworks Used |
| 11 | + - Flask, MongoDB |
| 12 | + - HTML, CSS, Bootstrap |
| 13 | + |
| 14 | + |
| 15 | +## 🌟 How to run |
| 16 | + - ### Install all the requirements |
| 17 | + Run `pip install -r requirements.txt` to install all the requirements. |
| 18 | + - ### MongoDB Setup for Project |
| 19 | + |
| 20 | + - Download monogdb from the [official website](https://www.mongodb.com/try/download/community) and setup in your local system for testing. |
| 21 | + - Once it is setup locally, try creating documents and collections in mongodb to familiarize yourself with it. |
| 22 | + - You can also download the `MongoDB Compass`, which is the GUI version of Mongo Shell. |
| 23 | + - Once all the local testing is done, you can create a free cloud version of MongoDB in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register) and get the following credentials from the dashboard of atlas: |
| 24 | + ```bash |
| 25 | +export MONGO_URI=YOUR_MONGO_URI |
| 26 | +export MONGO_USERNAME=YOUR_MONGO_USERNAME |
| 27 | +export MONGO_PASSWORD=YOUR_MONGO_PASSWORD |
| 28 | +``` |
| 29 | + |
| 30 | + |
| 31 | +- ### Setup Environment for the project |
| 32 | + - Now create a `.env` file in your project dreictory and include the following parameters as it is :- |
| 33 | +```bash |
| 34 | +export ENVIRONMENT=local | production (choose on the basis of local or production environment) |
| 35 | +export APP_SECRET=YOUR_APP_SECRET |
| 36 | +export APP_URL=YOUR_APP_URL (the short url) |
| 37 | +export MONGO_URI=YOUR_MONGO_URI |
| 38 | +export MONGO_USERNAME=YOUR_MONGO_USERNAME |
| 39 | +export MONGO_PASSWORD=YOUR_MONGO_PASSWORD |
| 40 | +export DB_NAME=YOUR_DATABASE_NAME |
| 41 | +``` |
| 42 | + |
| 43 | +- ### Now Just, Run the project |
| 44 | + - To the run the project, go to the `bash` terminal of VSCode or any other code editor and run `./start_server.sh`. |
| 45 | + - You don't have to care about setting `.env` then yourself then. |
| 46 | + |
| 47 | + |
| 48 | +## 📺 Demo |
| 49 | +- Main screen of the application. |
| 50 | + |
| 51 | +- Paste you long URL in the input. |
| 52 | + |
| 53 | +- Click on Shorten and copy the `short url` to clipboard |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +## 🤖 Author |
| 59 | + |
| 60 | +Github - [MBSA-INFINITY](https://github.com/MBSA-INFINITY) |
| 61 | +LinkedIn - [MBSAIADITYA](https://www.linkedin.com/in/mbsaiaditya/) |
| 62 | +Portfolio - [MBSA](https://mbsaiaditya.in/) |
0 commit comments