Giter Club home page Giter Club logo

zywa-assignment's Introduction

Zywa Assigment Documentation

This is task that i have implement as a part of Zywa Recruitment Assignment , implemented the task with proper file structuring.The project involves processing data from a CSV file, storing it in a MongoDB database, and creating an API endpoint to retrieve the latest status of a card.

Features

  • We have given set of data for user's card.
  • So implementd an endpoint to get status of user card.

Technologies Used

  • Node.js (javascript)
  • Express
  • MongoDb
  • Mongoose

File Structure

Main file is app.js, data folder contains provided CSV files, in User folder i am implementing all the business logic, SetUpData folder contains file to copy data from local store (data folder) into MongoDB database.

Setup

To run following project , follow these steps:

  1. Clone the repository to your local machine (mycase it is ubuntu)

    git clone https://github.com/dhakad22klx/Zywa-Assignment
    
  2. Install the required packages.

    cd Zywa-Assigment
    npm i
    
  3. Start the application.

    nodemon app.js
    
  4. Open the application in your web browser and pass json in body having cardId as one attribute.

    http://localhost:{3000}/user/getcardstatus
    

Architectural Decisions

  1. Schema Design: Four schemas are created to represent different card statuses. This design choice allows for efficient querying and retrieval of status data.

  2. API Endpoint: An endpoint is created to provide a convenient interface for retrieving card statuses. The endpoint is designed to be intuitive and RESTful, accepting a card ID as input and returning the latest status.

  3. Error Handling: Error handling middleware is implemented to gracefully handle errors and provide meaningful responses to clients.

  4. Database Selection : We could have used SQL in place of NoSQL but i have choosed this one considering scalability in mind and easy to implement or data complexity in future.

Possible Improvements

  1. Input Validation: Implement input validation to ensure that only valid card IDs are accepted by the API endpoint.

  2. Authentication & Authorization: Add authentication and authorization mechanisms to secure the API endpoints and restrict access to authorized users.

zywa-assignment's People

Contributors

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