Coder Social home page Coder Social logo

shortener's Introduction

Bruno Rota - Shortener

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Have NodeJS installed (14 or later)
  • Have TypeScript installed
  • Have PostgreSQL installed (Once you installed postgresql you should create the `shortener' db)

Installing

  • Run npm install
  • Go to the ROOT of the project and create a new file called .env containing (with your postgresql user/pass for both DBs):
PORT=3000
BASE_URL=http://localhost:3000
POSTGRES_DB_URL=postgresql://postgres:postgres@localhost:5432/shortener
TEST_POSTGRES_DB_URL=postgresql://postgres:postgres@localhost:5432/shortener-test
DB_LOCAL=true
DEBUG=true
DEFAULT_TOKEN_EXPIRATION=30s
  • Create both databases (shortener & shortener-test) in PostgresSql.

Running the app

  • To run the app enter npm run start:dev for dev (watch mode) or just npm start in terminal.

How to possibly scale the App

  • We can separate this app in two microservices (Shorten-ms and Redirect-ms). Being that the Redirect-ms will have more request than the shorten, i would setup that microservice to have more resources. For example, i would add more memory (or EC2 Memory Optimized instance in AWS) being that this will use memory caching.
  • Another option could be setup the Redirect-ms to have a better DB response time. In this approach i would remove the memory caching and create a EC2 Storage Optimized instance in AWS.

shortener's People

Contributors

brunorota0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.