summaryrefslogtreecommitdiff
path: root/package.json
AgeCommit message (Collapse)Author
2025-04-10feat: link local digiid-ts library and integrate into backendPawel Zelawski
- Added local `digiid-ts` library as a file dependency in `package.json`. - Moved runtime dependencies (react, express, etc.) to `dependencies` section. - Updated `src/server/main.ts`: - Imported `generateDigiIDUri`, `verifyDigiIDCallback`, and `DigiIDError` from `digiid-ts`. - Replaced placeholder URI generation with `generateDigiIDUri`. - Replaced placeholder callback verification with `verifyDigiIDCallback`. - Refactored `/api/digiid/callback` handler to use `try...catch` for verification, handling thrown `DigiIDError` on failure as per library design. - Ensured session state is updated and 200 OK response sent in `finally` block. - Cleaned up related placeholder comments in `src/server/main.ts`. - (Requires `npm install` to be run after checkout)
2025-04-10feat(client): implement react frontend applicationPawel Zelawski
- Created main entry point `src/client/main.tsx`. - Created main `App` component `src/client/App.tsx`. - Implemented state management (`initial`, `waiting`, `success`, `failed`) using `useState`. - Implemented `handleStart` to call backend `/api/digiid/start` and transition to `waiting` state. - Implemented `useEffect` hook for polling backend `/api/digiid/status/:sessionId` in `waiting` state. - Updates UI state based on polling response (`success`/`failed`). - Handles polling errors and cleanup. - Implemented `handleReset` to return to `initial` state. - Implemented views for each state: - `initial`: Welcome message, Start button. - `waiting`: QR code display, status message, Cancel button. - `success`: Success message, verified address, address type, Start Over button. - `failed`: Failure message, error details, Try Again button. - Added client-side address type helper `getDigiByteAddressType` in `src/client/utils.ts`. - Added basic CSS styling in `src/client/index.css` with light/dark mode support. - Added frontend-related scripts (`dev:frontend`, `dev`, `build`, `lint`, `preview`) to `package.json`. - Fixed linter type issue with `setInterval` return value.
2025-04-10feat(server): implement basic backend APIPawel Zelawski
- Added basic Express server setup in `src/server/main.ts`. - Configured `dotenv` to load environment variables. - Implemented in-memory storage for session state (pending, success, failed). - Created `/api/digiid/start` endpoint: - Generates session ID and nonce. - Constructs callback URL from `PUBLIC_URL`. - Determines `unsecure` flag based on URL scheme. - Stores initial session state. - Generates QR code data URL. - Returns `sessionId` and `qrCodeDataUrl`. - Includes placeholder for `digiidTs.generateDigiIDUri`. - Created `/api/digiid/callback` endpoint: - Receives address, uri, signature from DigiID app. - Parses nonce from received URI. - Looks up session by nonce. - Reconstructs expected callback URL. - Updates session state based on placeholder verification. - Includes placeholder for `digiidTs.verifyDigiIDCallback`. - Responds 200 OK as per DigiID protocol. - Created `/api/digiid/status/:sessionId` endpoint: - Retrieves and returns session status, address, and error. - Added address type helper `getDigiByteAddressType` in `src/server/utils.ts` (with placeholder logic for DGA). - Added `dev:backend` script to `package.json` using `nodemon` and `ts-node/esm`. - Added `"type": "module"` to `package.json`. - Installed `@types/dotenv`. - (Note: Outstanding TypeScript linter errors related to async Express handlers require further investigation).
2025-04-10feat: setup project structure and toolingPawel Zelawski
- Initialized npm project and added core dependencies (React, Express, etc.). - Added development dependencies (TypeScript, Vite, ESLint, Prettier, etc.). - Configured TypeScript (`tsconfig.json`). - Configured Vite (`vite.config.ts`) with React plugin and API proxy. - Configured ESLint (`.eslintrc.cjs`) and Prettier (`.prettierrc.cjs`, `.prettierignore`). - Added standard `.gitignore`. - Created basic project structure (`src/client`, `src/server`, `public`). - Created default `.env` file (PORT=3001, PUBLIC_URL=http://localhost:3001).
2025-04-10feat: initialize project and add core dependenciesPawel Zelawski
- Initialized npm project with `npm init -y`. - Added core dependencies: react, react-dom, express, dotenv, qrcode.