A React TypeScript frontend application for authentication and context management with Calimero Network integration.
- 🔐 Authentication System - User login frontend logic implementation
- 🎛️ Context Management - Create and/or select contexts
- 🛡️ Permissions Management - Handle user permissions and access control
- Frontend: React 19, TypeScript
- Build Tool: Vite
- Styling: Emotion, Styled Components
- Package Manager: pnpm
- Routing: React Router DOM
- Node.js (v18 or higher)
- pnpm
- Clone the repository:
git clone <repository-url>
cd auth-frontend- Install dependencies:
pnpm installStart the development server:
pnpm devThe application will be available at http://localhost:5173
Create a production build:
pnpm buildPreview the production build:
pnpm previewsrc/
├── components/
│ ├── auth/ # Authentication components
│ ├── common/ # Shared UI components
│ ├── context/ # Context management
│ ├── permissions/ # Permission handling
│ ├── providers/ # Provider selection
│ └── session/ # Session management
├── hooks/ # Custom React hooks
├── theme/ # Styling and theme configuration
└── utils/ # Utility functions
- LoginView: User authentication interface
- SessionPrompt: Session management prompts
- ContextSelector: Interface for selecting contexts
- useContextCreation: Hook for creating new contexts
- useContextSelection: Hook for context selection logic
- PermissionsView: User permissions management interface
- ProviderSelector: Interface for choosing authentication providers
- @calimero-network/calimero-client: Calimero Network integration
- @near-wallet-selector: NEAR wallet connection and management
- near-api-js: NEAR Protocol JavaScript API
- react-router-dom: Client-side routing
- @emotion/react & @emotion/styled: CSS-in-JS styling
- styled-components: Component styling
The auth service supports package-based application resolution using the Calimero registry.
https://auth.calimero.network/auth/login?
package-name=network.calimero.meropass&
package-version=1.0.0&
callback-url=https://app.example.com/callback&
permissions=context:execute,application
https://auth.calimero.network/auth/login?
manifest-url=http://localhost:8082/apps/network.calimero.meropass/1.0.0&
callback-url=https://app.example.com/callback&
permissions=context:execute,application
https://auth.calimero.network/auth/login?
application-id=4WEikdan9yeaDTADsS1uGzGasiVuJDQcozJbogEyTYcy&
callback-url=https://app.example.com/callback&
permissions=context:execute,application
Create a .env file for configuration:
# Registry URL (defaults to http://localhost:8082)
VITE_REGISTRY_URL=http://localhost:8082
# For official registry (future):
# VITE_REGISTRY_URL=https://registry.calimero.network- Client redirects to auth service with
package-nameparameter - Auth service fetches manifest from registry
- Auth service checks if app is installed on node
- If not installed, downloads WASM from manifest's artifact URL
- Node installs application with package metadata
- Auth service creates JWT with resolved application ID
- User is redirected back with access token
The auth service processes manifests with these fields:
- ManifestProcessor: Fetches manifest from registry by package name
- PackageInstallFlow: Handles installation from registry artifact URL
See PACKAGE_NAMING.md for complete documentation.
This application uses modern JavaScript features and supports:
- Chrome/Edge (last 2 versions)
- Firefox (last 2 versions)
- Safari (last 2 versions)