Coder Social home page Coder Social logo

jaakkokorhonen / kuntalaisaloite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solita/kuntalaisaloite

0.0 2.0 0.0 74.98 MB

Kuntalaisaloite.fi / Invånarinitiativ.fi - www.kuntalaisaloite.fi

License: Apache License 2.0

CSS 9.87% HTML 3.05% JavaScript 28.67% Shell 0.11% Java 44.80% FreeMarker 13.51%

kuntalaisaloite's Introduction

What and why

Kuntalaisaloite.fi / Invånarinitiativ.fi is a web service for launching municipal citizen's initiatives and gathering participants for these initiatives. The web service has been implemented by the Ministry of Justice Finland together with Solita Oy.

Solita Oy is responsible for the future development of the software. Any pull-requests or suggestions for improvement to the source code are considered separately between the Ministry of Justice and Solita Oy. Reports for possible issues in the code might be rewarded by Solita. The Ministry of Justice will handle all the feedback sent to [email protected].

LICENSE

Apache License 2.0, see COPYING and LICENSE

Installation

  • Application is packaged as standalone jar with embedded jetty server. Following command-line parameters must be used when starting the application

    • -Djetty.port
    • -Djetty.thread.pool
    • -Dspring.profiles.active
  • Some dev-related stuff can be enabled via setting spring.profiles.active to 'dev'. Also 'disableSecureCookie' can be used when running application locally or without ssl. Setting profile to 'dev'

    • Enables test-data-generation on path /fi/testdata
    • Enables vetuma-mock-controller which can be used to for fake vetuma logins
  • Setting up database

    • Use muninitdb-xxx.sh to create local test and local production-like PostgreSQL-databases
    • Create production DB in etc-folder using sh ./createdb.sh <locale> <application user password>
    • Note that <locale> is system dependent. In Mac it's fi_FI.utf-8.
    • Script creates municipalityinitiative user with password <application user password>
    • DB-creation-scripts mentioned above are responsible for executing pre-flyway-time migrations to database.
    • For Flyway, Superuser must be created with createuser -s -P flyway_user. Application migrates database on startup if necessary when 'flyway.password' for flyway_user is overriden properly in app.properties
  • Overriding configurations in different environments

    • Default configuration properties are in src/main/resources/default.properties
    • You can override the parameters in different environments by creating config/app.properties with the overriding parameters
    • Logging config can be overriden with config/log4j.properties
    • Override BoneCP configuration by adding your custom bonecp-config.xml into config/bonecp-config.xml
  • Encrypting secret properties with EncryptablePropertiesConfigurer

    • Encryption key must be located as text file in ~/.initpass
    • Encrypt passwords and secrets with maven: mvn exec:java -Dexec.mainClass="fi.om.municipalityinitiative.conf.EncryptablePropertiesConfigurer" -Dexec.args="encrypt <message-to-be-encrypted>"
    • Encrypted values are defined in app.properties like this: property.key = ENC(Okbz86n6+NnffnKmAPhedp8DIi51zSVZa1Jx88ZthVI=) properties will be decrypted runtime when needed via EncryptablePropertiesConfigurer

Development

  • Create local database and flyway-user as told above. Encryptions are optional.

  • Start application with IDE: fi.om.municipalityinitiative.StartJetty#main

  • When DB schema is changed,

    • New sql-increments must be saved in src/main/resources/db/migration. If flyway information is set up correctly to app.properties, application will migrate itself on startup
    • Update Querydsl model by running ExportQTypes (src/test) when changes to schema are made
    • Postgresql enum columns need to be configured in JdbcConfiguration.querydslConfiguration()
    • Querydsl model generated by ExportQTypes is in src/main/java/fi/om/initiative/sql

kuntalaisaloite's People

Contributors

hoxu avatar

Watchers

James Cloos avatar Jaakko Korhonen 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.