-
Create an
.env
file in the root directory. -
Obtain the Client Secret and Client ID from your Google Service Account.
If you don’t already have one, create it via the Google Cloud Console. -
Add the following environment variables to your
.env
file:# Server Configuration PORT=3000 # Database Configuration DB_URI=postgresql://url_shortener_5sot_user:tP8ltTz2tXEdwvHGznVII4ZrH0leiFYh@dpg-cu4peft2ng1s73fcmaf0-a.singapore-postgres.render.com/url_shortener_5sot # Google OAuth Configuration GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= GOOGLE_REDIRECT_URI=http://localhost:3000/api/auth/google-callback # URL Shortener Configuration SHORT_URL_PREFIX=https://short.en/ # JWT Configuration JWT_SECRET=advanced-url-shortener
-
Run the application using Docker Compose:
Execute the following command in the terminal:docker compose up
-
Access the application:
Open your browser and navigate to:
http://localhost:3000
-
Sign in using the
/api/auth
route:
Visit:http://localhost:3000/api/auth
-
Once authenticated, copy the token provided in the response.
This token can be used for authenticated requests.
The full API documentation can be found here.
- Ensure the
.env
file is kept secure and not shared publicly.