Git Product home page Git Product logo

mds-core's Introduction

Overview

Repo for LADOT MDS implementation for contribution to the Open Mobility Foundation. It represents what is currently up and running for Los Angeles production MDS as well as new features under development. Includes the following:

  • A current LADOT implementation of all MDS endpoints
  • AWS production bindings (aws-lambda)
  • Development versions of mds-audit, mds-policy, and mds-compliance
  • MDS logging (mds-logger), daily metrics (mds-daily) and Google sheet reporting app for technical compliance.

Installation

Dependencies

  • PostgreSQL
  • Redis
  • Yarn

Database config on macOS

If you haven't installed PostegreSQL and Redis you can install them with homebrew on macOS

brew install postgresql
brew install redis

Make sure they are running before you run the tests

brew services start postgresql
brew services start redis

If you encounter the following error: FATAL: database โ€œ<user>โ€ does not exist

The following command should fix your issue createdb -h localhost

Package setup

Install Lerna

yarn global add lerna

Install all packages. Uses Yarn workspaces.

yarn install

Launching a local server for a package

Now you can work with each package

cd packages/mds-audit
yarn test
yarn start

Running the tests

You can also run all tests from the project root with

yarn test

Package Management - Lerna

This repository is a monorepo and uses Lerna for working with its packages.

Example commands

Run all test suites at once

lerna run test

Run all tests suites sequentially

lerna run test --concurrency 1

Run tests for a particular package

lerna run test --scope mds-audit

Clean all dependencies

lerna run clean

Format all files

lerna run prettier

Debugging with Visual Studio Code

Node.js: Express Server

  • Select the Node.js Express Server debug configuration
  • Select the file that implements the Node/Express server for a package (typically server.ts) in the Explorer panel
  • Press F5

Mocha Tests

  • Select the Node.js: Mocha Tests debug configuration
  • Select any one of the files in a package's test folder
  • Press F5

MDS can be provisioned to a Kubernetes cluster as follows:

  • Install and configure Docker Desktop
    • preferences / advanced: cpus:6, memory:8G, swap:1G
    • preferences / kubernetes: enabled kubernetes
  • Add kubectl to your PATH environment, e.g. for OSX:
    • export PATH=/Applications/Docker.app/Contents/Resources/bin:${PATH}
  • Configure active kubernetes cluster
    • kubectl config set-context docker-desktop

Lastly, build and deploy MDS to your kubernetes cluster:

./bin/install bootstrap build install:mds test:integration

To cleanup the MDS cluster consider:

./bin/install uninstall

For a complete listing of available operations consider:

./bin/install

Contributing

See CONTRIBUTING.md

mds-core's People

Contributors

alexgottscha avatar avatarneil avatar dependabot[bot] avatar janedotx avatar jwtodd avatar macsj200 avatar twelch avatar whereissean 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.