<feed xmlns='http://www.w3.org/2005/Atom'>
<title>digiid-ts-demo/src, branch main</title>
<subtitle>[MIRROR] Digi-ID TypeScript Integration Demo</subtitle>
<id>https://git.zelu.dev/digiid-ts-demo/atom?h=main</id>
<link rel='self' href='https://git.zelu.dev/digiid-ts-demo/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/'/>
<updated>2025-04-10T12:39:56Z</updated>
<entry>
<title>fix: resolve TypeScript errors in Express route handlers</title>
<updated>2025-04-10T12:39:56Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-10T12:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/commit/?id=d56c6a52f1dd1e539acd7a9cd45e2d32a2439ce8'/>
<id>urn:sha1:d56c6a52f1dd1e539acd7a9cd45e2d32a2439ce8</id>
<content type='text'>
- Add NextFunction type import from express
- Restructure route handlers to use proper Express middleware pattern
- Wrap async functions in IIFE for proper error handling
- Add proper error handling with next function
- Maintain existing functionality while satisfying TypeScript type system

This fixes TS2769 errors related to route handler type definitions
in /api/digiid/start and /api/digiid/callback endpoints.
</content>
</entry>
<entry>
<title>refactor: improve layout and spacing across all views</title>
<updated>2025-04-10T12:35:56Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-10T12:35:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/commit/?id=d858bd4e0fc7aaba15509a17b35138e843667bc1'/>
<id>urn:sha1:d858bd4e0fc7aaba15509a17b35138e843667bc1</id>
<content type='text'>
- Remove extra space at the top of the page by adjusting body and root styles
- Add consistent 20px top padding to all views through app-container
- Simplify layout structure by removing unnecessary flex containers
- Adjust spacing between elements for better visual hierarchy:
  - Reduce gaps between elements from 1.5rem to 1rem
  - Reduce bottom margin of h1 from 1.5rem to 1rem
  - Remove negative margins and extra padding
- Maintain consistent box dimensions (390px width, 560px height) for all views
- Ensure proper spacing for QR code and other content within views
</content>
</entry>
<entry>
<title>feat: link local digiid-ts library and integrate into backend</title>
<updated>2025-04-10T09:14:05Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-10T09:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/commit/?id=e29a1b9a652fe254d13afef7f5c7a3d7a64b68cc'/>
<id>urn:sha1:e29a1b9a652fe254d13afef7f5c7a3d7a64b68cc</id>
<content type='text'>
- 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)
</content>
</entry>
<entry>
<title>feat(client): implement react frontend application</title>
<updated>2025-04-10T08:55:22Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-10T08:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/commit/?id=c852aa92f84d0c18b1bd7361163498a542461d45'/>
<id>urn:sha1:c852aa92f84d0c18b1bd7361163498a542461d45</id>
<content type='text'>
- 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.
</content>
</entry>
<entry>
<title>feat(server): implement basic backend API</title>
<updated>2025-04-10T08:50:57Z</updated>
<author>
<name>Pawel Zelawski</name>
<email>pawel.zelawski@outlook.com</email>
</author>
<published>2025-04-10T08:50:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zelu.dev/digiid-ts-demo/commit/?id=326caf949ec8622c04b0e3352c5eac5370f161e4'/>
<id>urn:sha1:326caf949ec8622c04b0e3352c5eac5370f161e4</id>
<content type='text'>
- 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).
</content>
</entry>
</feed>
