Skip to content

Commit

Permalink
Merge branch 'rc'
Browse files Browse the repository at this point in the history
  • Loading branch information
oxypomme committed Feb 16, 2024
2 parents 5f50c1c + 70d8278 commit 46d559d
Show file tree
Hide file tree
Showing 422 changed files with 119,113 additions and 130 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules/
data/
src/services/metrics/
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ignore file used by VSCode
src/services/report/**/fonts/**/*.js
data/
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
root: true,
env: {
es2021: true,
node: true,
},
extends: ['airbnb-base'],
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
},
};
45 changes: 45 additions & 0 deletions .github/workflows/sdk-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and Deploy SDK documentation

on:
push:
branches:
- master
paths:
- '.github/workflows/sdk-doc.yml'
- 'src/sdk/**'
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Setup Node ⚙️
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies ⚙️
run: npm ci --prefix src/sdk

- name: Build documentation 🔧
run: npm run build:docs --prefix src/sdk

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: src/sdk/docs
branch: sdk-docs
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Custom config

reporting.local.env.sh
*.local.env.sh
data

## Default config (https://github.com/github/gitignore/blob/main/Node.gitignore)
Expand Down Expand Up @@ -134,4 +134,6 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.pnp.*

tests-bak
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/hydrogen
27 changes: 16 additions & 11 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
// ESLint support
"dbaeumer.vscode-eslint",
// npm import autocompletion
"christian-kohler.npm-intellisense",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"christian-kohler.npm-intellisense",
"Orta.vscode-jest",
"streetsidesoftware.code-spell-checker",
"vivaxy.vscode-conventional-commits",
"ms-azuretools.vscode-docker",
"mikestead.dotenv",
"streetsidesoftware.code-spell-checker-french",
"prisma.prisma",
"vue.volar",
"vue.vscode-typescript-vue-plugin"
]
}
31 changes: 31 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"localRoot": "${workspaceFolder}/src/services/mail",
"name": "mail: Debug",
"port": 9231,
"remoteRoot": "/mail",
"request": "attach",
"type": "node"
},
{
"localRoot": "${workspaceFolder}/src/services/report",
"name": "report: Debug",
"port": 9230,
"remoteRoot": "/report",
"request": "attach",
"type": "node"
},
{
"type": "chrome",
"request": "launch",
"name": "vue: chrome",
"url": "http://localhost:6006",
"webRoot": "${workspaceFolder}/src",
},
]
}
33 changes: 28 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
{
"eslint.workingDirectories": [],
"eslint.validate": [
"javascript",
"typescript"
]
"cSpell.words": [
"ezreeport",
"fastify",
"highlightjs",
"prisma",
"stackoverflow",
"Toggleable",
"vega",
"vuedraggable",
"vuetify"
],
"conventionalCommits.scopes": [
"report",
"mail",
"tests",
"sdk",
"vue"
],
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"files.associations": {
".env": "dotenv",
".env.defaults": "dotenv"
},
"typescript.tsdk": "./src/services/report/node_modules/typescript/lib"
}
50 changes: 50 additions & 0 deletions Dockerfile.vuedoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM node:18.17.0-alpine3.18 as sdk-builder

WORKDIR /usr/build/sdk

ENV NODE_ENV=production

RUN apk update \
&& apk upgrade -U -a

COPY ./src/sdk/package*.json ./
RUN npm ci --omit=dev
COPY ./src/sdk ./

RUN npm run build:web && npm run build:types

# ----

FROM node:18.17.0-alpine3.18 as vue-builder
ARG AUTH_TOKEN="changeme"
ARG REPORT_API="http://localhost:8080/"
ARG LOGO_URL="https://ezmesure.couperin.org/"

WORKDIR /usr/build/vue

COPY --from=sdk-builder /usr/build/sdk ../sdk

RUN apk update \
&& apk upgrade -U -a

# We need devDeps as Storybook is in it
COPY ./src/vue/package*.json ./
RUN npm ci
COPY ./src/vue ./

ENV VITE_AUTH_TOKEN=${AUTH_TOKEN} \
VITE_REPORT_API=${REPORT_API} \
VITE_NAMESPACES_LOGO_URL=${LOGO_URL}

RUN npm run build:docs

# ----

FROM nginx:stable-alpine

WORKDIR /usr/share/nginx/html

COPY ./config/vue-ngnix.types /etc/nginx/mime.types
COPY --from=vue-builder /usr/build/vue/storybook-static ./

EXPOSE 80
70 changes: 61 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reporting
# ezReeport

Reporting service for ezMESURE/ezCOUNTER

Expand All @@ -9,16 +9,68 @@ Reporting service for ezMESURE/ezCOUNTER
## Installation

```bash
git clone https://github.com/ezpaarse-project/reporting.git
git clone https://github.com/ezpaarse-project/ezreeport.git
npm run setup
```

## Main branches

- `master`:
- Should be the version used on prod (vp)
- `rc`:
- Should be the version used on integ (vi)
- Versions are suffixed by `-rc`
- `dev`:
- Should be the version used on dev (vd)
- Versions are suffixed by `-beta`

## Services

- src/report:
- Generate PDF reports with HTTP API. Also run cronjob to regullary generate reports
- src/redis:
- Handle email queues
- src/mail:
- `src/services/report`: (ezreeport-report)
- Generate PDF reports with HTTP API. Also run cronjob to generate reports
- `src/services/mail`: (ezreeport-mail)
- Handle email management
- src/db:
- Keeps templates (even custom ones) & scheduled tasks


## Packages

- `src/sdk` (ezreeport-sdk-js)
- SDK for ezReeport API
- `src/vue` (ezreeport-vue)
- Vue components that use SDK for displaying info
- It also contains an example with [Nuxt](https://nuxtjs.org/) at `src/vue/example` (it's not part of the workspace because of webpack issues)

## Start

### Prod

```bash
source ezreeport.env.sh
docker compose -f docker-compose.migrate.yml up -d
docker compose -f docker-compose.yml up -d
```

### Dev

```bash
source ezreeport.env.sh
docker compose -f docker-compose.migrate.yml up -d
docker compose -f docker-compose.yml -f docker-compose.debug.yml up -d
```

## Test

Located at `tests`

```bash
npm test
```

## Publish

```bash
# Test, and build a first time to test
# Generate changelogs, etc. as it will bump version
npm run publish
# Build and push to registries
```
Loading

0 comments on commit 46d559d

Please sign in to comment.