Giter Club home page Giter Club logo

logbox's Introduction

Logbox

Setup

You will need to have Docker compose installed

Setup the .env file:

  1. cp .env.example .env
  2. Fill in your AWS S3_KEY and S3_SECRET values
  3. Create a new SECRET_KEY - this can be any random string

Bring all of the containers up (this runs in the foreground until you hit ctrl-c):

npm run up

With npm run up still going, setup the development and test databases

npm run setup

To ssh into a container

npm run ssh

Run the test suite(you will need to run npm run up and npm run setup first)

npm test

While testing you may mess up the test database, and start getting database errors while running your tests.

Then you need to run npm run setup to reset the test database.

Run the linter

npm run lint

Create a migration

npm run migration -- -m create_logs

Apply a migration

npm run migrate

Rollback a migration

npm run rollback

Connect to the database

npm run db

Generate an API token for a client

Supply a name for the client like dumbledore:

npm run api-token -- mylittledrone

Answers to additional considerations

1. Security

The app requires auth tokens in the header with every API request. All requests are logged.

2. Scalability

We could scale horizontally with this system. If database writes became a bottleneck, we could stagger log ingestions or shard the database. Using AWS lambda would also be advisable for log ingestion.

3. Integrity

We would implement hashes of all logs to verify proper upload from drones.

Furthermore, every log would be saved in its original format in s3, replicated across a geographically distinct zone. We could always compare hashes of the logs in the db with the files to ensure consistency. And if the db ever disappeared, we could reload the log events from s3.

4. Testing

We'd aim for unit and request tests to ensure proper API responses. To test capacity of the system, we'd simulate mass uploads with apache benchmark or similiar scripts.

logbox's People

Contributors

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