Giter VIP home page Giter VIP logo

node-api-postgres's Introduction

T4 Address Search Engine - LIGHT

Introduction

This is a simple search engine for LOB addresses executed in a Node.js runtime and stood on top of a PostgreSQL database.

Endpoints

  • /addresses
  • Query parameters:
    • line1: The main address line
    • line2: Optional address line i.e apt #700
    • city: The city name
    • state: The state abbreviation
    • zip: The zip code

Architecture

  • Language: Typescript es2017 modules
  • Runtime: Node.js inside a Docker container
  • Database: PostgreSQL inside postgres container
  • Versioned routes and RESTful API methodology
  • Containers communicate on a network

server.ts is the entrypoint for the application. It loads the express framework, imports the database, and the versioned routing middleware. The v1Router imports the logging, cors, apiValidator, errorHandler, and the application routes.

What Is Missing ?

  • Full RESTful API CRUD operations
  • API Authentication
  • Post / Patch / PUT Request body validation
  • Full error logging
  • A more comprehensive implementation of search parameters

Features

This simple search engine can take partial address parameters and return a list of matching addresses if they exist in data store.

  • A user can add an address into data store.
  • The system will return an exception If the address already exists in the data store.

Startup

Copy the .env.sample file to .env and update the postgres database connection values

cp .env.sample .env

The below command will start postgres and the node container.

 docker compose up -d

Link to the Postman collection

https://www.getpostman.com/collections/df3b95097c236d6313d0

node-api-postgres's People

Contributors

redbonzai avatar

Watchers

 avatar James Cloos 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.