Skip to content

Commit

Permalink
feat: add docker container for docs
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
cre8 committed Jun 13, 2024
1 parent e3a1435 commit 2c75f15
Show file tree
Hide file tree
Showing 27 changed files with 237 additions and 61 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/page.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CD

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
main:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs build

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
run: |
docker build -f docs/Dockerfile -t ghcr.io/$GITHUB_REPOSITORY/docs .
docker push ghcr.io/$GITHUB_REPOSITORY/docs:latest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist
tmp
/out-tsc
.env
site

# dependencies
node_modules
Expand Down
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"cSpell.words": ["keycloak", "siop", "sphereon"]
"cSpell.words": ["keycloak", "siop", "sphereon"],

"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
},
"yaml.customTags": [
"!ENV scalar",
"!ENV sequence",
"!relative scalar",
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
]
}
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @cre8 @mustafasalfiti
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
credhub.eu
12 changes: 12 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM docker.io/nginx:stable-alpine
COPY site/* /usr/share/nginx/html/
# RUN echo "server {" > /etc/nginx/conf.d/default.conf && \
# echo " listen 80;" >> /etc/nginx/conf.d/default.conf && \
# echo " location / {" >> /etc/nginx/conf.d/default.conf && \
# echo " root /usr/share/nginx/html;" >> /etc/nginx/conf.d/default.conf && \
# echo " index index.html index.htm;" >> /etc/nginx/conf.d/default.conf && \
# echo " try_files \$uri \$uri/ /index.html =404;" >> /etc/nginx/conf.d/default.conf && \
# echo " }" >> /etc/nginx/conf.d/default.conf && \
# echo "}" >> /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Empty file added docs/apps/demo/index.md
Empty file.
Empty file added docs/apps/holder/holder-app.md
Empty file.
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions docs/repo-strucutre.md → docs/apps/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Repo structure

The repository is structured as follows:

- `.github` includes specific GitHub actions workflows.
- `.vscode` includes specific settings for Visual Studio Code.
- `apps` includes all applications.
Expand All @@ -16,3 +17,14 @@ To watch the code dependency between the apps and libs, you can use the followin
```bash
npx nx graph
```


## Apps connection
![Overview](https://www.mermaidchart.com/raw/832e87e0-a10e-40b3-b103-ed79ad860b6e?theme=light&version=v0.1&format=svg)

## Issuance flow

![Issuance process](https://www.mermaidchart.com/raw/36b70fe7-7b53-448a-8f65-2f29b1c515af?theme=light&version=v0.1&format=svg)

## Presentation flow
![Presentation flow](https://www.mermaidchart.com/raw/fd2e141e-9a29-43ee-b16f-2bafc701bbb0?theme=light&version=v0.1&format=svg)
File renamed without changes.
Empty file.
File renamed without changes.
Empty file.
Binary file added docs/assets/project-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/community/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Contributions are always welcome. When opening a pull request, please make sure it is signed and explain the changes you made. In case you want to discuss about a new feature/change, open an issue and we can discuss it there.
9 changes: 9 additions & 0 deletions docs/credential-profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Credential Profile
The following algorithms were chosen. Instead of supporting as much as possible, we decided to focus on the architecture reference framework to be aligned with the EUDI Wallet projects.

- Issuance and Presentation protocol: [Oid4vc](https://openid.net/sg/openid4vc/) for issuing and presenting credentials
- credential format: [SD-JWT-VC](https://www.ietf.org/archive/id/draft-ietf-oauth-sd-jwt-vc-03.html)
- Signing algorithm: P-256
- Key management holder: Json Web Key, cnf binding
- Key management issuer: [JWT Issuer Metadata](https://www.ietf.org/archive/id/draft-ietf-oauth-sd-jwt-vc-03.html#name-jwt-vc-issuer-metadata), X509 and DID will come soon
- Status Management: [Token Status List](https://drafts.oauth.net/draft-ietf-oauth-status-list/draft-ietf-oauth-status-list.html)
60 changes: 0 additions & 60 deletions docs/development.md

This file was deleted.

5 changes: 5 additions & 0 deletions docs/getting-started/development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To install all dependencies, run `pnpm install` in the root folder.

Each app has its own `package.json` with specific jobs. In the root folder is one `package.json` with global jobs like `build`, `clean` and `lint`.

The command `pnpm run -r init` will generate `.env` files for each app based on the example file. Applications inside the `apps` folder will not use the `.env` file in the root folder, this is only for the docker-compose setup. Instead use the `.env` files in the apps folder. In case it's an angular application, use the config file in the `assets/config` folder.
File renamed without changes.
Empty file added docs/getting-started/index.md
Empty file.
5 changes: 5 additions & 0 deletions docs/getting-started/prerequisites.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- node v20 (https://nodejs.org/en/download/package-manager)
- pnpm v8 (v9 has some issues with the nx workspace)
- editor [plugin for nx](https://nx.dev/getting-started/editor-setup) (optional)

For an easy development setup, it is recommend to use vscode with the nx plugin to start tasks like building, testing and linting or to generate new code. You can also use Webstorm with the nx plugin, [see here](https://nx.dev/getting-started/editor-setup#official-integrations).
7 changes: 7 additions & 0 deletions docs/getting-started/tech-stack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Typescript as programming language: large community and good support for wallet related libraries. Of course it does not perform as good as Rust, but it's easier to write and maintain for the current state of the project. It is possible to write different parts of the project in Rust or any other language later on.

Angular as frontend framework: All frontend applications are written in Angular. There was no intention to build a react native application so far, but it is possible to do so. Since the client is primarily job is to render information and not to execute business actions, other clients like a react native app, vanilla js or even a flutter app can be implemented.

Nestjs as backend framework: Nestjs is one of the popular frameworks for nodejs. The build in database connection, the openAPI support and the easy validation of incoming requests are the main reasons to use it. It is also possible to write the backend in Rust or any other language later on.

NX as monorepo manager: NX is a great tool to manage a monorepo. It is possible to share code between the applications and to define the jobs for building, testing and linting in one place. It is also possible to define the dependencies between the applications and to run the jobs in the right order.
6 changes: 6 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CredHub

CredHub is comprehensive monorepo including a cloud wallet for natural persons together with a minimal issuer and verifier service. The cloud wallet will host all credentials and key pairs, including the business logic to receive and present credentials.

# License
This project is licensed under the Apache 2.0 License
6 changes: 6 additions & 0 deletions docs/intention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Intention

## Why a cloud wallet
A cloud wallet is able to move the whole complexity of the SSI algorithms to the server side, so the clients only need to render the data. This makes the development of new clients or integration into existing applications much easier. It also provides an equal security level for all users and does not exclude any smartphones because of their hardware capabilities. Besides that it allows the user to access his credentials from multiple devices without the need to sync them.

Of course the user is losing offline capabilities and has to trust the server to not misuse personal data. But this is a tradeoff that can be acceptable for many use cases when you want to start with verifiable credentials with great user experience and low development effort.
112 changes: 112 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
site_name: Credhub
repo_name: openwallet-foundation-labs/credhub
repo_url: https://github.com/openwallet-foundation-labs/credhub
edit_uri: edit/main/docs
copyright: "Copyright &copy; OpenWallet Foundation<br/>License: CC BY 4.0"
theme:
name: material
logo: assets/project-logo.png
favicon: assets/project-logo.png
icon:
repo: fontawesome/brands/github
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
features:
- content.code.copy
- content.action.view
- navigation.expand
- navigation.footer
- navigation.indexes
- navigation.instant
- navigation.instant.prefetch
- navigation.path
- navigation.sections
- navigation.tabs
- navigation.tabs.sticky
- navigation.top
- navigation.tracking
- search.highlight
- search.suggest
- toc.follow
extra:
social:
- icon: fontawesome/brands/discord
link: https://discord.com/channels/1022962884864643214/1245393681901686913
markdown_extensions:
- abbr
- admonition
- attr_list
- def_list
- footnotes
- md_in_html
- toc:
permalink: true
toc_depth: 3
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:material.extensions.emoji.twemoji
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.magiclink:
repo_url_shorthand: true
user: squidfunk
repo: mkdocs-material
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
nav:
- Home:
- Home: index.md
- Intention of this project: intention.md
- Credential Profile: credential-profile.md
- Getting Started:
- Getting Started: getting-started/index.md
- Prerequisites: getting-started/prerequisites.md
- Tech Stack: getting-started/tech-stack.md
- Development: getting-started/development.md
- Docker: getting-started/docker.md
- Apps:
- apps/index.md
- Holder:
- App: apps/holder/holder-app.md
- Browser-Extension: apps/holder/holder-browser-extension.md
- Backend: apps/holder/holder-backend.md
- Issuer:
- Frontend: apps/issuer/issuer-frontend.md
- Backend: apps/issuer/issuer-backend.md
- Verifier:
- Frontend: apps/verifier/verifier-frontend.md
- Backend: apps/verifier/verifier-backend.md
- Demo:
- Demo: apps/demo/index.md
- Community:
- Contributing: community/contributing.md

0 comments on commit 2c75f15

Please sign in to comment.