Consolidate docs and finalize APK companion updates
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. You can also check out [Laravel Learn](https://laravel.com/learn), where you will be guided through building a modern Laravel application.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Redberry](https://redberry.international/laravel-development)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
@@ -1,195 +0,0 @@
|
||||
# Dewemoji Billing Integration Plan (QRIS + PayPal)
|
||||
|
||||
This document outlines a proper, production-grade billing flow for Dewemoji using **QRIS (Pakasir)** and **PayPal Subscriptions**, including webhooks, retries, and license activation.
|
||||
|
||||
---
|
||||
|
||||
## 1) Goals
|
||||
|
||||
- Replace primitive payment links with real provider integrations.
|
||||
- Support **subscription** billing (monthly/annual) and **one-time lifetime**.
|
||||
- Activate or revoke licenses based on webhook-confirmed payments.
|
||||
- Log all webhook events and payment activity for audit.
|
||||
|
||||
---
|
||||
|
||||
## 2) Data Model
|
||||
|
||||
### `orders` (new)
|
||||
|
||||
Acts as the primary record of what the user is buying. Payments link back to orders.
|
||||
|
||||
- `id`
|
||||
- `user_id`
|
||||
- `plan_code`
|
||||
- `type` (`one_time`, `subscription`)
|
||||
- `currency` (`IDR`, `USD`)
|
||||
- `amount`
|
||||
- `status` (`pending`, `paid`, `failed`, `expired`, `refunded`)
|
||||
- `provider` (`qris`, `paypal`)
|
||||
- `provider_ref`
|
||||
- `created_at`, `updated_at`
|
||||
|
||||
### `payments` (new)
|
||||
|
||||
- `id`
|
||||
- `user_id`
|
||||
- `order_id`
|
||||
- `provider` (`qris`, `paypal`)
|
||||
- `type` (`one_time`, `subscription`)
|
||||
- `plan_code` (`personal_monthly`, `personal_annual`, `personal_lifetime`)
|
||||
- `currency` (`IDR`, `USD`)
|
||||
- `amount`
|
||||
- `status` (`pending`, `paid`, `failed`, `expired`, `refunded`)
|
||||
- `provider_ref` (invoice_id / order_id / subscription_id)
|
||||
- `raw_payload` (json)
|
||||
- `created_at`, `updated_at`
|
||||
|
||||
### `subscriptions` (existing)
|
||||
Extend with:
|
||||
- `provider`
|
||||
- `provider_ref`
|
||||
- `status` (`active`, `pending`, `canceled`, `expired`)
|
||||
- `started_at`, `expires_at`, `canceled_at`
|
||||
- `next_renewal_at` (optional)
|
||||
|
||||
### `webhook_events` (existing)
|
||||
Continue to log inbound payloads and processing status:
|
||||
- `provider`, `event_type`, `status`, `payload`, `received_at`, `processed_at`, `error_message`
|
||||
|
||||
---
|
||||
|
||||
## 3) Payment Flow (User Journey)
|
||||
|
||||
### Pricing Page (Frontend)
|
||||
|
||||
Each plan shows:
|
||||
- **Primary currency** (based on geo + user toggle)
|
||||
- **Two payment buttons** (real provider flow):
|
||||
- **QRIS (IDR)** → subscription or one-time
|
||||
- **PayPal (USD)** → subscription or one-time
|
||||
|
||||
### Backend Endpoints
|
||||
|
||||
#### QRIS (Pakasir)
|
||||
- `POST /billing/qris/create`
|
||||
- Creates invoice via Pakasir API
|
||||
- Stores `payments` with `pending`
|
||||
- Returns QR payment URL or QR code data
|
||||
- `GET /billing/qris/return` (optional)
|
||||
- Shows “pending / processing” state
|
||||
|
||||
#### PayPal Subscriptions
|
||||
- `POST /billing/paypal/create`
|
||||
- Creates PayPal subscription
|
||||
- Stores `payments` with `pending`
|
||||
- Returns approval URL
|
||||
- `GET /billing/paypal/return`
|
||||
- Shows “pending / processing” state
|
||||
|
||||
---
|
||||
|
||||
## 4) Webhook Processing (Critical)
|
||||
|
||||
Webhook endpoint:
|
||||
```
|
||||
POST /webhooks/{provider}
|
||||
```
|
||||
|
||||
Store inbound payloads in `webhook_events`, then process async (queue).
|
||||
|
||||
### PayPal Events
|
||||
- `BILLING.SUBSCRIPTION.ACTIVATED` → mark subscription active, set `users.tier = personal`
|
||||
- `BILLING.SUBSCRIPTION.CANCELLED` → mark subscription canceled
|
||||
- `PAYMENT.SALE.COMPLETED` → mark payment paid
|
||||
- `PAYMENT.SALE.DENIED` → mark payment failed
|
||||
|
||||
### Pakasir / QRIS Events
|
||||
- `payment.paid` → mark payment paid, grant access
|
||||
- `payment.expired` → mark payment failed/expired
|
||||
|
||||
---
|
||||
|
||||
## 5) License Activation Rules
|
||||
|
||||
When a payment or subscription is confirmed:
|
||||
- Create or update a `subscriptions` record
|
||||
- Set `users.tier = personal`
|
||||
- Store provider refs (`provider_ref`)
|
||||
- Log admin audit record
|
||||
|
||||
When revoked/expired:
|
||||
- Update `subscriptions.status`
|
||||
- Downgrade user if no active subscription remains
|
||||
|
||||
### Renewal Logic (QRIS manual renew)
|
||||
|
||||
- **If still active:** extend from current `expires_at`
|
||||
- `expires_at = expires_at + duration`
|
||||
- **If expired:** start from now
|
||||
- `expires_at = now + duration`
|
||||
|
||||
---
|
||||
|
||||
## 6) Admin Dashboard Enhancements
|
||||
|
||||
Add or extend:
|
||||
- **Payments list** (new screen)
|
||||
- filter by provider/status/currency
|
||||
- show raw provider ref
|
||||
- **Subscriptions list** (already exists)
|
||||
- show provider + status
|
||||
- **Webhook events** (already exists)
|
||||
- replay capability
|
||||
|
||||
---
|
||||
|
||||
## 7) Security & Reliability
|
||||
|
||||
- Validate webhook signatures (PayPal + Pakasir)
|
||||
- Reject duplicate events (idempotency)
|
||||
- Use queues for webhook processing
|
||||
- Log all webhook failures
|
||||
|
||||
---
|
||||
|
||||
## 8) Required Inputs (From Owner)
|
||||
|
||||
Before implementation:
|
||||
|
||||
1. **Pakasir API docs** (create invoice, webhook payload format)
|
||||
2. **PayPal API credentials** (client_id, secret, webhook signing key)
|
||||
3. Confirm **plans & pricing**:
|
||||
- Monthly
|
||||
- Annual
|
||||
- Lifetime
|
||||
|
||||
---
|
||||
|
||||
## 9) Implementation Phases
|
||||
|
||||
**Phase 1 — Schema + Core Models**
|
||||
- Add `orders` table
|
||||
- Add `payments` table (link to orders)
|
||||
- Extend `subscriptions`
|
||||
- Update webhook model if needed
|
||||
|
||||
**Phase 2 — Provider APIs**
|
||||
- Pakasir invoice create
|
||||
- PayPal subscription create
|
||||
|
||||
**Phase 3 — Webhooks**
|
||||
- Save raw events
|
||||
- Process via queue + idempotency
|
||||
|
||||
**Phase 4 — UI**
|
||||
- Pricing page buttons → real flows
|
||||
- Admin payment + subscription tools
|
||||
|
||||
---
|
||||
|
||||
## 10) Notes
|
||||
|
||||
- This plan assumes **proper subscription lifecycle** with webhooks.
|
||||
- PayPal.me / static links are **not sufficient** for subscriptions.
|
||||
- All access control must be tied to **confirmed payment status**.
|
||||
@@ -1,143 +0,0 @@
|
||||
# Dewemoji User Dashboard Implementation Plan
|
||||
|
||||
**Source:** `dewemoji-ux-flow-brief.md`
|
||||
**Goal:** Build the Personal user dashboard + inline personalization flows aligned with the UX brief.
|
||||
|
||||
---
|
||||
|
||||
## 1) Scope & Principles
|
||||
|
||||
- **Primary flow**: Add keywords directly on emoji detail pages (fast, contextual).
|
||||
- **Secondary flow**: Manage keywords in the dashboard (bulk + power tools).
|
||||
- **Zero friction** for Visitors/Free users; gentle upgrade prompts.
|
||||
- **Shared layout** with admin (same shell, role-based sidebar).
|
||||
|
||||
---
|
||||
|
||||
## 2) User States & Routing
|
||||
|
||||
### Visitor (non-logged)
|
||||
- Public search + emoji detail only.
|
||||
- CTA: “Sign up free” / “Upgrade to Personal”.
|
||||
|
||||
### Free user (logged, no subscription)
|
||||
- See public content, “Your keywords” section locked.
|
||||
- Upgrade nudges on detail + empty states in dashboard.
|
||||
|
||||
### Personal user (paid)
|
||||
- Full access: quick add on detail + dashboard CRUD.
|
||||
|
||||
---
|
||||
|
||||
## 3) UI Screens (User Dashboard)
|
||||
|
||||
### 3.1 Dashboard shell (shared)
|
||||
- Same layout as admin (sidebar, top bar).
|
||||
- Role-based sidebar menu:
|
||||
- Overview
|
||||
- My Keywords
|
||||
- API Keys
|
||||
- Billing
|
||||
- Preferences
|
||||
- Support / Logout
|
||||
|
||||
### 3.2 Overview (user)
|
||||
- Show:
|
||||
- Total keywords
|
||||
- Recent keyword additions (last 7 days)
|
||||
- Synced devices (optional later)
|
||||
- Small quick link to “My Keywords”.
|
||||
|
||||
### 3.3 My Keywords (primary management)
|
||||
- Table: Emoji | Your keywords | Language | Actions
|
||||
- Toolbar:
|
||||
- + Add Keyword
|
||||
- Import JSON
|
||||
- Export JSON
|
||||
- Search/filter
|
||||
- Modal: emoji picker → add keywords + language.
|
||||
|
||||
### 3.4 API Keys
|
||||
- List user API keys
|
||||
- Create/revoke key
|
||||
|
||||
### 3.5 Billing
|
||||
- Current plan + renewal / expiry
|
||||
- Payment method (future)
|
||||
- Upgrade CTA if free
|
||||
|
||||
### 3.6 Preferences
|
||||
- Theme
|
||||
- Tone lock / preferred skin tone (future)
|
||||
- Locale
|
||||
|
||||
---
|
||||
|
||||
## 4) Site Page Enhancements (Non-dashboard)
|
||||
|
||||
### 4.1 Emoji Detail Page (critical)
|
||||
- Show public keywords for everyone.
|
||||
- If Personal: show “Your Keywords” list + quick add modal.
|
||||
- If Free: show locked section + upgrade CTA.
|
||||
- If Visitor: CTA to sign up.
|
||||
|
||||
### 4.2 Search Results Page
|
||||
- Personal user: blend public + user keywords.
|
||||
- Show “Your keyword” badge and “quick edit” button.
|
||||
|
||||
---
|
||||
|
||||
## 5) API Endpoints (v1)
|
||||
|
||||
### Keyword CRUD
|
||||
- `GET /v1/emoji/{slug}?include_user_keywords=true`
|
||||
- `POST /v1/keywords` (add keyword)
|
||||
- `PUT /v1/keywords/{id}` (edit)
|
||||
- `DELETE /v1/keywords/{id}`
|
||||
- `GET /v1/keywords` (list user keywords)
|
||||
|
||||
### User keyword import/export
|
||||
- `POST /v1/keywords/import`
|
||||
- `GET /v1/keywords/export`
|
||||
|
||||
### Dashboard data
|
||||
- `GET /v1/user/summary` (counts + recents)
|
||||
- `GET /v1/user/apikeys` / `POST /v1/user/apikeys`
|
||||
- `GET /v1/user/billing` (subscription status)
|
||||
|
||||
---
|
||||
|
||||
## 6) Database / Models
|
||||
|
||||
Existing:
|
||||
- `user_keywords`
|
||||
- `subscriptions`
|
||||
|
||||
Add if needed:
|
||||
- `user_keyword_imports` (optional audit)
|
||||
|
||||
---
|
||||
|
||||
## 7) Implementation Phases
|
||||
|
||||
### Phase A — Foundation
|
||||
- Add user routes + dashboard views
|
||||
- Layout reuse with role‑based sidebar
|
||||
|
||||
### Phase B — Keywords UX
|
||||
- Detail page quick add
|
||||
- Dashboard keyword CRUD + import/export
|
||||
|
||||
### Phase C — Billing & API Keys
|
||||
- Billing summary + upgrade CTA
|
||||
- API key list + create/revoke
|
||||
|
||||
---
|
||||
|
||||
## 8) Acceptance Criteria
|
||||
|
||||
- Personal user can add keywords from detail page in <5 seconds.
|
||||
- Keyword appears in search results immediately.
|
||||
- Dashboard keyword table supports filter + edit + delete.
|
||||
- Free users see upgrade prompts, not broken UI.
|
||||
|
||||
Reference in New Issue
Block a user