Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow Admin to personalize Names and Logo (draft) #63

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 41 additions & 43 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
/** @type {import("eslint").Linter.Config} */
const config = {
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
},
"plugins": [
"@typescript-eslint",
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
plugins: ["@typescript-eslint"],
extends: [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:prettier/recommended",
],
rules: {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"react/no-unescaped-entities": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:prettier/recommended"
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],
"rules": {
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"react/no-unescaped-entities": "off",
"@typescript-eslint/consistent-type-imports": [
"warn",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
"checksVoidReturn": {
"attributes": false
}
}
]
}
"@typescript-eslint/require-await": "off",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
attributes: false,
},
},
],
},
}
module.exports = config;
module.exports = config
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,26 @@
"license": "AGPL-3.0-only",
"scripts": {
"build": "next build",
"start": "next start",
"dev": "next dev",

"db:migrate": "prisma migrate dev --create-only",
"db:push": "prisma db push",
"db:studio": "prisma studio",
"db:seed": "prisma seed",
"db:docker": "npm run db:push && npm run seed",
"dev": "next dev",

"dev:email": "npx dotenv-run-script dev:email-noenv",
"dev:email-noenv": "email dev --dir src/emails",

"postinstall": "prisma generate",

"lint": "next lint",
"lint:fix": "next lint --fix",
"lint:prisma": "prisma validate",
"lint:fix": "next lint --fix && prisma format",
"start": "next start",
"ragequit": "rm -rf .next && npm run db:push && npm run dev",
"seed": "prisma db seed"
"lint:prisma:fix": "prisma format",

"ragequit": "rm -rf .next && npm run db:push && npm run dev"
},
"prisma": {
"seed": "tsx prisma/seeds/index.ts"
Expand Down
4 changes: 2 additions & 2 deletions postcss.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const config = {
plugins: {
tailwindcss: {},
},
};
}

module.exports = config;
module.exports = config
8 changes: 4 additions & 4 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
const config = {
plugins: ["prettier-plugin-tailwindcss"],
semi: false
};
plugins: ["prettier-plugin-tailwindcss"],
semi: false,
}

export default config;
export default config
13 changes: 7 additions & 6 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ datasource db {

// Core Elements
model Configurable {
id String @id @default(cuid())
name String @unique
type ConfigurableType
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id String @id @default(cuid())
name String @unique
description String?
type ConfigurableType
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt

@@index([name])
}
Expand Down
34 changes: 18 additions & 16 deletions prisma/seeds/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import {PrismaClient} from '@prisma/client'

import {membershipTemplates} from "./models/membershipTemplates";
import {users} from "./models/users";
import { PrismaClient } from "@prisma/client"
import { membershipTemplatesSeeds } from "./models/membershipTemplates"
import { usersSeeds } from "./models/users"
import { configurablesSeeds } from "./models/configurables"

const prisma = new PrismaClient()

function seedModel(model: any, data: object[]) {
return model.createMany({data, skipDuplicates: true})
async function seedModel(model: any, data: object[]) {
await model.createMany({ data, skipDuplicates: true })
return
}

async function main() {
await seedModel(prisma.user, users)
await seedModel(prisma.membershipTemplate, membershipTemplates)
await seedModel(prisma.user, usersSeeds)
await seedModel(prisma.membershipTemplate, membershipTemplatesSeeds)
await seedModel(prisma.configurable, configurablesSeeds)
}

main()
.then(async () => {
await prisma.$disconnect()
})
.catch(async (e) => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})
.then(async () => {
await prisma.$disconnect()
})
.catch(async (e) => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})
18 changes: 18 additions & 0 deletions prisma/seeds/models/configurables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ConfigurableType } from "@prisma/client"

export const configurablesSeeds = [
{
name: "org_name",
type: ConfigurableType.STRING,
value: "ACME Cinema.",
createdAt: new Date(),
updatedAt: new Date(),
},
{
name: "org_url",
type: ConfigurableType.STRING,
value: "https://example.com",
createdAt: new Date(),
updatedAt: new Date(),
},
]
95 changes: 49 additions & 46 deletions prisma/seeds/models/membershipTemplates.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,50 @@
import {PricePeriod, PriceUnit} from "@prisma/client";
import { PricePeriod, PriceUnit } from "@prisma/client"

export const membershipTemplates = [
{
title: "Cinema Club 2024 Membership",
description: "Support the magic of cinema and join our mission to create a vibrant international community of movie lovers.",
features: [
"Join an exclusive community of film enthusiasts",
"Early access to tickets for premieres and special screenings",
],
priceAmount: 3000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: 'price_123456789',
createdAt: new Date(),
updatedAt: new Date(),
},
{
title: "Cinema Club 2024 Premium",
description: "Contribute to the celebration of cinematic art and be part of our effort to build a global network of individuals passionate about film.",
features: [
"Priority booking for new releases and exclusive content",
"Enjoy a 10€ discount on every purchase at our cinema shops",
],
priceAmount: 6000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: 'price_987654321',
createdAt: new Date(),
updatedAt: new Date(),
},
{
title: "Cinema Club 2024 Elite",
description: "Support leading-edge film presentations and help us foster a worldwide community that celebrates and enhances the cinematic experience.",
features: [
"Advanced access to workshops with filmmakers and special movie content",
"Receive a 15€ discount on all merchandise and concession orders",
"Exclusive invitations to members-only previews and gala events",
],
priceAmount: 9000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: 'price_483123255',
createdAt: new Date(),
updatedAt: new Date(),
}
]
export const membershipTemplatesSeeds = [
{
title: "Cinema Club 2024 Membership",
description:
"Support the magic of cinema and join our mission to create a vibrant international community of movie lovers.",
features: [
"Join an exclusive community of film enthusiasts",
"Early access to tickets for premieres and special screenings",
],
priceAmount: 3000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: "price_123456789",
createdAt: new Date(),
updatedAt: new Date(),
},
{
title: "Cinema Club 2024 Premium",
description:
"Contribute to the celebration of cinematic art and be part of our effort to build a global network of individuals passionate about film.",
features: [
"Priority booking for new releases and exclusive content",
"Enjoy a 10€ discount on every purchase at our cinema shops",
],
priceAmount: 6000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: "price_987654321",
createdAt: new Date(),
updatedAt: new Date(),
},
{
title: "Cinema Club 2024 Elite",
description:
"Support leading-edge film presentations and help us foster a worldwide community that celebrates and enhances the cinematic experience.",
features: [
"Advanced access to workshops with filmmakers and special movie content",
"Receive a 15€ discount on all merchandise and concession orders",
"Exclusive invitations to members-only previews and gala events",
],
priceAmount: 9000,
pricePeriod: PricePeriod.Yearly,
priceUnit: PriceUnit.EUR,
stripePriceId: "price_483123255",
createdAt: new Date(),
updatedAt: new Date(),
},
]
30 changes: 15 additions & 15 deletions prisma/seeds/models/users.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {UserRole} from "@prisma/client";
import { UserRole } from "@prisma/client"

export const users = [
{
name: "Alice",
role: UserRole.member,
email: "alice@example.com",
emailVerified: new Date(),
},
{
name: "Bob",
role: UserRole.admin,
email: "bob@example.com",
emailVerified: new Date(),
}
]
export const usersSeeds = [
{
name: "Alice",
role: UserRole.member,
email: "alice@example.com",
emailVerified: new Date(),
},
{
name: "Bob",
role: UserRole.admin,
email: "bob@example.com",
emailVerified: new Date(),
},
]
16 changes: 7 additions & 9 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { Config } from "tailwindcss"
const config = {
darkMode: ["class"],
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
],
prefix: "",
theme: {
container: {
Expand Down Expand Up @@ -74,9 +74,7 @@ const config = {
},
},
},
plugins: [
require("tailwindcss-animate")
],
plugins: [require("tailwindcss-animate")],
} satisfies Config

export default config
export default config
Loading
Loading