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

LLM Chat #2

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ NEXTAUTH_URL=http://localhost:4002

# You can use openssl to generate a random 32 character key: openssl rand -base64 32
NEXTAUTH_SECRET=rZTFtfNuSMajLnfFrWT2PZ3lX8WZv7W/Xs2H8hkEY6g=
[email protected]:999login

# SMTP / Email settings
SMTP_HOST=
Expand All @@ -11,7 +12,7 @@ SMTP_PASSWORD=
SMTP_FROM=

# If you are using Docker, you can retrieve the values from: docker-compose.yml
DATABASE_URL=postgresql://<USER-HERE>:<PASSWORD-HERE>@localhost:5432/<DATABASE NAME HERE>
DATABASE_URL=postgresql://admin:admin@localhost:5432/saas-starter-kit

APP_URL=http://localhost:4002

Expand All @@ -29,7 +30,7 @@ RETRACED_API_KEY=
RETRACED_PROJECT_ID=

# Hide landing page and redirect to login page
HIDE_LANDING_PAGE=false
HIDE_LANDING_PAGE=true

# SSO groups can be prefixed with this identifier in order to avoid conflicts with other groups.
# For example boxyhq-admin would be resolved to admin, boxyhq-member would be resolved to member, etc.
Expand Down
76 changes: 76 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
ARG NODEJS_IMAGE=node:20.18.1-alpine3.19
FROM --platform=$BUILDPLATFORM $NODEJS_IMAGE AS base

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json package-lock.json ./
COPY prisma ./prisma
RUN npm install
RUN npm rebuild --arch=x64 --platform=linux --libc=musl sharp

# Generate prisma client for production
RUN npx prisma generate

# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app

COPY --from=deps /app/node_modules ./node_modules
COPY . .

ENV NEXT_TELEMETRY_DISABLED=1
ENV NEXT_PUBLIC_TERMS_URL=https://boxyhq.com/terms.html
ENV NEXT_PUBLIC_PRIVACY_URL=https://boxyhq.com/privacy.html
ENV NEXT_PUBLIC_DARK_MODE=false
ENV NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LfsAbMoAAAAAIl_yao0rxsz1IWk0UaYp2ofpNiy
ENV NEXT_PUBLIC_MIXPANEL_TOKEN=64202bc81e38778793e3959c16aa9704
ENV NEXT_PUBLIC_SUPPORT_URL="mailto:[email protected]"

RUN npm run build-ci


# Production image, copy all the files and run next
FROM $NODEJS_IMAGE AS runner
WORKDIR /app

ENV NODE_OPTIONS="--max-http-header-size=81920 --dns-result-order=ipv4first"


ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs


COPY --from=builder /app/public ./public
COPY --from=builder /app/prisma ./prisma

COPY --from=builder /app/sync-stripe.js ./sync-stripe.js
COPY --from=builder /app/delete-team.js ./delete-team.js

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
RUN npm i -g json
# Print the value of devDependencies.prisma
RUN echo "Prisma Version: $(cat ./package.json| json devDependencies.prisma)"

RUN npm i -g prisma@$(cat ./package.json| json devDependencies.prisma)

RUN apk add --no-cache postgresql-client

ENV PORT=4002

USER nextjs

EXPOSE 4002

CMD ["node", "server.js"]
5 changes: 3 additions & 2 deletions components/account/ManageSessions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import useSWR from 'swr';
import { useState } from 'react';
import { useTranslation } from 'next-i18next';
import { ComputerDesktopIcon } from '@heroicons/react/24/outline';
import { Laptop } from 'lucide-react';

import toast from 'react-hot-toast';

import fetcher from '@/lib/fetcher';
Expand Down Expand Up @@ -75,7 +76,7 @@ const ManageSessions = () => {
wrap: true,
element: (
<span className="items-center flex">
<ComputerDesktopIcon className="w-6 h-6 inline-block mr-1 text-primary" />
<Laptop className="w-6 h-6 inline-block mr-1 text-primary" />
{session.isCurrent ? t('this-browser') : t('other')}
</span>
),
Expand Down
2 changes: 1 addition & 1 deletion components/account/UpdateAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface UpdateAccountProps {

const UpdateAccount = ({ user, allowEmailChange }: UpdateAccountProps) => {
return (
<div className="flex gap-6 flex-col">
<div className="flex gap-6 p-3 flex-col">
<UpdateName user={user} />
<UpdateEmail user={user} allowEmailChange={allowEmailChange} />
<UploadAvatar user={user} />
Expand Down
4 changes: 2 additions & 2 deletions components/account/UpdateTheme.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChevronUpDownIcon } from '@heroicons/react/24/outline';
import { ChevronsUpDown } from 'lucide-react';

import { Card } from '@/components/shared';
import useTheme from 'hooks/useTheme';
Expand All @@ -23,7 +23,7 @@ const UpdateTheme = () => {
<div className="flex items-center gap-2">
<selectedTheme.icon className="w-5 h-5" /> {selectedTheme.name}
</div>
<ChevronUpDownIcon className="w-5 h-5" />
<ChevronsUpDown className="w-5 h-5" />
</div>
<ul
tabIndex={0}
Expand Down
4 changes: 2 additions & 2 deletions components/account/UploadAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import toast from 'react-hot-toast';
import { Button } from 'react-daisyui';
import { useTranslation } from 'next-i18next';
import React, { useState, useEffect, useCallback } from 'react';
import { ArrowUpCircleIcon } from '@heroicons/react/24/outline';
import { CircleArrowUp } from 'lucide-react';

import type { ApiResponse } from 'types';
import type { User } from '@prisma/client';
Expand Down Expand Up @@ -129,7 +129,7 @@ const UploadAvatar = ({ user }: { user: Partial<User> }) => {
: 'group-hover:bg-gray-50'
}`}
>
<ArrowUpCircleIcon
<CircleArrowUp
className={`${
dragActive ? 'scale-110' : 'scale-100'
} h-50 w-50 text-gray-500 transition-all duration-75 group-hover:scale-110 group-active:scale-95`}
Expand Down
4 changes: 2 additions & 2 deletions components/billing/Help.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'next/link';
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/24/outline';
import { SquareArrowOutUpRight } from 'lucide-react';
import { useTranslation } from 'next-i18next';

import { Card } from '@/components/shared';
Expand All @@ -22,7 +22,7 @@ const Help = () => {
rel="noopener noreferrer"
>
{t('contact-support')}
<ArrowTopRightOnSquareIcon className="w-5 h-5 ml-2" />
<SquareArrowOutUpRight className="w-5 h-5 ml-2" />
</Link>
</div>
</Card.Body>
Expand Down
4 changes: 2 additions & 2 deletions components/billing/LinkToPortal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import toast from 'react-hot-toast';
import { Button } from 'react-daisyui';
import { useState } from 'react';
import { ArrowTopRightOnSquareIcon } from '@heroicons/react/24/outline';
import { SquareArrowOutUpRight } from 'lucide-react';
import { useTranslation } from 'next-i18next';

import { Card } from '@/components/shared';
Expand Down Expand Up @@ -57,7 +57,7 @@ const LinkToPortal = ({ team }: LinkToPortalProps) => {
onClick={() => openStripePortal()}
>
{t('billing-portal')}
<ArrowTopRightOnSquareIcon className="w-5 h-5 ml-2" />
<SquareArrowOutUpRight className="w-5 h-5 ml-2" />
</Button>
</div>
</Card.Body>
Expand Down
Loading