-
Notifications
You must be signed in to change notification settings - Fork 3
Draft: move to Prisma ORM #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
HunteRoi
wants to merge
11
commits into
master
Choose a base branch
from
111-change-orm-to-prisma
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bd6d2b3
feat: support prisma
ab44b5c
chore: add Prisma configuration file for database setup
322f51f
refactor(seed): use top-level await
96c5bce
refactor(PostgresDatabaseService): upgrade to ts-postgres v2
1bbf5fc
refactor(PgDatabaseService): remove obsolete PG database service impl…
b5c81ec
ci: move to latest job versions
f1f97b6
chore: upgrade dependencies
0139fc3
docs: add comprehensive documentation for DataDrop architecture and w…
81f200b
feat: configuration management in database with Prisma ORM migration
d0b942a
feat: update Dockerfile and entrypoint script for database migrations…
399d289
feat: integrate Redis for configuration caching and management
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,3 +64,5 @@ typings/ | |
| .idea/ | ||
|
|
||
| build/ | ||
|
|
||
| /generated/prisma | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,22 @@ | ||
| { | ||
| "editor.formatOnSave": true, | ||
| "files.insertFinalNewline": true, | ||
| "javascript.preferences.quoteStyle": "single", | ||
| "typescript.preferences.quoteStyle": "single", | ||
| "javascript.preferences.importModuleSpecifier": "relative", | ||
| "typescript.preferences.importModuleSpecifier": "relative", | ||
| "js/ts.preferences.quoteStyle": "single", | ||
| "js/ts.preferences.importModuleSpecifier": "relative", | ||
| "files.exclude": { | ||
| "node_modules": true | ||
| "**/.git": false, | ||
| "**/.svn": false, | ||
| "**/.hg": false, | ||
| "**/CVS": false, | ||
| "**/.DS_Store": false, | ||
| "**/Thumbs.db": false, | ||
| "node_modules": false, | ||
| "**/.idea": false | ||
| }, | ||
| "npm.packageManager": "yarn", | ||
| "files.eol": "\n", | ||
| "editor.insertSpaces": true, | ||
| "editor.tabSize": 4, | ||
| "typescript.enablePromptUseWorkspaceTsdk": true | ||
| "js/ts.tsdk.promptToUseWorkspaceVersion": true, | ||
| "explorerExclude.backup": {} | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # DataDrop Documentation | ||
|
|
||
| This folder is the project knowledge base for Issue 93 and related implementation work. | ||
|
|
||
| ## What is in here | ||
|
|
||
| - [Issue 93 Specification](specs/issue-93-specification.md) | ||
| - [Architecture](specs/architecture.md) | ||
| - [Membership State Machine](specs/state-machine.md) | ||
| - [BPMN-Style Lifecycle](specs/bpmn-lifecycle.md) | ||
| - [MVP Scope](specs/mvp-scope.md) | ||
| - [Discord API and Discord.js Sources](specs/discord-sources.md) | ||
| - [GitHub Sources](specs/github-sources.md) | ||
| - [Strict Traceability Matrix](specs/traceability-matrix.md) | ||
| - [Roadmap Beyond MVP](specs/non-mvp-roadmap.md) | ||
|
|
||
| ## Visual Assets | ||
|
|
||
| - Feature list snapshot:  | ||
| - Project visual marker:  | ||
|
|
||
| ## Notes | ||
|
|
||
| - Mermaid diagrams are embedded directly in markdown files. | ||
| - Any statement tied to Discord API or Discord.js behavior is sourced in [Discord API and Discord.js Sources](specs/discord-sources.md). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Architecture | ||
|
|
||
| ## Context | ||
|
|
||
| DataDrop has two behavior entrypoints: | ||
|
|
||
| 1. Discord Bot runtime | ||
| 2. Web App + Backend API | ||
|
|
||
| Both must enforce the same business rules and write to the same domain model. | ||
|
|
||
| ## High-Level System Diagram | ||
|
|
||
| ```mermaid | ||
| flowchart LR | ||
| U[User] -->|Discord Client| D[Discord Platform] | ||
| U -->|Browser| W[Web App] | ||
|
|
||
| D -->|Gateway Events| B[DataDrop Bot] | ||
| B -->|Commands, role updates, onboarding checks| D | ||
|
|
||
| W -->|JWT-authenticated calls| A[DataDrop Backend API] | ||
| A --> DB[(PostgreSQL)] | ||
| B --> DB | ||
|
|
||
| DB --> Q[Dead Letter Queue] | ||
| Q --> R[Staff Remediation Panel] | ||
|
|
||
| A --> O[Audit and Security Logs] | ||
| B --> O | ||
| ``` | ||
|
|
||
| ## Tenant and Access Flow | ||
|
|
||
| ```mermaid | ||
| sequenceDiagram | ||
| participant User | ||
| participant Web as Web App | ||
| participant Discord as Discord OAuth API | ||
| participant API as Backend API | ||
| participant DB as PostgreSQL | ||
|
|
||
| User->>Web: Login with Discord | ||
| Web->>Discord: OAuth exchange | ||
| Discord-->>Web: user identity + guild list | ||
| Web->>API: fetch guilds known by DataDrop for user | ||
| API->>DB: read guild memberships and roles | ||
| DB-->>API: guilds from platform scope | ||
| API-->>Web: intersection list for guild selector | ||
| User->>Web: select guild | ||
| Web->>API: request guild context | ||
| API->>DB: action-time authorization check | ||
| DB-->>API: allowed or denied | ||
| API-->>Web: scoped response | ||
| ``` | ||
|
|
||
| ## Cross-Entrypoint Consistency | ||
|
|
||
| Design rule: | ||
|
|
||
| - Bot and API writes use strict optimistic locking | ||
| - Transition preconditions include expected state and expected version | ||
| - Conflict retries are bounded | ||
| - Retry exhaustion creates dead-letter records | ||
|
|
||
| ## Source Notes | ||
|
|
||
| For Discord gateway and member update semantics, see [Discord API and Discord.js Sources](discord-sources.md). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # BPMN-Style Lifecycle Flow | ||
|
|
||
| This document captures the intended operational flow for onboarding, eligibility, rules acceptance, verification, and admin override handling. | ||
|
|
||
| ## Flow Diagram | ||
|
|
||
| ```mermaid | ||
| flowchart TD | ||
| A[Member joins guild] --> B[Discord onboarding starts] | ||
| B --> C{Onboarding completed?} | ||
| C -->|No| B | ||
| C -->|Yes| D[Eligibility evaluation from roles and rules] | ||
|
|
||
| D --> E{Eligible?} | ||
| E -->|No| X[RejectedNotEligible] | ||
| E -->|Yes| F[RulesAccepted] | ||
|
|
||
| F --> G[VerificationPending] | ||
| G --> H{Verification success?} | ||
| H -->|Code verified| I[Verified] | ||
| H -->|Admin implicit verification valid| I | ||
| H -->|Deadline exceeded| J[Kicked or Rejected] | ||
|
|
||
| G --> K{Admin implicit verification request} | ||
| K -->|State != VerificationPending| L[Hard reject override] | ||
| K -->|Email missing| M[Hard fail override] | ||
| K -->|State ok and email present| I | ||
|
|
||
| I --> N{Reverification campaign targeted?} | ||
| N -->|No| O[Remain Verified] | ||
| N -->|Yes| P[Return to VerificationPending] | ||
| ``` | ||
|
|
||
| ## Rule Highlights | ||
|
|
||
| 1. Rules acceptance remains per guild because onboarding is a guild-bound Discord flow. | ||
| 2. Global verification identity does not bypass guild onboarding acceptance. | ||
| 3. Manual implicit verification is constrained to `VerificationPending` and requires email presence. | ||
| 4. Historical override does not provide permanent bypass entitlement in future campaigns. | ||
|
|
||
| ## Discord-Specific Notes | ||
|
|
||
| 1. Member updates are observed through gateway member update events. | ||
| 2. Onboarding and member flags are platform-defined by Discord. | ||
| 3. Membership screening and pending semantics are Discord-defined. | ||
|
|
||
| Reference all platform-specific semantics through [Discord API and Discord.js Sources](discord-sources.md). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pk une matrix de une seul version utilise la LTS