Coder Social home page Coder Social logo

meteors's Introduction

Mrteor

# Meteor App Server

Description

This is the backend to support the Meteor App UI.

Table of Contents

Design Decisions

Assumptions

  1. Data set is finite and small, containing only 1000 records.

Caching

For caching, we utilized the cache-manager library to naively cache each HTTP call using the URL as the key. This decision was made for simplicity and ease of implementation.

However, a more advanced caching system could be beneficial for larger scenarios. Systems like Redis or other in-memory caching solutions could provide better performance. They would permit caching of query results and introduce more optimization opportunities.

Data Storage

The dataset, being small and finite, is stored as a JSON data structure for demonstration purposes. In more scalable scenarios, a relational DB would be more appropriate. A potential SQL data model might be:

CREATE TABLE meteorites (
    meteorite_id INT PRIMARY KEY,
    name VARCHAR(255),
    nametype VARCHAR(255),
    recclass VARCHAR(255),
    mass FLOAT,
    fall VARCHAR(255),
    year DATETIME
);

Using a relational database would provide benefits like caching, offsetting, relationships, and lookups. Still, given our dataset's size, the JSON structure should perform adequately.

Pagination

Given our primary assumption and the choice against a relational DB, pagination is straightforward. We slice the dataset and offset results based on the requested page.

Installation

$ npm install

Running the App Locally

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Running the App Docker

# build the container
$ docker build -t meteor-server .

# run the container
$ docker run -p 3001:3001 meteor-server

Testing

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

meteors's People

Contributors

sinai-doron 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.