Giter Club home page Giter Club logo

etp-core's Introduction

ARA - Energiatodistuspalvelu

The components of the system are:

  • User interface for different stakeholders
  • Backend / application layer
  • Database (PostgreSQL)

Backend / Application layer

The backend contains the following components:

  • etp-backend - backend services for both the public and authorities -sections
  • etp-db - database migration tool

User interface

Separate repositories at https://github.com/solita/etp-front and https://github.com/solita/etp-public

Installing the development environment

Java 17

For Ubuntu:

sudo apt install openjdk-17-jdk

Docker

Installation for Linux by following the instructions at the following URL:

https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository

Remember to follow the Docker postinstall -guide. Then logout and login.

Docker-compose is also required:

https://docs.docker.com/compose/install/

Clojure + CLI Tools

For Ubuntu:

https://clojure.org/guides/getting_started#_installation_on_linux

LibreOffice

Install LibreOffice

For MacOS:

brew install libreoffice
ln -s /opt/homebrew/bin/soffice /opt/homebrew/bin/libreoffice

Starting the development environment

Start the required services (database etc):

cd docker
./start.sh

Start script starts docker-compose, creates template and dev databases and runs migrations for both of them.

Docker-compose has a service for faking digital signatures, mpollux. It uses a self-signed certificate. Visit https://127.0.0.1:53952/ and trust the certificate to get the digital signatures working.

Start the backend. Backend developers should start the REPL from their IDE and start the services from there by calling the reset function. The application can be also started from the command line with the following command:

cd etp-backend
clojure -M:dev -m solita.etp.core

Tests can be run (parallel) with

cd etp-backend
clojure -M:dev:test

Test coverage report (without API layer) can be generated with

cd etp-backend
clojure -M:dev:coverage

Check dependencies for vulnerabilities

cd etp-backend
./nvd.sh

Check outdated dependencies

cd etp-backend
clojure -M:outdated

Documentation

When the server is running, the API documentation can be found at http://localhost:8080/api/documentation/index.html

MinIO

MinIO is used as a replacement for S3 in local development environment. MinIO Console can be accessed through http://localhost:9001/ (user: minio pw: minio123).

About database usage

There are two users for the database:

  • etp: has all privileges to postgres database.
  • etp_app: can read and write to tables in postgres database.

In production and test environments the postgres database is used normally. It needs to be created during instance setup and migrations are ran as etp user. etp_app user writes and reads data from the tables.

In development environment the postgres database is used as a template that can be used for setting up new databases. The dockerized Postgres sets up a second database etp_dev which should be used locally during development. For convenience, docker directory contains script flyway.sh that can be used for migrating and cleaning both databases with a single call.

Tests will utilize postgres database as template extensively as each test will create their own database from it.

Generating data

Manual performance testing

The function user/generate-energiatodistukset-for-performance-testing! can be used to add multiple signed energiatodistus into the database. For performance testing purpose most strings are just randomly generated and signing the documents is done by just directly inserting signed documents.

For example, to generate 2000 energiatodistus you can run:

(user/generate-energiatodistukset-for-performance-testing! 2000)

Third-party licenses

To generate a site of used licenses:

cd etp-backend
clojure -Spom
# Now add Clojars to repositories in generated pom.xml
mvn project-info-reports:dependencies

Other environments

Uberjars

Both projects contain script build-docker-image.sh which can be used to build the uberjars and related docker containers. The build containers can be executed by running docker run [etp-db or etp-backend].

etp-core's People

Contributors

mattinieminen avatar hkorpi avatar muep avatar juholei avatar solita-tonipu avatar solita-antti-mottonen avatar renovate-bot avatar solita-juhohaa avatar vesalahd avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Riikka Taiminen avatar  avatar  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.