Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 1, 2025
1 parent ef8e296 commit 85e1778
Show file tree
Hide file tree
Showing 25 changed files with 620 additions and 457 deletions.
44 changes: 43 additions & 1 deletion apps/api/src/db/schema.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
import { integer, real, sqliteTable, text } from "drizzle-orm/sqlite-core";

export const users = sqliteTable("users", {
id: text("id").primaryKey(),
Expand Down Expand Up @@ -89,3 +89,45 @@ export const invitations = sqliteTable("invitations", {
.notNull()
.references(() => users.id),
});

export const tokens = sqliteTable("tokens", {
id: text("id").primaryKey(),
name: text("name").notNull(),
token: text("token").notNull().unique(),
userId: text("user_id")
.notNull()
.references(() => users.id),
projectId: text("project_id")
.notNull()
.references(() => projects.id),
expiresAt: integer("expires_at", { mode: "timestamp" }),
createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
lastUsedAt: integer("last_used_at", { mode: "timestamp" }),
});

export const projects = sqliteTable("projects", {
id: text("id").primaryKey(),
name: text("name").notNull(),
description: text("description"),
organizationId: text("organization_id")
.notNull()
.references(() => organizations.id),
createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
});

export const projectSettings = sqliteTable("project_settings", {
id: text("id").primaryKey(),
projectId: text("project_id")
.notNull()
.references(() => projects.id),
cache: integer("cache", { mode: "boolean" }).notNull().default(true),
context: integer("context", { mode: "boolean" }).notNull().default(true),
temperature: real("temperature").notNull().default(0),
instructions: text("instructions"),
memory: integer("memory", { mode: "boolean" }).notNull().default(true),
grammar: integer("grammar", { mode: "boolean" }).notNull().default(true),
apiKey: text("api_key").notNull().unique(),
createdAt: integer("created_at", { mode: "timestamp" }).notNull(),
updatedAt: integer("updated_at", { mode: "timestamp" }).notNull(),
});
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"input-otp": "^1.4.1",
"lucide-react": "^0.469.0",
"next": "15.1.3",
"next-international": "^1.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
Expand Down
21 changes: 21 additions & 0 deletions apps/web/src/app/[locale]/(marketing)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Footer } from "@/components/footer";
import { Header } from "@/components/header";
import { I18nProviderClient } from "@/locales/client";
import type { ReactElement } from "react";

export default async function SubLayout({
params,
children,
}: { params: Promise<{ locale: string }>; children: ReactElement }) {
const { locale } = await params;

return (
<I18nProviderClient locale={locale}>
<div className="p-6">
<Header />
<div className="container mx-auto">{children}</div>
<Footer />
</div>
</I18nProviderClient>
);
}
File renamed without changes.
9 changes: 9 additions & 0 deletions apps/web/src/app/[locale]/(marketing)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Hero } from "@/components/hero";

export default function Page() {
return (
<div>
<Hero />
</div>
);
}
3 changes: 3 additions & 0 deletions apps/web/src/app/[locale]/(marketing)/pricing/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div>Pricing</div>;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { OpenPanelComponent } from "@openpanel/nextjs";
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import { Geist_Mono } from "next/font/google";

import "./globals.css";

const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
import "../globals.css";

const geistMono = Geist_Mono({
variable: "--font-geist-mono",
Expand All @@ -19,22 +14,25 @@ export const metadata: Metadata = {
description: "Translate your application with Languine CLI powered by AI.",
};

export default function RootLayout({
export default async function RootLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: { locale: string };
}>) {
const { locale } = await params;

return (
<html lang="en" className="dark">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
<html lang={locale} className="dark">
<body className={`${geistMono.variable} antialiased`}>
<OpenPanelComponent
clientId={process.env.NEXT_PUBLIC_OPEN_PANEL_CLIENT_ID!}
clientSecret={process.env.OPEN_PANEL_CLIENT_SECRET!}
trackScreenViews={true}
disabled={process.env.NODE_ENV !== "production"}
/>

{children}
</body>
</html>
Expand Down
File renamed without changes
6 changes: 3 additions & 3 deletions apps/web/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@tailwind utilities;

body {
font-family: Arial, Helvetica, sans-serif;
font-family: var(--font-geist-mono), Arial, Helvetica, sans-serif;
}

@layer base {
Expand Down Expand Up @@ -43,10 +43,10 @@ body {
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;
--secondary: 0 0% 14.9%;
--secondary: 0 0% 53.3%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;
--muted-foreground: 0 0% 17.3%;
--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
Expand Down
110 changes: 0 additions & 110 deletions apps/web/src/app/page.tsx

This file was deleted.

Loading

0 comments on commit 85e1778

Please sign in to comment.