Giter Site home page Giter Site logo

pool's Introduction

Pool Tool

Architecture

Follow the Architecture documentation.

Development

A guide how to setup the project with devcontainers can be found here.

The project executable can be run via command line make sihl and shows the information of the executable.

  1. Create a .env file and set the environment variable ECON_PACKAGE_REGISTRY_READ_TOKENto the value stored in 1Password or in the GitLab CI/CD variables.
  2. Migrate root database with make sihl migrate.root
  3. Seed root database make sihl seed.root
  4. Migrate tenant database with make sihl migrate.tenant
  5. Seed tenant database make sihl seed.tenant
  6. Run development server make dev
  7. See pool/database/seed/seed_user.ml for default users or make sihl user.admin [email protected] admin_secret to generate one

Commands

  • make install - to install all the dependencies. Under the hood, dune is used for package management.
  • make sihl migrate.root - runs all migrations for root database
  • make sihl seed.root - runs all seeds with development data for root database (use make seed.root.clean for a clean restart)
  • make sihl migrate.tenant - runs all migrations for tenant databases
  • make sihl seed.tenant - runs all seeds with development data for tenant database (use make seed.tenant.clean for a clean restart)
  • make dev - runs build in watch mode and the web application on port 3016 (default). You typically have that process running in one shell. Changing code will recompile and restart the server automatically. Changing JS code that is not embedded in .ml files (libraries) requires restarting the server.
  • make test to run all tests. This requires a running MariaDB instance for integration tests.
  • make sihl runs the executable and shows the list of commands
  • make sihl <ARGS> runs the executable with the provided arguments

Environment files

For completeness, these environment files are handled with priority from SIHL.

  • .env: Stores the environment for your local development
  • .env.test: Stores the environment used when running tests (e.g. with make test)

๐Ÿš€ Release new version

  1. Update CHANGELOG.md and document changes made. Ensure the version to be releases has a header matching the version, follow previous releases.
  2. Commit your changes.
  3. Release version using yarn version.
  4. Push changes and Git tag.

Build project

Run make build to build the pool-tool project. This builds .ml files using dune.

Local test with production environment

When testing the production environment, you need to update the csrf cookie key (default __HOST-csrf). This can be done with adding the optional argument cookie_key to the csrf middleware.

(* NOTE: the middleware might have additional arguments defined *)
Sihl.Web.Middleware.csrf ~cookie_key:"csrf" ()

__Host- prefix: Cookies with names starting with __Host- must be set with the secure flag, must be from a secure page (HTTPS), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /.

Source: https://developer.mozilla.org/de/docs/Web/HTTP/Headers/Set-Cookie

Alternatively, these options simulate a similar production environment (without CHECK_CSRF):

QUEUE_FORCE_ASYNC=true EMAIL_BYPASS_INTERCEPT=true [email protected] SMTP_HOST=uzhxchange.uzh.ch [email protected] SMTP_PORT=5587 SMTP_START_TLS=true SMTP_PASSWORD=<password> make dev

Use this until new SMTP method is supported is resolved:

SMTP_HOST=smtp.uzh.ch SMTP_PORT=25 [email protected] SMTP_START_TLS=true EMAIL_BYPASS_INTERCEPT=true make dev

pool's People

Contributors

mabiede avatar aronerben avatar chrismamo1 avatar asaurer avatar timohuber avatar joseferben avatar mawidme 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.