Giter Club home page Giter Club logo

csv-endpoint's Introduction

Assignment

πŸ“ Table of Contents

🎈 Usage

Upon running npm start, the server is running and listens on localhost:3000. Queries can be made using either the card_id or user_mobile parameters.

To search using the card_id: http://localhost:3000/get_card_status?card_id=ZYW7631

To search using the mobile number: http://localhost:3000/get_card_status?user_mobile=534534534

🧐 Problem Statement

The challenge is to process data provided by various companies in separate CSV files. This data is fragmented, and comprehensive information about a user's card is not readily available. To support customer service agents and for internal tracking purposes, an endpoint /get_card_status needs to be created. This endpoint should accept either the user’s phone number or the card ID and return the status of the card.

⛏️ Approach

  • PostgreSQL - Database: Utilized for data storage as per the requirement to implement a persistent database.
  • Express - Server Framework: Chosen for its flexibility, modularity, and support for middlewares. Its active community, extensive documentation, and supports majorly every service.
  • Node.js - Server Environment: Selected for its efficient request handling, enabling the use of JavaScript/TypeScript for both frontend and backend development. Node.js boasts a vast ecosystem of open-source libraries and packages, making it highly scalable.
  • Prisma - Database Toolkit: Employed for its support of multiple database services, connection pooling capabilities, and auto-generated CRUD operations. Prisma also facilitates real-time data synchronization.

⛓️ Dependencies

The project relies on dependencies such as Express, CSV, Moment, and pg. Using neon.tech for a postgres database

πŸš€ Future Scope

  • Security Enhancements: Implementation of role-based access control, regular auditing and patching of dependencies, and utilization of encryption techniques to safeguard sensitive data.
  • Automated CSV Upload: Instead of manual CSV file loading, an endpoint could be developed to enable file uploads, automatically updating the database.
  • Using a Serverless backend: We can shift the backend to server-less using cloudflare workers.

🐳 Dockerfile Execution

To run the application using Docker, follow these steps:

  1. Build the Docker image using the provided Dockerfile:

    docker-compose build
    
  2. Run the docker image

    docker-compose up

Deployment

Deployed on Render js using the github repo

https://csv-endpoint.onrender.com/

Deployed on Render js using the docker image

https://basic-csv-app.onrender.com

As the services used are of free tier, might take time to boot up.

csv-endpoint's People

Contributors

oohsai 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.