Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 2.21 KB

readme.md

File metadata and controls

79 lines (55 loc) · 2.21 KB

Oslash Backend

Backend implementation of a personalised URL manager.

Getting Started

This project is based on Tyepscript, Nodejs based on a MVC framework.

Prerequisites

Requirements for the software and other tools to build, test and push

Installing

Once above prerequisites are ensured to be there, follow these steps

Clone this project locally

git clone https://github.com/himanshu007-creator/oslash-clone.git

now navigate to root and install the dependencies

cd oslash-clone
npm install

Now our project is ready but we need to create a Config file. In root, create a folder named config and inside it create a file config.js and store following credentials

export default {
  port: XXXX,
  dbUri:
    "mongodb+srv://....true&w=majority",
  hash: "------",
  jwt: "---",
  corsOrigin: "http://localhost:3000",
};

Now simply run the development version of your project

npm run dev

endpoints available

GET /o/:id : redirects after geting full link from short link

POST /api/auth/login: logins user based on user credentials

POST /api/auth/register: Reigster new user

POST /api/auth/token: provide access token using refresh token

DELETE /api/auth/logout: revokes access from refreshtoken

POST /api/user/create: creates new short url for user

GET /api/user/links: provides all user links with additional sorting based on shortlink or create_at property

DELETE /api/user/:short: deletes a link

GET /api/user/search: search user based on shortUrl or tag

GET /api/performance provide URL stats of individual user [under progress]

WIP

  • Updaating route to update shortURL
  • Deployment and in-house documentation

Future enhancements

  • handle token expiration on logout route
  • ShortURL analytics following backlinks and visits.