Skip to content

Commit

Permalink
merge dev to main (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement-Muth authored Oct 24, 2024
2 parents 30b336d + 51b3e79 commit bf0c0dc
Show file tree
Hide file tree
Showing 290 changed files with 2,791 additions and 994 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
41 changes: 14 additions & 27 deletions next.config.js → next.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
const readEnvironmentVariable = (key, defaultValue = undefined) => {
import type { NextConfig } from "next";

const readEnvironmentVariable = (key: string, defaultValue: string | undefined = undefined): string => {
const value = process.env[key];

if (value === undefined && defaultValue === undefined) {
throw new Error(`The environment variable "${key} is missing".`);
}

if (value === "true") {
return true;
}

if (value === "false") {
return false;
}

return value || defaultValue;
return value!;
};

/**
* @returns {import('next').NextConfig}
*/
const nextConfig = () => {
const nextConfig = (): NextConfig => {
const PCOMPARATOR_ENV = readEnvironmentVariable("PCOMPARATOR_ENV", "production");

if (!["development", "test", "staging", "production"].includes(PCOMPARATOR_ENV)) {
Expand All @@ -32,31 +23,27 @@ const nextConfig = () => {
env: {
PCOMPARATOR_ENV,
PCOMPARATOR_API_ENDPOINT: readEnvironmentVariable("PCOMPARATOR_API_ENDPOINT"),
ALGOLIA_APP_ID: readEnvironmentVariable("ALGOLIA_APP_ID"),
ALGOLIA_API_KEY: readEnvironmentVariable("ALGOLIA_API_KEY"),
ALGOLIA_APP_ID: readEnvironmentVariable("ALGOLIA_APP_ID")!,
ALGOLIA_API_KEY: readEnvironmentVariable("ALGOLIA_API_KEY")!,
},
reactStrictMode: true,
swcMinify: true,
compress: true,
images: {
domains: ["lh3.googleusercontent.com", "firebasestorage.googleapis.com", "vercel.com"]
},
experimental: {
turbo: {
rules: {
"*.po": {
loaders: ["@lingui/loader"]
}
}
},
swcPlugins: [["@lingui/swc-plugin", {}]],
serverActions: {
bodySizeLimit: "3mb"
}
},
webpack: (config) => {
config.module.rules.push({
test: /\.po$/,
use: {
loader: "@lingui/loader"
}
});

return config;
}
};
};

Expand Down
22 changes: 16 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbo",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -14,32 +14,41 @@
"compile": "lingui compile --typescript",
"test": "cross-env NODE_OPTIONS=--experimental-vm-modules env-cmd -f ./.env.test jest --maxWorkers=100%",
"generate": "kysely-codegen --out-file ./src/types/db.d.ts",
"prepare": "husky"
"prepare": "husky",
"postinstall": "prisma generate"
},
"dependencies": {
"@auth/prisma-adapter": "^2.7.2",
"@imbios/next-pwa": "^1.1.1",
"@lingui/core": "^4.11.0",
"@lingui/react": "^4.11.0",
"@neondatabase/serverless": "^0.10.1",
"@nextui-org/react": "^2.4.8",
"@prisma/adapter-neon": "^5.21.1",
"@prisma/client": "^5.21.1",
"@types/lodash": "^4.14.197",
"@types/node": "20.4.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vercel/blob": "^0.25.1",
"@vercel/postgres": "^0.10.0",
"@vercel/postgres-kysely": "^0.10.0",
"algoliasearch": "^4.18.0",
"autoprefixer": "^10.4.20",
"framer-motion": "^10.12.18",
"ky": "^1.7.2",
"kysely": "^0.27.4",
"lodash": "^4.17.21",
"lucide-react": "^0.259.0",
"next": "^14.2.15",
"next": "15.0.0",
"next-auth": "beta",
"next-themes": "^0.3.0",
"postcss": "8.4.25",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-hook-form": "^7.53.1",
"react-phone-number-input": "^3.4.9",
"react-toastify": "^10.0.6",
"react-wrap-balancer": "^1.0.0",
"tailwindcss": "^3.4.14",
"typescript": "^5.6.3"
Expand All @@ -51,14 +60,14 @@
"@lingui/cli": "^4.11.0",
"@lingui/loader": "^4.11.0",
"@lingui/macro": "^4.11.0",
"@lingui/swc-plugin": "4.0.7",
"@lingui/swc-plugin": "4.0.10",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.3.0",
"@semantic-release/release-notes-generator": "^14.0.1",
"@swc/core": "^1.7.36",
"@swc/core": "1.7.39",
"@swc/jest": "^0.2.29",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^5.16.5",
Expand All @@ -76,6 +85,7 @@
"jest-environment-jsdom": "^29.5.0",
"kysely-codegen": "^0.17.0",
"lint-staged": "^15.2.10",
"prisma": "^5.21.1",
"semantic-release": "^24.1.0",
"sharp": "^0.33.5",
"turbo": "^2.2.2",
Expand Down
13 changes: 13 additions & 0 deletions prisma/migrations/20241023062243_init/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- CreateTable
CREATE TABLE "users" (
"id" SERIAL NOT NULL,
"name" VARCHAR(255),
"email" VARCHAR(255),
"avatar" VARCHAR(255),

CONSTRAINT "users_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "users_email_key" ON "users"("email");

70 changes: 70 additions & 0 deletions prisma/migrations/20241023073856_auth/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Warnings:
- You are about to drop the `users` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "users";

-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"name" TEXT,
"email" TEXT NOT NULL,
"emailVerified" TIMESTAMP(3),
"avatar" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Account" (
"userId" TEXT NOT NULL,
"type" TEXT NOT NULL,
"provider" TEXT NOT NULL,
"providerAccountId" TEXT NOT NULL,
"refresh_token" TEXT,
"access_token" TEXT,
"expires_at" INTEGER,
"token_type" TEXT,
"scope" TEXT,
"id_token" TEXT,
"session_state" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "Account_pkey" PRIMARY KEY ("provider","providerAccountId")
);

-- CreateTable
CREATE TABLE "Session" (
"sessionToken" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL
);

-- CreateTable
CREATE TABLE "VerificationToken" (
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,

CONSTRAINT "VerificationToken_pkey" PRIMARY KEY ("identifier","token")
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");

-- CreateIndex
CREATE UNIQUE INDEX "Session_sessionToken_key" ON "Session"("sessionToken");

-- AddForeignKey
ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
9 changes: 9 additions & 0 deletions prisma/migrations/20241023075644_rename_image/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
Warnings:
- You are about to drop the column `avatar` on the `User` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "User" DROP COLUMN "avatar",
ADD COLUMN "image" TEXT;
2 changes: 2 additions & 0 deletions prisma/migrations/20241023081524_phone/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "phone" TEXT;
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"
63 changes: 63 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}

generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

model User {
id String @id @default(uuid())
name String?
email String @unique
emailVerified DateTime?
image String?
phone String?
accounts Account[]
sessions Session[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model Account {
userId String
type String
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@id([provider, providerAccountId])
}

model Session {
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model VerificationToken {
identifier String
token String
expires DateTime
@@id([identifier, token])
}
Loading

0 comments on commit bf0c0dc

Please sign in to comment.