summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-04-14chore: Update digiid-ts dependency and regenerate lockfileHEADmainPawel Zelawski
Updated the 'digiid-ts' package to the latest version to incorporate its internal dependency change (replacing 'digibyte-message' with 'bitcoinjs-message'). Regenerated package-lock.json, which removed the outdated references to 'digibyte-message' and 'bitcore-message'. Verified the build process completes successfully with the updated dependency.
2025-04-11docs: Add live demo link and fix asset trackingPawel Zelawski
- Update README.md to include a new "Live Demo" section linking to https://digi-id.pzelawski.dev/. - Remove the `public` entry from .gitignore to ensure static assets (like the logo) within the public directory are tracked by Git. This resolves issues where assets were missing after cloning the repository for deployment.
2025-04-10chore: switch to NPM dependency for digiid-ts and update docsPawel Zelawski
- Update package.json to use the 'latest' version of 'digiid-ts' from NPM instead of the local file path. - Run 'npm install' to fetch the package from the registry. - Correct the 'dev:backend' and 'dev' scripts in package.json to fix the build process after the dependency update. - Update the repository clone URL in README.md to the correct address.
2025-04-10docs: add comprehensive documentation for Digi-ID demo appPawel Zelawski
- Add detailed README.md with: - Project overview and features - Project structure explanation - Getting started guide - Authentication flow description - Code examples for backend and frontend implementation - Environment configuration details - License and acknowledgments - Include practical code examples for: - Backend Digi-ID authentication endpoints - Frontend authentication flow implementation - Environment configuration setup - Document key features: - Digi-ID authentication protocol - QR code generation - Address verification - Responsive design - TypeScript support - Environment configuration - Add proper links to: - digiid-ts library repository - DigiByte project
2025-04-10fix: resolve TypeScript errors in Express route handlersPawel Zelawski
- 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.
2025-04-10refactor: improve layout and spacing across all viewsPawel Zelawski
- 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
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.
2025-04-10Initial commitPawel Zelawski