Skip to content

KippuRocks/saifu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

70 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Saifu (่ฒกๅธƒ, lit. wallet)

Next.js React TypeScript Material-UI

Saifu is a modern digital wallet application for managing event tickets with blockchain integration. It allows users to collect, transfer, and access tickets through QR codes while providing a seamless authentication experience using WebAuthn technology.

โœจ Features

๐Ÿ” Secure Authentication

  • WebAuthn Integration: Modern, passwordless authentication
  • Biometric Support: Fingerprint and face recognition ready
  • Virto Signer Compatible: Ready for blockchain ecosystem integration
  • Multi-language Support: English and Spanish localization

๐ŸŽซ Ticket Management

  • Digital Ticket Collection: Store and organize event tickets
  • QR Code Access: Generate and scan QR codes for event entry
  • Ticket Transfer: Send tickets to other users securely
  • Event Overview: Track upcoming and past events

๐ŸŒ Modern UI/UX

  • Material Design: Clean, intuitive interface with Material-UI
  • Responsive Design: Works seamlessly across desktop and mobile
  • Dark/Light Theme: Automatic theme switching
  • Real-time Updates: Live data synchronization

๐Ÿ”— Blockchain Integration

  • Wallet Functionality: Built on blockchain principles
  • Cryptographic Security: Enhanced security through cryptography
  • Decentralized Ready: Prepared for Web3 integration

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18.0 or higher
  • Yarn package manager
  • Modern Browser with WebAuthn support (Chrome, Firefox, Safari, Edge)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd saifu
  2. Install dependencies

    yarn install
  3. Run the development server

    yarn dev
  4. Open your browser Navigate to http://localhost:3000

Available Scripts

  • yarn dev - Start development server with Turbopack
  • yarn build - Build the application for production
  • yarn start - Start production server
  • yarn lint - Run ESLint for code quality

๐Ÿ—๏ธ Project Structure

saifu/
โ”œโ”€โ”€ app/                          # Next.js App Router
โ”‚   โ”œโ”€โ”€ (authenticated)/          # Protected routes
โ”‚   โ”‚   โ”œโ”€โ”€ events/              # Event management
โ”‚   โ”‚   โ””โ”€โ”€ tickets/             # Ticket management
โ”‚   โ”œโ”€โ”€ (public)/                # Public routes
โ”‚   โ”‚   โ””โ”€โ”€ page.tsx             # Login page
โ”‚   โ”œโ”€โ”€ api/                     # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ auth/                # Authentication endpoints
โ”‚   โ”‚   โ””โ”€โ”€ credentials/         # Credential management
โ”‚   โ”œโ”€โ”€ _components/             # Shared components
โ”‚   โ”‚   โ”œโ”€โ”€ Auth/               # Authentication components
โ”‚   โ”‚   โ”œโ”€โ”€ Events/             # Event-related components
โ”‚   โ”‚   โ”œโ”€โ”€ Layout/             # Layout components
โ”‚   โ”‚   โ”œโ”€โ”€ MarkdownRender/     # Markdown rendering
โ”‚   โ”‚   โ””โ”€โ”€ Tickets/            # Ticket components
โ”‚   โ”œโ”€โ”€ hooks/                  # Custom React hooks
โ”‚   โ”œโ”€โ”€ i18n/                   # Internationalization
โ”‚   โ”œโ”€โ”€ lib/                    # Utility libraries
โ”‚   โ”‚   โ””โ”€โ”€ webauthn/           # WebAuthn implementation
โ”‚   โ””โ”€โ”€ providers/              # React providers
โ”œโ”€โ”€ packages/                   # Shared packages
โ”‚   โ”œโ”€โ”€ ui/                     # Custom UI components
โ”‚   โ””โ”€โ”€ arraybuffer-base64/     # ArrayBuffer utilities
โ”œโ”€โ”€ public/                     # Static assets
โ””โ”€โ”€ data/                       # Data files

๐Ÿ”ง Technology Stack

Core Technologies

  • Next.js 15 - React framework with App Router
  • React 19 - UI library with concurrent features
  • TypeScript 5.3 - Type-safe JavaScript
  • Material-UI 7.2 - Component library and design system

Authentication & Security

  • WebAuthn - Modern authentication standard
  • Virto Signer - Blockchain signing integration

UI & Styling

  • Material-UI Components - Pre-built UI components
  • @emotion/react & @emotion/styled - CSS-in-JS styling
  • @fontsource/roboto - Google Fonts integration

Data & Internationalization

  • next-intl 4.3 - Internationalization framework
  • marked-react - Markdown rendering
  • libphonenumber-js - Phone number validation

Development Tools

  • ESLint - Code linting
  • Turbopack - Next.js bundling optimization
  • Turbo Generators - Code generation tools

๐Ÿงช Testing

Mock Users

The application includes pre-configured test users:

  • Username: alice - Demo user with sample tickets
  • Username: bob - Another demo user for testing transfers

Authentication Flow

  1. Visit the login page at /
  2. Enter a username (e.g., alice or bob)
  3. Complete WebAuthn authentication
  4. Access the authenticated dashboard

Features to Test

  • โœ… User registration with new accounts
  • โœ… Login with existing users
  • โœ… Event browsing and ticket viewing
  • โœ… QR code generation for tickets
  • โœ… Ticket transfer functionality
  • โœ… Multi-language switching
  • โœ… Theme switching (light/dark)

๐ŸŒ Internationalization

The application supports multiple languages:

  • English (en) - Default language
  • Spanish (es) - Complete Spanish translation

Adding New Languages

  1. Create a new file in app/i18n/messages/[locale].json
  2. Copy the structure from en.json
  3. Translate all strings
  4. Update the configuration to include the new locale

๐Ÿ” Security Features

WebAuthn Implementation

  • Mock Implementation: Fully functional with realistic data
  • Production Ready: Easy migration to real WebAuthn
  • Blockchain Compatible: Works with Virto Signer ecosystem

Security Best Practices

  • Type Safety: Full TypeScript coverage
  • Input Validation: Comprehensive form validation
  • Error Handling: Graceful error management
  • Session Management: Secure client-side sessions

๐Ÿš€ Deployment

Vercel (Recommended)

The easiest way to deploy is using Vercel:

  1. Push your code to GitHub
  2. Import your repository in Vercel
  3. Deploy automatically with optimal settings

Other Platforms

The application can be deployed on any platform that supports Next.js:

  • Netlify - Static site hosting
  • AWS Amplify - Full-stack deployment
  • Digital Ocean - VPS deployment
  • Railway - Simple deployment platform

Environment Variables

No environment variables are required for basic functionality. The application uses mock data for development.

๐Ÿค Contributing

We welcome contributions! Please see our contributing guidelines:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes with proper TypeScript types
  4. Add tests for new functionality
  5. Run linting: yarn lint
  6. Commit your changes: git commit -m 'Add amazing feature'
  7. Push to branch: git push origin feature/amazing-feature
  8. Open a Pull Request

Development Guidelines

  • Follow the existing code style and patterns
  • Add TypeScript types for all new code
  • Include comprehensive error handling
  • Write meaningful commit messages
  • Update documentation as needed

๐Ÿ“ API Documentation

Authentication Endpoints

POST /api/auth/register

Register a new user account.

Request Body:

{
  "username": "string",
  "displayName": "string",
  "email": "string (optional)",
  "firstName": "string (optional)",
  "lastName": "string (optional)"
}

Response:

{
  "success": true,
  "user": {
    "username": "string",
    "displayName": "string",
    "credentials": [...]
  }
}

GET /api/credentials?username={username}

Retrieve user credentials for authentication.

Query Parameters:

  • username - The username to fetch credentials for

Response:

{
  "credentials": [...],
  "challenge": "string",
  "rpId": "string",
  "origin": "string"
}

๐Ÿ”ฎ Roadmap

Phase 1: Current Features โœ…

  • WebAuthn authentication (mock)
  • Basic ticket management
  • QR code generation
  • Multi-language support
  • Material-UI integration

Phase 2: Enhanced Features ๐Ÿ”„

  • Real WebAuthn integration
  • Blockchain registration
  • Advanced ticket trading
  • Mobile app development
  • Advanced analytics

Phase 3: Ecosystem Integration ๐ŸŒŸ

  • Virto Signer integration
  • Cross-platform compatibility
  • Advanced security features
  • Enterprise features
  • Community governance

๐Ÿ“„ License

This project is private and proprietary. All rights reserved.

๐Ÿ‘ฅ Team

Built with โค๏ธ by the Kippu team

  • Development: Modern React/Next.js best practices
  • Design: Material Design principles
  • Security: WebAuthn and blockchain standards
  • Performance: Optimized with Turbopack and best practices

๐Ÿ“ž Support

For support and questions:

  • Documentation: Check the inline code documentation
  • Issues: Report bugs and feature requests
  • Discussions: Join our community discussions

Saifu - Your secure, modern digital ticket wallet ๐Ÿ—‚๏ธโœจ

About

Web2 Implementation of Kippu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors