https://github.com/inseefr/drama-queen
https://github.com/inseefr/drama-queen
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/inseefr/drama-queen
- Owner: InseeFr
- License: mit
- Created: 2023-04-11T08:48:26.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-30T12:54:41.000Z (2 months ago)
- Last Synced: 2026-03-30T14:39:11.391Z (2 months ago)
- Language: TypeScript
- Homepage: https://inseefr.github.io/Drama-Queen/
- Size: 6.86 MB
- Stars: 1
- Watchers: 7
- Forks: 2
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Drama Queen
[](https://sonarcloud.io/dashboard?id=InseeFr_Drama-Queen)
[](https://sonarcloud.io/dashboard?id=InseeFr_Drama-Queen)
[](https://sonarcloud.io/dashboard?id=InseeFr_Drama-Queen)
[](https://sonarcloud.io/dashboard?id=InseeFr_Drama-Queen)
Web application for the management of questionnaires powered by Lunatic (https://github.com/InseeFr/Lunatic).
[**Documentation de Drama-Queen**](https://inseefr.github.io/Drama-Queen/)
## Getting Started
```
pnpm install
pnpm run dev
pnpm run build
```
## Architecture explained
Drama Queen use the clean architecture to create a new feature add a new use case.
This is the minimal structure to make a useCase work. Feel free to split into multiple file if your use case becomes too big.
```ts
import { createSelector, createUsecaseActions } from 'redux-clean-architecture'
import { id } from 'tsafe/id'
import type { State as RootState, Thunks } from '@/core/bootstrap'
const state = (state: RootState) => state[name]
export const name = 'usecase-name'
export type State = {
count: number
}
export const { reducer, actions } = createUsecaseActions({
name,
initialState: id({
counter: 0,
}),
reducers: {
increment: (state, { payload }: { payload: number }) => {
state.count = state.count + payload
},
reset: (state) => {
state.count = 0
},
},
})
export const thunks = {
setTo:
(params: { n: number }) =>
async (...args) => {
const [dispatch, getState, context] = args
dispatch(actions.reset())
dispatch(actions.increment(n))
},
} satisfies Thunks
export const selectors = {
count: createSelector(state, (state: State) => state.count),
}
```