Skip to content

pagevamp/product-traineeship-2024-shortner

Repository files navigation

URL-Shortner

Product Traineeship 2024

A full-fledged URL Shortener application built with NestJS and PostgreSQL. This application allows users to shorten URLs and track analytics of it.


Features

  • User Authentication and Authorization
    • User Signups and Logins (JWT-based)
    • Email Verification for Account Activation
    • Secure endpoints
  • URL Management
    • Create Shortened URLs from long URLs
    • Set Expiration Dates for URLs
    • Automatic Email Notification upon URL Expiration
    • Ownership-based Access Control (Users manage only their own URLs)
    • Limit requests per IP to 5 requests/second
  • Analytics
    • Track Clicks, IP Addresses, and User Agents
    • Filter Analytics by Date Ranges
    • View Hit Counts per URL
  • Containerization
    • Containerized with Docker and Docker Compose

Technology Stack


Getting Started

These instructions will help you set up the development environment on your local machine.

Prerequisites

Installation

  1. Clone the Repository

    git clone https://github.com/pagevamp/product-traineeship-2024-shortner.git
    cd product-traineeship-2024-shortner
  2. Install Dependencies

    yarn install

    or

    npm install
  3. Setup Environment Variables

    Create a .env file in the project root using the provided .env.example as a reference:

    cp .env.example .env

Running the Application

  1. Start with Docker Compose

    Running with Docker Compose will start both the application and the database in separate containers:

    docker-compose up --build

    This will:

    • Pull/Build a PostgreSQL database container.
    • Build and start the NestJS application container.
  2. Start with Node

    For running this application without Docker, you need to have Nodejs and Postgresql database installed and running in your machine. Once they are installed, you can follow the following command to run the project:

    yarn run start:dev

    or

    npm run start:dev

    This will:

    • Build and start the NestJS application.

The application will be available at http://localhost:3000 or any other port specified in .env file.

Accessing the API

  • Postman Workspace: Once running, you can test the APIs endpoints from this Postman Workspace. You might have to create a postman account before joining the workspace.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •