The official repository for Kirameki - a Japanese cultural experience initiative based in Hiroshima, Japan.
- Clone the repository
- Install dependencies:
npm install - Start the development server:
npm run dev
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:authThis will:
- Create or update your
.env.localfile with the correctNEXT_PUBLIC_AUTH_REDIRECT_URL - Restart your development server if needed
For more detailed instructions, see Authentication Development Setup.
npm run dev- Start the development servernpm run build- Build the production versionnpm run start- Start the production servernpm run lint- Run linting checksnpm run setup:auth- Configure auth for local developmentnpm run prisma:generate- Generate Prisma clientnpm run prisma:migrate- Run database migrationsnpm run prisma:studio- Open Prisma Studionpm run test- Run all testsnpm run test:unit- Run unit testsnpm run test:integration- Run integration testsnpm run test:e2e- Run E2E tests
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
/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
- Create a feature branch from
main - Make your changes
- Run tests:
npm run test - Submit a pull request
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.
- 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
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
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.comUnit tests for the monitoring system are located in __tests__/unit/services/monitoring.test.ts. Run tests with:
npm test -- --testPathPattern=monitoring