Skip to content

if you need to short URL clone it and make short URLs

License

Notifications You must be signed in to change notification settings

the-sabra/O-shortener

Repository files navigation

Overview

O-shortener is used to make short urls

Built With

Nest Mysql Prisma TypeScript Jest docker Redis

API Endpoints

  • POST /auth/sighup : Create a new User
  • GET /:short_code : Redirect to the original URL based on the provided short code.

For detailed documentation and examples, refer to the API Documentation file.

Installation

1- clone the Repo

git clone https://github.com/omarsabra1/O-shortener
cd o-shortener
npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

How code is work


NOTE : The controller mange the routes only but the services for business logic and connecting With ORM

  • main.ts : The entry point of the application.
  • urls/controller/urls.controller.ts : Handles the creation of shortened URLs.
  • prismaService : Is used to connect Prisma Client.
  • app.controller.ts : Handles the redirection to the original URLs.
  • auth/controller/auth.controller.ts : Handles Authentication and creating user
  • auth/guard/auth/auth.guard.ts : Verifying JWT Token
  • caching : Handle the caching layer in the app

License

O-shortener under the MIT licensed.

Contact

LinkedIn Gmail