Skip to content

Ridou/Kirameki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kirameki Website

The official repository for Kirameki - a Japanese cultural experience initiative based in Hiroshima, Japan.

Quick Start

  1. Clone the repository
  2. Install dependencies: npm install
  3. Start the development server: npm run dev

Authentication Setup for Local Development

When testing authentication features locally, you need to configure the redirect URLs to use your localhost instead of the production domain.

Run the provided setup script:

npm run setup:auth

This will:

  1. Create or update your .env.local file with the correct NEXT_PUBLIC_AUTH_REDIRECT_URL
  2. Restart your development server if needed

For more detailed instructions, see Authentication Development Setup.

Available Scripts

  • npm run dev - Start the development server
  • npm run build - Build the production version
  • npm run start - Start the production server
  • npm run lint - Run linting checks
  • npm run setup:auth - Configure auth for local development
  • npm run prisma:generate - Generate Prisma client
  • npm run prisma:migrate - Run database migrations
  • npm run prisma:studio - Open Prisma Studio
  • npm run test - Run all tests
  • npm run test:unit - Run unit tests
  • npm run test:integration - Run integration tests
  • npm run test:e2e - Run E2E tests

Environment Variables

The following environment variables are required for the application to function correctly:

# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key

# Auth Configuration (for local development)
NEXT_PUBLIC_AUTH_REDIRECT_URL=http://localhost:3001/auth/callback

# Sentry Error Tracking
NEXT_PUBLIC_SENTRY_DSN=your-sentry-dsn

# Slack Notifications
SLACK_WEBHOOK_URL=your-slack-webhook-url

# Email Alerts
EMAIL_SERVER_HOST=smtp.example.com
EMAIL_SERVER_PORT=587
EMAIL_SERVER_SECURE=false
EMAIL_SERVER_USER=your-email-user
EMAIL_SERVER_PASSWORD=your-email-password
EMAIL_FROM=Kirameki <noreply@kirameki.earth>
ADMIN_EMAIL=admin@example.com

Project Structure

  • /src - Application source code
    • /app - Next.js app router pages
    • /components - React components
    • /contexts - React context providers
    • /lib - Utility functions and services
    • /features - Feature-specific components and logic
    • /types - TypeScript type definitions
  • /scripts - Utility scripts
  • /docs - Documentation
  • /public - Static assets
  • /prisma - Database schema and migrations

Contributing

  1. Create a feature branch from main
  2. Make your changes
  3. Run tests: npm run test
  4. Submit a pull request

Enhanced Monitoring & Alerting System

The Kirameki payment platform includes a comprehensive monitoring and alerting system to help track payment events, detect failures, and notify team members of important issues.

Key Features

  • Event Monitoring: Tracks various payment events including successes, failures, webhooks, refunds, and Konbini payment expirations
  • Multiple Severity Levels: Categorizes events by severity (INFO, WARNING, ERROR, CRITICAL)
  • Multi-Channel Alerting: Sends alerts through multiple channels:
    • Database logging (for admin dashboard)
    • Console logs (for development)
    • Email notifications (for team and customers)
    • Slack notifications (for team awareness)
    • Sentry error tracking (for error management)
  • Webhook Health Tracking: Monitors webhook delivery success rates and failures
  • Konbini Expiration Management: Automatically tracks and updates Konbini payments approaching their 72-hour expiration window

Admin Dashboard

The monitoring dashboard is available to administrators at /admin/monitoring and provides:

  • Webhook health metrics including success rates by provider
  • Recent alerts with severity indicators
  • Manual monitoring action buttons
  • Detailed alert history

Configuration

You'll need to set the following environment variables:

# Sentry Error Tracking
NEXT_PUBLIC_SENTRY_DSN=your-sentry-dsn

# Slack Notifications
SLACK_WEBHOOK_URL=your-slack-webhook-url

# Email Alerts
EMAIL_SERVER_HOST=smtp.example.com
EMAIL_SERVER_PORT=587
EMAIL_SERVER_SECURE=false
EMAIL_SERVER_USER=your-email-user
EMAIL_SERVER_PASSWORD=your-email-password
EMAIL_FROM=Kirameki <noreply@kirameki.earth>
ADMIN_EMAIL=admin@example.com

Testing

Unit tests for the monitoring system are located in __tests__/unit/services/monitoring.test.ts. Run tests with:

npm test -- --testPathPattern=monitoring

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors