Compare commits

15 Commits

Author SHA1 Message Date
SoniaNvm
3bc20ea40d attempt at metadata grabbing 2026-02-02 02:27:09 -08:00
Severian
d35d704ce1 chore: 2.2 2026-01-30 18:22:16 +08:00
Severian
549d94fe85 Merge pull request #7 from chill-protocol/webp-link
Option for webp file name or character image URL inputs
2025-12-21 12:41:20 +08:00
bdde78475e Added the option to directly input webp file name or character image link when creating PNG for character cards 2025-12-21 09:44:53 +13:00
Ema
06d8b2e36c Merge pull request #6 from severian-dev/docker-next-standalone
Docker next standalone
2025-12-10 22:37:39 -05:00
Ema
59acc534fa Cleaning readme. 2025-12-10 22:34:29 -05:00
Ema
fdd13085c3 Removing runtime env 2025-12-10 22:31:54 -05:00
Severian
8923bf3f63 chore: prod env, no sourcemaps 2025-12-11 08:42:20 +08:00
Ema P.
a02087915b Standalone Readme Editing 2025-12-10 12:38:10 -05:00
Ema P.
e6e230ab84 Building image from .next standalone server. 2025-12-10 10:55:35 -05:00
Ema P.
b3aece1e41 Adding next.config.js for standalone. 2025-12-10 10:52:36 -05:00
Ema
24441720d6 Merge pull request #5 from leri-a/master
Updating base image
2025-12-10 09:42:29 -05:00
Ema P.
2fc4e419b2 Updating base image 2025-12-10 09:39:17 -05:00
Severian
95f5a3e725 chore: 2.1 2025-12-10 08:27:22 +08:00
Severian
f99985ad6c chore: deps 2025-12-09 10:40:18 +08:00
20 changed files with 2598 additions and 1546 deletions

5
.env Normal file
View File

@@ -0,0 +1,5 @@
# Environment Variables for Sucker
# Disable Discord community banner (optional)
# Uncomment the line below to hide the Discord banner
NEXT_PUBLIC_DISABLE_DISCORD_BANNER=true

47
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,47 @@
# Copilot Instructions for sucker.severian.dev
## Project Overview
- This is a Next.js project with a custom proxy API and UI components, using Tailwind CSS and PostCSS for styling.
- The main app logic is in `src/app/`, with global styles in `globals.css` and layout in `layout.tsx`.
- API routes are under `src/app/api/proxy/`, including image proxying (`image/route.ts`).
- UI components are in `src/components/ui/` and utility functions in `src/components/lib/`.
## Architecture & Data Flow
- The app uses Next.js routing and API routes for backend logic. The proxy API handles requests to external services, including image fetching and transformation.
- UI components follow a modular pattern, with reusable elements (e.g., `button.tsx`, `card.tsx`).
- Data flows from API routes to UI via React props and hooks. No global state management library is present.
## Developer Workflows
- **Build & Dev:** Use `npm run dev` to start the development server. Check `package.json` for other scripts.
- **Styling:** Tailwind CSS is configured via `tailwind.config.js` and PostCSS via `postcss.config.js`.
- **API:** Custom logic for proxying and image handling is in `src/app/api/proxy/`. Review these files for request/response patterns.
- **No test suite detected.** If adding tests, follow Next.js and React conventions.
## Project-Specific Conventions
- API routes use Next.js `route.ts` files, with custom logic for proxying and image manipulation.
- UI components are colocated in `src/components/ui/` and use Tailwind utility classes.
- Utility functions (e.g., PNG handling) are in `src/components/lib/`.
- Minimal documentation; refer to code for implementation details.
- Changelog is maintained in `README.md`.
## Integration Points & External Dependencies
- Relies on Next.js, React, Tailwind CSS, and PostCSS.
- External requests are proxied via custom API routes.
- Docker support via `docker-compose.yml` and `dockerfile` for containerization.
## Examples
- To add a new API route: create a `route.ts` under `src/app/api/yourroute/`.
- To add a new UI component: place a `.tsx` file in `src/components/ui/` and use Tailwind for styling.
- For image processing, review `src/app/api/proxy/image/route.ts` and `src/components/lib/png.ts`.
## Key Files & Directories
- `src/app/` — Main app logic and API routes
- `src/components/ui/` — UI components
- `src/components/lib/` — Utility functions
- `tailwind.config.js`, `postcss.config.js` — Styling configuration
- `docker-compose.yml`, `dockerfile` — Containerization
- `README.md` — Changelog and minimal project notes
---
If any section is unclear or missing important project-specific details, please provide feedback to improve these instructions.

9
.gitignore vendored
View File

@@ -1,2 +1,9 @@
.idea/
bun.lock
.env
node_modules node_modules
.next .next
.env.local
.env*.local
.env

View File

@@ -1,9 +1,24 @@
# Sucker # Sucker
Check package.json for commands, I can't be bothered. ### Environment Variables
Add these to your `.env.local` file (optional):
```bash
# Disable Discord community banner (defaults to showing banner)
NEXT_PUBLIC_DISABLE_DISCORD_BANNER=true
```
### Usage
Pull this repostory and build with `npm run build`. You can start the server with `node ./.next/standalone/server.js`
You can also build and run Sucker as a Docker container with `docker compose build` and `docker compose up`.
### Changelog ### Changelog
- 2.2: Added support for directly inputting webp file names or character image links when creating PNG character cards
- 2.1: updated deps, note about image fetching, list of mirrors
- 2.0: from Tui: Multimessage support! Tracks changes to character descriptions and scenarios across multiple extractions. Shows version badges, message counts, and provides detailed change history viewer. - 2.0: from Tui: Multimessage support! Tracks changes to character descriptions and scenarios across multiple extractions. Shows version badges, message counts, and provides detailed change history viewer.
- also 2.0: V2 charcard format and alternate greetings. - also 2.0: V2 charcard format and alternate greetings.
- 1.9: Not again. They changed stuff again. What is this? - 1.9: Not again. They changed stuff again. What is this?

View File

@@ -3,6 +3,4 @@ services:
build: . build: .
image: sucker image: sucker
ports: ports:
- "3000:3000" - "3000:3000"
environment:
NODE_ENV: production

View File

@@ -1,7 +1,5 @@
FROM node:18-alpine AS base FROM node:22-alpine AS base
WORKDIR /app WORKDIR /app
FROM base AS deps FROM base AS deps
COPY package.json package-lock.json* yarn.lock* pnpm-lock.yaml* ./ COPY package.json package-lock.json* yarn.lock* pnpm-lock.yaml* ./
RUN \ RUN \
@@ -12,23 +10,22 @@ RUN \
fi fi
FROM base AS builder FROM base AS builder
WORKDIR /app
ENV NODE_ENV=production
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
RUN npm run build RUN npm run build
FROM base AS runner FROM node:22-alpine AS runner
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
WORKDIR /app WORKDIR /app
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
USER nextjs USER nextjs
EXPOSE 3000 EXPOSE 3000
CMD ["npm", "start"] CMD ["node", "server.js"]

3
next-env.d.ts vendored
View File

@@ -1,5 +1,6 @@
/// <reference types="next" /> /// <reference types="next" />
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

7
next.config.js Normal file
View File

@@ -0,0 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
productionBrowserSourceMaps: false,
};
module.exports = nextConfig;

2297
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,10 +12,11 @@
"@radix-ui/react-accordion": "^1.2.2", "@radix-ui/react-accordion": "^1.2.2",
"@radix-ui/react-collapsible": "^1.1.2", "@radix-ui/react-collapsible": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.4", "@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.16",
"@radix-ui/react-separator": "^1.1.1", "@radix-ui/react-separator": "^1.1.1",
"@radix-ui/react-slot": "^1.1.1", "@radix-ui/react-slot": "^1.1.1",
"@types/react": "^18.2.39", "@types/react": "^19.2.7",
"@types/react-dom": "^18.2.17", "@types/react-dom": "^19.2.3",
"axios": "^1.6.2", "axios": "^1.6.2",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
@@ -23,9 +24,9 @@
"crc-32": "^1.2.2", "crc-32": "^1.2.2",
"html2canvas": "^1.4.1", "html2canvas": "^1.4.1",
"lucide-react": "^0.471.0", "lucide-react": "^0.471.0",
"next": "^14.0.3", "next": "^16.0.7",
"react": "^18.2.0", "react": "^19.2.1",
"react-dom": "^18.2.0", "react-dom": "^19.2.1",
"tailwind-merge": "^2.6.0", "tailwind-merge": "^2.6.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"typescript": "^5.3.2" "typescript": "^5.3.2"

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
public/avalon/bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,110 @@
"use client";
import Image from "next/image";
interface DiscordBannerPermanentProps {
inviteLink: string;
serverName?: string;
description?: string;
ctaText?: string;
}
export function DiscordBannerPermanent({
inviteLink,
serverName = "Avalon",
description = "Looking for somewhere more... interesting? Avalon's an enchanted collective of botmakers who refuse to be boring 🌿 Come play with us~ (18+ only, darling)",
ctaText = "Join Server",
}: DiscordBannerPermanentProps) {
return (
<div className="relative rounded-lg overflow-hidden shadow-lg mb-4 bg-[#36393f]">
{/* Background Image */}
<div className="absolute inset-0">
<Image
src="/avalon/bg.webp"
alt="Background"
fill
className="object-cover opacity-20"
/>
</div>
{/* Content */}
<div className="relative p-3 sm:p-4">
{/* Chat Message Style */}
<div className="flex gap-3 mb-2">
{/* Morgana Avatar */}
<div className="flex-shrink-0 pt-0.5">
<Image
src="/avalon/morgana-thumb.webp"
alt="Morgana"
width={40}
height={40}
className="rounded-full w-10 h-10"
/>
</div>
{/* Message Content */}
<div className="flex-1 min-w-0">
<div className="flex items-baseline gap-2 mb-0.5">
<span className="text-white font-medium text-[15px]">Morgana</span>
<span className="text-[#a3a6aa] text-[11px] font-medium">Today at {new Date().toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true })}</span>
</div>
<div className="text-[#dcddde] text-[15px] leading-[1.375rem] mb-2">
{description}
</div>
{/* Server Invite Embed */}
<div className="bg-[#2f3136] rounded border-l-4 border-[#5865F2] overflow-hidden max-w-[432px]">
<div className="p-4 pb-3">
<div className="text-[#00b0f4] text-xs font-semibold uppercase mb-2">
You&apos;ve been invited to join a server
</div>
<div className="flex items-center gap-4">
<Image
src="/avalon/avalon-pfp.webp"
alt="Avalon"
width={50}
height={50}
className="rounded-2xl w-[50px] h-[50px] flex-shrink-0"
/>
<div className="flex-1 min-w-0">
<div className="text-white font-semibold text-base mb-0.5">{serverName}</div>
<div className="text-[#b9bbbe] text-sm space-y-0.5">
<div className="font-medium">67 members</div>
<a
href="https://from-avalon.com"
target="_blank"
rel="noopener noreferrer"
className="text-[#00aff4] hover:underline text-xs inline-block"
>
from-avalon.com
</a>
</div>
</div>
<a
href={inviteLink}
target="_blank"
rel="noopener noreferrer"
className="bg-[#248046] hover:bg-[#1a6334] text-white px-4 py-2 text-sm rounded font-medium transition-colors flex-shrink-0"
>
{ctaText}
</a>
</div>
</div>
</div>
</div>
</div>
{/* Trash Panda Icon - Bottom Right */}
<div className="absolute bottom-1.5 right-1.5">
<Image
src="/avalon/trashpanda.webp"
alt=""
width={20}
height={20}
className="rounded-full w-5 h-5 ring-1 ring-black/20 opacity-60 hover:opacity-100 transition-opacity"
/>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,41 @@
"use client";
import * as React from "react";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
const DropdownMenu = DropdownMenuPrimitive.Root;
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
const DropdownMenuContent = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
>(({ className = "", sideOffset = 4, ...props }, ref) => (
<DropdownMenuPrimitive.Portal>
<DropdownMenuPrimitive.Content
ref={ref}
sideOffset={sideOffset}
className={`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ${className}`}
{...props}
/>
</DropdownMenuPrimitive.Portal>
));
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
const DropdownMenuItem = React.forwardRef<
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
inset?: boolean;
}
>(({ className = "", inset, ...props }, ref) => (
<DropdownMenuPrimitive.Item
ref={ref}
className={`relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 ${
inset ? "pl-8" : ""
} ${className}`}
{...props}
/>
));
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem };

View File

@@ -2,8 +2,14 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"target": "es5", "target": "es5",
"lib": ["dom", "dom.iterable", "esnext"], "lib": [
"types": ["node"], "dom",
"dom.iterable",
"esnext"
],
"types": [
"node"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": true, "strict": true,
@@ -13,7 +19,7 @@
"moduleResolution": "bundler", "moduleResolution": "bundler",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "react-jsx",
"incremental": true, "incremental": true,
"plugins": [ "plugins": [
{ {
@@ -21,9 +27,19 @@
} }
], ],
"paths": { "paths": {
"@/*": ["./src/*"] "@/*": [
"./src/*"
]
} }
}, },
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "include": [
"exclude": ["node_modules"] "next-env.d.ts",
} "**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}