Giter Site home page Giter Site logo

koddsson / island.is Goto Github PK

View Code? Open in Web Editor NEW

This project forked from island-is/island.is

0.0 1.0 0.0 7.47 MB

Monorepo for Iceland's digital services.

License: MIT License

JavaScript 2.18% TypeScript 96.80% Makefile 0.07% Dockerfile 0.15% HTML 0.06% Shell 0.66% CSS 0.07% SCSS 0.02%

island.is's Introduction

Island

This repository is the center of development for digital government services on island.is. It is managed by the Digital Iceland department inside the Ministry of Finance and Economic Affairs.

These solutions are FOSS and open to contributions, but most development is performed by teams that win tenders to develop new functionality for Digital Iceland.

How to contribute

We are working on documentation and workflows to help external developers understand and run these solutions locally.

For now, we appreciate assistance with security reviews (more eyes = better), documentation and smaller fixes.

Reading material

A good place to start is the Development Handbook.

You can also read up on our development stack and preferred tools:

General

Tool Description
NodeJS scripts and server-side framework
TypeScript programming language
NX monorepo tools and code scaffolding

Frontend

Tool Description
React UI framework
NextJS front-end framework with routing and server side rendering
Treat css-in-js
Storybook develop and document React components in isolation
Apollo Client graphql client
GraphQL Code Generator generate GraphQL clients and types
Cypress automated browser testing tool
MirageJS API mocking for webapps

Backend

Tool Description
NestJS server-side framework for NodeJS
Sequelize database object relational mapper
OpenAPI Generator generate clients and types for OpenAPI APIs

Code Quality

Tool Description
Jest automated testing tool
ESLint code checker
Prettier code formatter

Protocols and specifications

Tool Description
GraphQL api protocol for our frontend projects
OpenAPI specification to describe rest apis
Open ID Connect authentication protocols

Repositories

Tool Description
PostgreSQL SQL database
Contentful headless content management system

Infrastructure

Tool Description
Docker virtual machine containers for continuous integration and deployment
Kubernetes host docker containers in production
Helm kubernetes deployment configuration

Repository structure

The repository is a monorepo that has multiple apps (something that can be built and run) and libraries (which other apps and libraries can depend on).

Our system architecture generally includes frontend projects, a graphql API gateway, and service APIs. Many of these projects are in early development.

Featured projects:

Other projects:

Working in the monorepo

Development server

Run yarn start <project> for a dev server. The app will automatically reload if you change any of the source files.

Build

Run yarn build <project> to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Running unit tests

Run yarn test <project> to execute the unit tests via Jest.

Run yarn affected:test to execute the unit tests affected by a change.

Running end-to-end tests

Run yarn e2e <project>-e2e to execute end-to-end tests via Cypress.

Run yarn affected:e2e to execute the end-to-end tests affected by a change.

Generate a component

Run yarn generate @nrwl/react:component MyComponent --project=island-ui-core to generate a new component in island-ui-core.

Generate an application

Run yarn generate @nrwl/react:app my-app to generate a simple React application.

To get a React application with server-side-rendering, we recommend using Next.JS: yarn generate @nrwl/next:app my-app

To create a service, you can get started with NestJS like this: yarn generate @nrwl/nest:app services/my-service

Generate a library

Run yarn generate @nrwl/react:lib my-lib --linter eslint to generate a React library.

To create a NestJS module: yarn generate @nrwl/node:lib my-lib

To create a JS library that can be used both on the frontend and the backend: yarn generate @nrwl/node:lib my-lib

Libraries are sharable across libraries and applications. They can be imported from @island.is/my-lib.

Applications and libraries can be structured in a hierarchy using subfolders:

yarn generate @nrwl/node:lib common/my-lib

# Imported from '@island.is/common/my-lib'

Migrations

Using the sequelize-cli we support version controlled migrations that keep track of changes to the database.

Generate a migrations

Run yarn nx run <project>:migrate/generate

Migrating

Run yarn nx run <project>:migrate

Generate schema and client types

All api calls should be type checked to backend schemas. When you update an API, you may need to generate schema files:

yarn nx run <project>:generate-schema

And generate client types that depend on the schema:

yarn nx run <project>:codegen

Understand your workspace

Run yarn nx dep-graph to see a diagram of the dependencies of your projects.

Fetch development secrets for your project

Run yarn env-secrets <project> [options]

Example:

yarn env-secrets gjafakort --reset

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.