Skip to content

Commit

Permalink
Add docs (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens authored Apr 16, 2024
1 parent 8149815 commit 636e29c
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 13 deletions.
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# Meldingen frontend
# Meldingen front-end

## Getting started
Hi and welcome to the Meldingen front-end repository!

This monorepo houses three separate front-ends:

- Public: where the general public can create and view nuisance reports.
- Backoffice: where professionals can handle these reports.
- Admin: where admins can manage the Public and Backoffice apps.

### Install
[Read the docs](./docs/README.md) for more information on the project architecture and plug-in choices.

## Getting started

`npm install`
- Install all dependencies with `npm install`
- Start all applications in development mode with `npm run dev`
- Build all applications for production using `npm run build`

### Start all applications in development mode
## Code of Conduct

`npm run dev`
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
Read [our Code of Conduct](https://github.com/Amsterdam/.github/blob/main/CODE_OF_CONDUCT.md) if you haven’t already.

### Build all applications for production
## License

`npm run build`
This project is free and open-source software licensed under the
[European Union Public License (EUPL) v1.2](LICENSE.md) or higher.
Documentation is licensed as [Creative Commons Zero 1.0 Universal (`CC0-1.0`)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).
14 changes: 14 additions & 0 deletions apps/admin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Admin

The Admin application allows admins to manage the Public and Backoffice apps.

It allows an admin to...

- ... change the texts of the main form,
- ... build surveys for additional questions,
- ... create categories and assign these categories to surveys,
- ... create and change e-mail templates.

## Getting started

Run `npm run dev:admin` in the root directory to start the Admin app.
17 changes: 17 additions & 0 deletions apps/public/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Public

The Public application allows the general public to create nuisance reports.

This is the general flow of the app:

```mermaid
graph LR
MF["Main form"] --> ML["Text recognition algorithm"]
ML --> AQ["Additional questions"]
AQ --> CF["Contact form"]
CF --> SM["Summary"]
```

## Getting started

Run `npm run dev:public` in the root directory to start the Public app.
2 changes: 1 addition & 1 deletion docs/0001-library-and-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Next.js takes care of the heavy lifting with regards to routing, data fetching,

Our Admin app is a completely client side app, which makes Next.js an unlikely choice.
The reason we've chosen Next.js for that app as well is because it works well with [NextAuth.js](https://next-auth.js.org/).
This way, we can keep our authentication the same for all our apps.
This way, we can keep our [authentication](./0008-authentication.md) the same for all our apps.
NextAuth.js is planning to remove their dependency on Next.js.
When that is stable, we will reconsider this decision.

Expand Down
10 changes: 10 additions & 0 deletions docs/0007-forms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Forms

Meldingen revolves for a large part around forms.
Our Admin app allows admins to create and update forms, which are shown in our Public and Backoffice apps.

To make dealing with forms easier, we use [Form.io](https://form.io/).
Form.io allows us to easily build forms, using the included [Builder](https://help.form.io/developers/form-development/form-builder),
and render and validate them on the client side, using the included [Renderer](https://help.form.io/developers/form-development/form-renderer).

Form.io uses a relatively simple JSON schema, which our back-end can also use.
17 changes: 17 additions & 0 deletions docs/0008-authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Authentication

Both our Admin and Backoffice apps require that you log in before you can use them.
To facilitate this, we use [NextAuth.js](https://next-auth.js.org/).

NextAuth.js is free and open source, and it has support for several popular authentication services.
This makes it a good choice for use in an open source application which is used by other municipalities.

We intend to implement NextAuth.js in a way that’s configurable,
so other municipalities can use their own authentication service(s).

The base implementation uses [Keycloak](https://www.keycloak.org/).

NextAuth.js is specifically intended for use with [Next.js](https://nextjs.org/),
which means the Admin and Backoffice apps have to use Next.js as well.
NextAuth.js intends to move towards a generic solution, [Auth.js](https://authjs.dev/).
When that project is stable and mature enough, we can consider migrating to it.
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Meldingen is an application with three separate front-ends:

- Public: where the general public can create notifications.
- Backoffice: where professionals can handle these notifications.
- Public: where the general public can create nuisance reports.
- Backoffice: where professionals can handle these reports.
- Admin: where admins can manage the Public and Backoffice apps.

```mermaid
Expand Down Expand Up @@ -48,5 +48,5 @@ graph TD
4. [Styling](./0004-styling.md)
5. [Linting](./0005-linting.md)
6. [Monorepo tooling](./0006-monorepo-tooling.md)
7. Forms
8. Authentication
7. [Forms](./0007-forms.md)
8. [Authentication](./0008-authentication.md)

0 comments on commit 636e29c

Please sign in to comment.