Code Monkey home page Code Monkey logo

frontend's Introduction

Misakey frontend

License AGPLv3

Misakey is the user account solution for people and applications who value privacy and simplicity. And it’s open source.

This project is the frontend repository of Misakey.

You can find more info about Misakey in our website and our about page.

On this README you will only find technical information about the frontend code. For more global information about Misakey, the contribution guide, the community, the licensing philosophy or a more global overview of the project, please go on the README of the backend monorepo.

Overview

This project contains the source code of the Misakey webapp.

The webapp is based on CRA.

How to run it ?

Dependencies

To make the project run, you'll need a working NodeJS environment, we highly recommend LTS version or higher.

You'll probably need a Docker and docker-compose environment.

We use Yarn as our package manager

Webapp

You can create a development docker image with the Dockerfile.dev. It'll start a dev server you can work on.

You can create a production image with the command make build

Dependencies management

To make the CI lighter and don't use too much ressources in our docker images, we're building a base image used by the CI and to build the production image of the app that contains the npm dependencies of the app.

This mean that if you want to add some dependencies to the project you have to update this base image.

Building a new image, with new dependencies

make build-base will build a new image base. Once you tested it locally (with a make build), you can publish it with a make deploy-base.

⚠️ The base is used for your branches and for master branch too (we didn't do a different image per branch for now). This imply two things:

  • You cannot do breaking changes in the image (remove a dependency until your branch is merged)
  • You have to be careful when updating dependencies to publish your new base image not too early, as it may create broken images !
  • You should communicate to the team when you'll deploy a new image, as it may break WIP branches. We need to improve this part of the process when we'll experienced it

Folder architecture

  • /devtools: contains some tools useful for the developers.
  • /helm: contains deployment material
  • /public: contains the public part of the app (html files, static resources, locales for XHR loading)
  • /scripts: contains scripts used by the CI and other tools
  • /src: contains the sources of the app

You'll find a specific README in every important folder.

Documentation

We use Styleguidist for creating a component library documentation.

Misc

Configs

We use React App Rewired to be able to add some config over CRA.

The config for the webapp is config-overrides-application.js. It contains config to make the packages usable in the app directly.

I18N

Locale file organization:

  • in public/locales we have one locale file per workspace (account, admin, auth, citizen, dpo). Those translation files are loaded by XHR request. We did that to optimize the size of loaded locales.
  • in src/constants/locales we have all common locales, they are loaded everywhere in the app.
    • fields: for all fields translations. It only contains translation used by Field component
    • commons: for transversal non component-specific translation (little words, HTTP error codes, inter-workspace infos)
    • components: For components specific translations (drawer, appbar, ...). Only for components that are not workspace specific

Lint and test

# Lint
make lint 

# Tests
make test

Git hook

A pre-commit hook is available to automatically run the linter before any commit (this way we can avoid "lint" commits)

To install it go to the devtools/git folder and run ./pre-commit-install.sh

CI

We had some troubles with the GitlabCI (pipelines that take 30min, many crashes, ...).

Here some info we got to try to make it better:

  • Adding policy to cache, to only push it in first stage and only pull it after
  • Increase yarn timeout, because CI server can be overloaded, so with a reduced bandwidth

Other improvement possibilities for later:

License

The code is published under AGPLv3. More info in the LICENSE file.

Source management disclaimer

Misakey uses GitLab for the development of its free softwares. Our Github repositories are only mirrors. If you want to work with us, fork us on gitlab.com (no registration needed, you can sign in with your Github account)

Cryptography notice

This distribution and associated services include cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

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.