Git Product home page Git Product logo

maniklem / lightning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openfn/lightning

0.0 0.0 0.0 3.31 MB

Lightning extends OpenFn's existing DPG, providing a web UI to visually manage complex workflow automation projects.

Home Page: https://OpenFn.github.io/Lightning

License: GNU General Public License v3.0

Shell 1.31% JavaScript 1.06% Elixir 85.27% CSS 2.59% HTML 9.17% Batchfile 0.02% Dockerfile 0.59%

lightning's Introduction

OpenFn/Lightning (alpha) CircleCI codecov Docker Pulls

Lightning extends the existing OpenFn Digital Public Good, providing a web UI to visually manage complex workflow automation projects.

Setting up

The easiest way to set up Lightning is via Docker. We have included the necessary files to get everything setup using Docker Compose.

If you'd like to contribute or set things up locally for development, checkout the Contributing section.

Steps

  • Install Docker
  • Check out the repo using git
  • Copy the .env.example file to .env
  • Run docker compose run --rm web mix ecto.migrate
    This will build the container, and set the database up with the up to date schema.

Once you've done that, you can run docker compose up every time you want to start up the server.

By default the application will be available from localhost:4000.

Troubleshooting

If you're actively working with docker, start experiencing issues and would like to start from scratch you can clean up everything and start over like this:

# To remove any ignored files and reset your .env to it's example
git clean -fdx && cp .env.example .env
# You can skip the line below if you want to keep your database
docker compose down --rmi all --volumes

docker compose build --no-cache web && \
  docker compose create --force-recreate

docker compose run --rm web mix ecto.migrate
docker compose up

Contributing

We appreciate any contribution to Lightning.

Setting up locally

Database

Ensure you have a PostgreSQL database setup and running, here is an example to get it running quickly using docker.

docker volume create lightning-postgres-data

docker create \
  --name lightning-postgres \
  --mount source=lightning-postgres-data,target=/var/lib/postgresql/data \
  --publish 5432:5432 \
  -e POSTGRES_PASSWORD=postgres \
  postgres:14.1-alpine

docker start lightning-postgres

Elixir & Ecto

We use asdf to help with our local environments. Included in the repo is a .tool-versions file that is read by asdf in order to dynamically make the specified versions of Elixir and Erlang available.

asdf install  # Install language versions
mix local.hex
mix deps.get
mix local.rebar --force
mix ecto.create # Create a development database in Postgres
mix ecto.migrate
mix openfn.install.runtime

Run the app

Lightning is a web app. To run it, start the development server by running mix phx.server. Once the server has started, head to localhost:4000 in your browser.

Running Tests

Before the first time running the tests, you need a test database setup.

MIX_ENV=test mix ecto.create

And then after that run the tests using:

MIX_ENV=test mix test

We also have test.watch installed which can be used to rerun the tests on file changes.

Security and Standards

We use a host of common Elixir static analysis tools to help us avoid common pitfalls and make sure we keep everything clean and consistent.

In addition to our test suite, you can run the following commands:

  • mix format --check-formatted
    Code formatting checker, run again without the --check-formatted flag to have your code automatically changed.
  • mix dialyzer
    Static analysis for type mismatches and other common warnings. See dialyxir.
  • mix credo
    Static analysis for consistency, and coding standards. See Credo.
  • mix sobelow
    Check for commonly known security exploits. See Sobelow.
  • MIX_ENV=test mix coveralls
    Test coverage reporter. This command also runs the test suite, and can be used in place of mix test when checking everything before pushing your code. See excoveralls.

For convenience there is a verify mix task that runs all of the above and defaults the MIX_ENV to test.

Generating Documentation

You can generate the HTML and EPUB documentation locally using:

mix docs and opening doc/index.html in your browser.

lightning's People

Contributors

stuartc avatar taylordowns2000 avatar elias-ba avatar amberrignell 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.