import { loadStripe } from '@stripe/stripe-js';
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
export default function Checkout() {
const handleCheckout = async () => {
const stripe = await stripePromise;
const { sessionId } = await fetch('/api/checkout').then(res => res.json());
await stripe.redirectToCheckout({ sessionId });
};
return <button onClick={handleCheckout}>Checkout</button>;
} import { useState, useEffect } from 'react';
import { Bar } from 'react-chartjs-2';
export default function Dashboard() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('/api/dashboard-data').then(res => res.json()).then(setData);
}, []);
if (!data) return <div>Loading...</div>;
return (
<div>
<h1>Dashboard</h1>
<Bar data={data} />
</div>
);
} from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
@app.post('/items')
def create_item(item: Item):
return {'id': 1, **item.dict()}
@app.get('/items/{item_id}')
def read_item(item_id: int):
return {'id': item_id, 'name': 'Example Item', 'price': 9.99} import { useState, useEffect } from 'react';
export function useKodu(prompt: string) {
const [response, setResponse] = useState('');
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
setIsLoading(true);
fetch('/api/kodu', {
method: 'POST',
body: JSON.stringify({ prompt }),
})
.then(res => res.json())
.then(data => {
setResponse(data.response);
setIsLoading(false);
});
}, [prompt]);
return { response, isLoading };
} module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {
colors: {
kodu: {
light: '#f0f4f8',
dark: '#102a43',
},
},
},
},
variants: {
extend: {},
},
plugins: [],
} FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
projects Project[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Project {
id Int @id @default(autoincrement())
name String
user User @relation(fields: [userId], references: [id])
userId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
} module.exports = {
reactStrictMode: true,
images: {
domains: ['kodu.ai'],
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config;
},
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true,
},
];
},
} import { loadStripe } from '@stripe/stripe-js';
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
export default function Checkout() {
const handleCheckout = async () => {
const stripe = await stripePromise;
const { sessionId } = await fetch('/api/checkout').then(res => res.json());
await stripe.redirectToCheckout({ sessionId });
};
return <button onClick={handleCheckout}>Checkout</button>;
} import { useState, useEffect } from 'react';
import { Bar } from 'react-chartjs-2';
export default function Dashboard() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('/api/dashboard-data').then(res => res.json()).then(setData);
}, []);
if (!data) return <div>Loading...</div>;
return (
<div>
<h1>Dashboard</h1>
<Bar data={data} />
</div>
);
} from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
@app.post('/items')
def create_item(item: Item):
return {'id': 1, **item.dict()}
@app.get('/items/{item_id}')
def read_item(item_id: int):
return {'id': item_id, 'name': 'Example Item', 'price': 9.99} import { useState, useEffect } from 'react';
export function useKodu(prompt: string) {
const [response, setResponse] = useState('');
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
setIsLoading(true);
fetch('/api/kodu', {
method: 'POST',
body: JSON.stringify({ prompt }),
})
.then(res => res.json())
.then(data => {
setResponse(data.response);
setIsLoading(false);
});
}, [prompt]);
return { response, isLoading };
} module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {
colors: {
kodu: {
light: '#f0f4f8',
dark: '#102a43',
},
},
},
},
variants: {
extend: {},
},
plugins: [],
} FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
projects Project[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Project {
id Int @id @default(autoincrement())
name String
user User @relation(fields: [userId], references: [id])
userId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
} module.exports = {
reactStrictMode: true,
images: {
domains: ['kodu.ai'],
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config;
},
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true,
},
];
},
} import { loadStripe } from '@stripe/stripe-js';
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
export default function Checkout() {
const handleCheckout = async () => {
const stripe = await stripePromise;
const { sessionId } = await fetch('/api/checkout').then(res => res.json());
await stripe.redirectToCheckout({ sessionId });
};
return <button onClick={handleCheckout}>Checkout</button>;
} import { useState, useEffect } from 'react';
import { Bar } from 'react-chartjs-2';
export default function Dashboard() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('/api/dashboard-data').then(res => res.json()).then(setData);
}, []);
if (!data) return <div>Loading...</div>;
return (
<div>
<h1>Dashboard</h1>
<Bar data={data} />
</div>
);
} from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
@app.post('/items')
def create_item(item: Item):
return {'id': 1, **item.dict()}
@app.get('/items/{item_id}')
def read_item(item_id: int):
return {'id': item_id, 'name': 'Example Item', 'price': 9.99} import { useState, useEffect } from 'react';
export function useKodu(prompt: string) {
const [response, setResponse] = useState('');
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
setIsLoading(true);
fetch('/api/kodu', {
method: 'POST',
body: JSON.stringify({ prompt }),
})
.then(res => res.json())
.then(data => {
setResponse(data.response);
setIsLoading(false);
});
}, [prompt]);
return { response, isLoading };
} module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {
colors: {
kodu: {
light: '#f0f4f8',
dark: '#102a43',
},
},
},
},
variants: {
extend: {},
},
plugins: [],
} FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
projects Project[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Project {
id Int @id @default(autoincrement())
name String
user User @relation(fields: [userId], references: [id])
userId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
} module.exports = {
reactStrictMode: true,
images: {
domains: ['kodu.ai'],
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config;
},
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true,
},
];
},
} import { loadStripe } from '@stripe/stripe-js';
const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
export default function Checkout() {
const handleCheckout = async () => {
const stripe = await stripePromise;
const { sessionId } = await fetch('/api/checkout').then(res => res.json());
await stripe.redirectToCheckout({ sessionId });
};
return <button onClick={handleCheckout}>Checkout</button>;
} import { useState, useEffect } from 'react';
import { Bar } from 'react-chartjs-2';
export default function Dashboard() {
const [data, setData] = useState(null);
useEffect(() => {
fetch('/api/dashboard-data').then(res => res.json()).then(setData);
}, []);
if (!data) return <div>Loading...</div>;
return (
<div>
<h1>Dashboard</h1>
<Bar data={data} />
</div>
);
} from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
@app.post('/items')
def create_item(item: Item):
return {'id': 1, **item.dict()}
@app.get('/items/{item_id}')
def read_item(item_id: int):
return {'id': item_id, 'name': 'Example Item', 'price': 9.99} import { useState, useEffect } from 'react';
export function useKodu(prompt: string) {
const [response, setResponse] = useState('');
const [isLoading, setIsLoading] = useState(false);
useEffect(() => {
setIsLoading(true);
fetch('/api/kodu', {
method: 'POST',
body: JSON.stringify({ prompt }),
})
.then(res => res.json())
.then(data => {
setResponse(data.response);
setIsLoading(false);
});
}, [prompt]);
return { response, isLoading };
} module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {
colors: {
kodu: {
light: '#f0f4f8',
dark: '#102a43',
},
},
},
},
variants: {
extend: {},
},
plugins: [],
} FROM node:14
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"] datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
projects Project[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Project {
id Int @id @default(autoincrement())
name String
user User @relation(fields: [userId], references: [id])
userId Int
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
} module.exports = {
reactStrictMode: true,
images: {
domains: ['kodu.ai'],
},
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config;
},
async redirects() {
return [
{
source: '/old-page',
destination: '/new-page',
permanent: true,
},
];
},
}