ivinayakg / shorte.live

Open-Source URL Shortner
https://shorte.live
MIT License
28 stars 6 forks source link

shorte.live

Info

Setup Locally

  1. Clone the project locally with

    git clone https://github.com/ivinayakg/shorte.live.git
  2. Setup env files

    • for frontend env variables, run the following command from the repo root, in the terminal.
      cp client/sample.env client/.env
    • for backend env variables, run the following command from the repo root, in the terminal.
      cp api/sample.env api/.env
  3. Setup Google Oauth keys

    • Currently, the service only has one primary means of authentication, and that is with Google OAuth. Read in detail here
    • You need to obtain your secret key and client ID to make this work.
      1. Login to your Google console here.
      2. Create a new project here.
      3. Open the API dashboard, and go to OAuth consent screen here. Once there configure your screen, read more here
      4. Now navigate to credentials and create a new one.
        • add http://localhost:3100 into Authorized JavaScript origins
        • add http://localhost:3100/user/google/callback into Authorized redirect URIs
        • Read more here
      5. Once done copy your client id and your client secret, and paste into your api/.env file for the variable GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET and done.
  4. Setup Local DB and Local Redis

    • You need Docker Desktop installed for this on your system. check here
    • Once verified, open your Docker Desktop and keep it running in the background.
    • Run the following command from the repo terminal
      docker-compose -f config/compose.yml up
    • If you want it to be running in the background add the -d flag.
      docker-compose -f config/compose.yml up -d
  5. Test

    • Open client directory in your terminal and run yarn dev
    • Open api directory in your terminal and run go run .
    • and done

Deploy

Contribution

Note