diff --git a/icons/index.tsx b/icons/index.tsx index 68d03b4..cfc70a0 100644 --- a/icons/index.tsx +++ b/icons/index.tsx @@ -1,30 +1,33 @@ 'use client'; import { Icon, IconProps as P } from '@/components/chakra'; + import { - MdBarChart, - MdBusiness, - MdDashboard, + MdOutlineWorkspacePremium as MdPremium, + MdFormatListBulleted, MdDataExploration, - MdFilterAlt, - MdFlag, - MdFormatBold, MdFormatItalic, - MdFlashOn, - MdFormatListBulleted, MdInsertChart, - MdLogout, + MdFormatBold, + MdStarBorder, + MdDashboard, + MdFilterAlt, + MdBarChart, + MdBusiness, + MdFlashOn, MdPalette, MdPreview, + MdLogout, + MdFlag, MdSave, MdStar, - MdStarBorder, } from 'react-icons/md'; import { LuRefreshCw, LuStickyNote } from 'react-icons/lu'; import { DiGoogleCloudPlatform } from 'react-icons/di'; import { FaGithub, FaGlobe } from 'react-icons/fa6'; import { BiSolidCommentAdd } from 'react-icons/bi'; import { TbBrandTypescript } from 'react-icons/tb'; +import { FaAws, FaGoogle } from 'react-icons/fa'; import { AiOutlineEnter } from 'react-icons/ai'; import { TbBrandNextjs } from 'react-icons/tb'; import { BsThreeDots } from 'react-icons/bs'; @@ -32,15 +35,15 @@ import { SiChakraui } from 'react-icons/si'; import { FcFlashOn } from 'react-icons/fc'; import { SiPrisma } from 'react-icons/si'; import { HiUsers } from 'react-icons/hi2'; -import { FaAws } from 'react-icons/fa'; export * from '@chakra-ui/icons'; // Company logos, for demo export const AwsLogo = (p: P) => ; +export const ChakraLogo = (p: P) => ; export const GcpLogo = (p: P) => ; +export const GoogleLogo = (p: P) => ; export const NextLogo = (p: P) => ; -export const ChakraLogo = (p: P) => ; export const PrismaLogo = (p: P) => ; export const TypescriptLogo = (p: P) => ; @@ -70,3 +73,4 @@ export const StarIcon = (p: P) => ; export const StickyNoteIcon = (p: P) => ; export const ThreeDotsIcon = (p: P) => ; export const UsersIcon = (p: P) => ; +export const PremiumIcon = (p: P) => ; diff --git a/lib/constants.ts b/lib/constants.ts index ec9d9b7..ea359ab 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -1,3 +1,5 @@ +import { Plan } from '@/types'; + export const STRIPE_API_VERSION = '2023-10-16'; export const STRIPE_APP_NAME = 'Sieutoc Platform'; export const STRIPE_SECRET_KEY = process.env.STRIPE_SECRET_KEY; @@ -12,3 +14,77 @@ export const EMAIL_REGEX = export const ROW_HEIGHT = 53; export const MAX_PROJECTS = Number(process.env.MAX_PROJECTS ?? 1); + +export const LISTMONK_API = process.env.LISTMONK_API ?? ''; +export const LISTMONK_SECRET = `${process.env.LISTMONK_ADMIN_USERNAME}:${process.env.LISTMONK_ADMIN_PASSWORD}`; + +export const RESERVED_SLUGS = ['sang', 'aiei']; + +type Pricing = { + price: { + monthly: number | string; + yearly: number | string; + }; + description?: string; + ctaText?: string; + features: string[]; + quota: { + projects: number; + rows: number; + }; +}; + +export const FEATURES: Record = { + [Plan.HOBBY]: { + price: { + monthly: 9, + yearly: 5, + }, + description: 'Unlock key features and higher usage limits', + features: [ + 'Up to 3 team members', + 'Up to 3 projects', + 'Intuitive, fast and privacy-friendly dashboard', + ], + quota: { + projects: 3, + rows: 10, + }, + }, + [Plan.PRO]: { + price: { + monthly: 62, + yearly: 59, + }, + description: 'Enjoy higher limits and extra features with our Pro plan.', + features: [ + `Everything in ${Plan.HOBBY}`, + 'Up to 10 team members', + 'Up to 10 projects', + 'Lorem ipsum plan dono', + 'Something else longer so it will make two lines', + ], + quota: { + projects: 10, + rows: 100, + }, + }, + [Plan.ENTERPRISE]: { + price: { + monthly: 'Custom', + yearly: 'Custom', + }, + description: 'Elevate with exclusive features and limitless potential.', + ctaText: 'Contact Us', + features: [ + `Everything in ${Plan.PRO}`, + 'Unlimited team members', + 'Unlimited projects', + 'Technical onboarding', + ], + quota: { + projects: 999, + rows: 1000, + }, + }, +}; diff --git a/package.json b/package.json index cc72386..9648b27 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,6 @@ "ai": "2.2.29", "date-fns": "2.30.0", "deepmerge": "4.3.1", - "easypanel-sdk": "0.3.1", "easypanel.js": "1.1.6", "fast-deep-equal": "3.1.3", "framer-motion": "10.16.16", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07a5dc3..0a047dc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,9 +80,6 @@ dependencies: deepmerge: specifier: 4.3.1 version: 4.3.1 - easypanel-sdk: - specifier: 0.3.1 - version: 0.3.1 easypanel.js: specifier: 1.1.6 version: 1.1.6 @@ -4273,11 +4270,6 @@ packages: /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - /easypanel-sdk@0.3.1: - resolution: {integrity: sha512-5IasaIkkk8dePyFNFC7H8uqzB2nbRXksdrDkuQvfdjhAFLrD2cZ15n/cEngJ5a7KKExWzOrbEHnfqGD7MF11CA==} - engines: {node: '>=20'} - dev: false - /easypanel.js@1.1.6: resolution: {integrity: sha512-TTgTjAFChd/2RA9xcs2RaMQSEo4nVOuZx002EbMylJSDi8PJ3dUxddbmv8kBVX2UXHNLplWqr/LKLPzC+Gf9lg==} dependencies: diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 12ded3a..bc5eb61 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -16,6 +16,12 @@ enum UserRole { USER } +enum Plan { + HOBBY + PRO + ENTERPRISE +} + model User { id String @id @default(uuid()) name String? @@ -82,5 +88,6 @@ model Project { updatedAt DateTime @updatedAt environmentVariables Json @default("{\"preview\":{},\"production\":{}}") template String? + plan Plan @default(HOBBY) users User[] } diff --git a/types/index.ts b/types/index.ts index a1ecb0d..70511a6 100644 --- a/types/index.ts +++ b/types/index.ts @@ -28,6 +28,21 @@ export enum HttpMethod { TRACE = 'TRACE', } +// For Listmonk +export type SubscribeResponse = { + data: { + id: number; + created_at: string; + updated_at: string; + uuid: string; + email: string; + name: string; + attribs: Record; + status: 'enabled' | 'disabled' | 'blocklisted'; + lists: number[]; + }; +}; + export type JsonObject = Prisma.JsonObject; export type ReposResponse = Endpoints['GET /repos/{owner}/{repo}']['response'];