feat: dashboard billing (#193)

* feat: move plans into sharable json

* remove unused code

* update pnpm lock

* update plans.json

* implement early adopter pricing

* docs: update meta title and description

* Finished the UI for upgrading plans

* Updated the pricing plans

* Updated the cards ui

* use relative import

* improve styling of upgrade plan card

* styling improvements, lemonsqueezy setup

* trigger lemonsqueezy payment and add webhook

* update pnpm lock

* add logout route

* feat: complete billing functionality

* generate lock file

* make crypto false on browser

* feat: adding upgrade prompts to org

* chore: add upgrade icon to upload video

* feat: add upgrade prompt to certificate and settings

* feat: implement onboarding setup page (#229)

* working on the onboarding setup

* working on the onboarding page

* Almost done with the onboarding UI

* finished the UI of the onBoarding setup

* finished the UI of the onBoarding setup

* Implementing the functions to carryout the logic of updating the UI onmount if a user has carried out a certain step or not

* Implementing the functions to carryout the logic of updating the UI onmount if a user has carried out a certain step or not

* making some chnages

* finished the onBoarding task

* updated some logic

* Removed the uneeded svg from the static folder

* fixed isCoursePublished not returning a boolean

* improved the setup link protection

* chore: make menuItems reactive

* improve formatting

* format supabase queries

---------

Co-authored-by: Rotimi Best <[email protected]>

* revamp setup

* improve the upgrade experience

* migration

* feat: add lemonsqueezy customer portal

---------

Co-authored-by: emmanuel <[email protected]>
This commit is contained in:
Rotimi Best
2024-04-07 06:08:34 +01:00
committed by GitHub
co-authored by emmanuel
parent 136e057954
commit fcd0bcc656
105 changed files with 1743 additions and 463 deletions
@@ -0,0 +1,43 @@
export const PLAN = {
BASIC: 'BASIC',
EARLY_ADOPTER: 'EARLY_ADOPTER',
ENTERPRISE: 'ENTERPRISE'
};
export const PLAN_NAMES = {
[PLAN.BASIC]: 'Free',
[PLAN.EARLY_ADOPTER]: 'Early Adopter',
[PLAN.ENTERPRISE]: 'Enterprise',
}
export const FEATURES = {
BACIC_STUDENTS_50: 'BACIC_STUDENTS_50',
EA_STUDENTS_10000: 'EA_STUDENTS_10000',
EA_VIDEO_UPLOAD: 'EA_VIDEO_UPLOAD',
EA_CERTIFICATE: 'EA_CERTIFICATE',
EA_UPCOMING_FEATURES: 'EA_UPCOMING_FEATURES',
ENTERPRISE_STUDENTS_UNLIMITED: 'ENTERPRISE_STUDENTS_UNLIMITED',
ENTERPRISE_CUSTOM_DOMAIN: 'ENTERPRISE_CUSTOM_DOMAIN'
};
export const BASIC_FEATURES = [FEATURES.BACIC_STUDENTS_50];
export const EARYL_ADOPTER_FEATURES = [
...BASIC_FEATURES,
FEATURES.EA_STUDENTS_10000,
FEATURES.EA_VIDEO_UPLOAD,
FEATURES.EA_CERTIFICATE,
FEATURES.EA_UPCOMING_FEATURES
];
export const ENTERPRISE_FEATURES = [
...EARYL_ADOPTER_FEATURES,
FEATURES.ENTERPRISE_STUDENTS_UNLIMITED,
FEATURES.ENTERPRISE_CUSTOM_DOMAIN
];
export const PLANS_BY_FEATURE = {
[PLAN.BASIC]: BASIC_FEATURES,
[PLAN.EARLY_ADOPTER]: EARYL_ADOPTER_FEATURES,
[PLAN.ENTERPRISE]: ENTERPRISE_FEATURES
};
@@ -0,0 +1,75 @@
{
"BASIC": {
"NAME": "Basic",
"DESCRIPTION": "Free tier plan for personal use, no credit card required.",
"PRICE": {
"CURRENCY": "$",
"MONTHLY": "0",
"YEARLY": "0",
"IS_PREMIUM": false
},
"FEATURES": [
"Unlimited Courses",
"Unlimited Q/A",
"50 Students",
"AI Course Builder (no video upload)",
"Live chat & polls"
],
"CTA": {
"LABEL": "Signup Now",
"LINK": "/signup?plan=free",
"DASHBOARD_LABEL": "Downgrade",
"DASHBOARD_LINK": "#disabled",
"IS_DISABLED": true
}
},
"EARLY_ADOPTER": {
"NAME": "Early Adopters",
"DESCRIPTION": "For fast growing teaching businesses that aim to scale.",
"PRICE": {
"CURRENCY": "$",
"MONTHLY": "35",
"YEARLY": "350",
"IS_PREMIUM": false
},
"FEATURES": [
"Everything in Basic",
"Unlimted Teachers",
"10K Students",
"Advanced AI Course Builder (Video upload & Certificate)",
"Custom Branding",
"Includes all Upcoming Features"
],
"CTA": {
"LABEL": "I want in 😍",
"LINK": "/signup?plan=early-adopter",
"DASHBOARD_LABEL": "Support us 😍",
"DASHBOARD_LINK": "",
"IS_DISABLED": false,
"PRODUCT_ID": "297248"
}
},
"ENTERPRISE": {
"NAME": "Enterprise",
"DESCRIPTION": "Best suited for larger businesses that need more control",
"PRICE": {
"CURRENCY": "",
"MONTHLY": "Request Pricing",
"YEARLY": "Request Pricing",
"IS_PREMIUM": true
},
"FEATURES": [
"Everything in Early Adopters plus:",
"Unlimited students",
"Custom Domain",
"24/7 Support"
],
"CTA": {
"LABEL": "Contact Us",
"LINK": "https://cal.com/classroomio/enterprise",
"DASHBOARD_LABEL": "Contact Us",
"DASHBOARD_LINK": "https://cal.com/classroomio/enterprise",
"IS_DISABLED": false
}
}
}
@@ -0,0 +1,7 @@
import { PLANS_BY_FEATURE } from './constants';
export function hasFeature(featureName: string, userPlan: string) {
const features = PLANS_BY_FEATURE[userPlan];
return features.includes(featureName);
}