Setting Up the Python environment


A neat and organized python environment is reccomended for running spoo.me locally without any conflicts and ease of developments.


Prerequisites


  1. Python 3.10+

  2. Git

  3. Any code editor


Getting Started


  1. Clone the repository

    git clone https://github.com/spoo-me/url-shortener.git
  2. Change directory to the cloned repository

    cd url-shortener
  3. Install virtualenv to create a virtual environment for this project

    pip install virtualenv
  4. Create a virtual environment

    python -m venv venv
  5. Activate the virtual environment

    For windows use this code:

    env/Scripts/activate

    For mac use this code:

    source venv/bin/activate
  6. Install the required python packages

    pip install -r requirements.txt
  7. Check the installed packages

    pip list
  8. Create a .env file.

    touch .env
  9. Fill in the environment variables in the .env file with the values generated before

    MONGODB_URI=
    CONTACT_WEBHOOK=
    URL_REPORT_WEBHOOK=
    

    The MONGODB_URI, CONTACT_WEBHOOK, and URL_REPORT_WEBHOOK environment variables are sensitive and should not be shared with anyone. The values of these environment variables were generated in the previous steps.

  10. If you see all the required packages, congratulations 🎉 you are good to go! Follow the next steps to start the server


Method 3
Starting the server