├── .modified ├── docs ├── logo.png ├── screenshots │ ├── export.png │ ├── ai-editor.png │ └── main-view.png └── blueprint.md ├── favicon.ico.png ├── .vscode ├── extensions.json └── settings.json ├── src ├── app │ ├── favicon.ico │ ├── page.tsx │ ├── [locale] │ │ ├── page.tsx │ │ └── layout.tsx │ ├── layout.tsx │ ├── api │ │ └── ai-generate │ │ │ └── route.ts │ └── globals.css ├── ai │ ├── dev.ts │ ├── genkit.ts │ └── flows │ │ ├── section-suggester-flow.ts │ │ └── pdf-processor-flow.ts ├── lib │ ├── utils.ts │ ├── types.ts │ └── constants.ts ├── locales │ ├── server.ts │ ├── client.ts │ └── i18n.ts ├── components │ ├── ui │ │ ├── skeleton.tsx │ │ ├── textarea.tsx │ │ ├── label.tsx │ │ ├── input.tsx │ │ ├── progress.tsx │ │ ├── separator.tsx │ │ ├── toaster.tsx │ │ ├── checkbox.tsx │ │ ├── slider.tsx │ │ ├── switch.tsx │ │ ├── badge.tsx │ │ ├── tooltip.tsx │ │ ├── popover.tsx │ │ ├── avatar.tsx │ │ ├── radio-group.tsx │ │ ├── alert.tsx │ │ ├── scroll-area.tsx │ │ ├── tabs.tsx │ │ ├── card.tsx │ │ ├── accordion.tsx │ │ ├── button.tsx │ │ ├── calendar.tsx │ │ ├── table.tsx │ │ ├── dialog.tsx │ │ ├── sheet.tsx │ │ ├── form.tsx │ │ ├── alert-dialog.tsx │ │ ├── toast.tsx │ │ ├── select.tsx │ │ ├── dropdown-menu.tsx │ │ ├── menubar.tsx │ │ └── chart.tsx │ ├── SectionsManager.tsx │ ├── TagInput.tsx │ ├── WysiwygEditor.tsx │ ├── SectionItemCard.tsx │ ├── ImageUploader.tsx │ ├── GeneralInfoPanel.tsx │ ├── MarkdownEditor.tsx │ ├── ApiKeyConfigModal.tsx │ └── AboutModal.tsx ├── hooks │ ├── useWriteUp.ts │ ├── use-mobile.tsx │ └── use-toast.ts └── middleware.ts ├── ctf_writeup_builder-main.code-workspace ├── postcss.config.mjs ├── components.json ├── .gitignore ├── tsconfig.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT_ES.md ├── .idx └── dev.nix ├── CONTRIBUTING_ES.md ├── SECURITY.md ├── SECURITY_ES.md ├── package.json ├── tailwind.config.ts ├── next.config.mjs ├── USER_GUIDE.md └── GUIA_USUARIO.md /.modified: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/docs/logo.png -------------------------------------------------------------------------------- /favicon.ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/favicon.ico.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "github.copilot" 4 | ] 5 | } -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /ctf_writeup_builder-main.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ] 7 | } -------------------------------------------------------------------------------- /docs/screenshots/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/docs/screenshots/export.png -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IDX.aI.enableInlineCompletion": true, 3 | "IDX.aI.enableCodebaseIndexing": true 4 | } -------------------------------------------------------------------------------- /docs/screenshots/ai-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/docs/screenshots/ai-editor.png -------------------------------------------------------------------------------- /docs/screenshots/main-view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ilanami/ctf_writeup_builder/HEAD/docs/screenshots/main-view.png -------------------------------------------------------------------------------- /src/ai/dev.ts: -------------------------------------------------------------------------------- 1 | // Flows will be imported for their side effects in this file. 2 | import '@/ai/flows/section-suggester-flow'; 3 | -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { clsx, type ClassValue } from "clsx" 2 | import { twMerge } from "tailwind-merge" 3 | 4 | export function cn(...inputs: ClassValue[]) { 5 | return twMerge(clsx(inputs)) 6 | } 7 | -------------------------------------------------------------------------------- /src/ai/genkit.ts: -------------------------------------------------------------------------------- 1 | import {genkit} from 'genkit'; 2 | import {googleAI} from '@genkit-ai/googleai'; 3 | 4 | export const ai = genkit({ 5 | plugins: [googleAI()], 6 | model: 'googleai/gemini-1.5-pro', 7 | }); 8 | -------------------------------------------------------------------------------- /src/locales/server.ts: -------------------------------------------------------------------------------- 1 | // src/locales/server.ts 2 | import { createI18nServer } from 'next-international/server'; 3 | 4 | export const { getI18n, getScopedI18n, getCurrentLocale } = createI18nServer({ 5 | en: () => import('./en'), 6 | es: () => import('./es'), 7 | }); 8 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | 2 | // This file is no longer the root page. 3 | // Its content has been moved to src/app/[locale]/page.tsx 4 | // This file can be safely removed. 5 | export default function DeprecatedHomePage() { 6 | return
Please navigate to a localized path like /es or /en.
; 7 | } 8 | -------------------------------------------------------------------------------- /src/components/ui/skeleton.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from "@/lib/utils" 2 | 3 | function Skeleton({ 4 | className, 5 | ...props 6 | }: React.HTMLAttributes) { 7 | return ( 8 |
12 | ) 13 | } 14 | 15 | export { Skeleton } 16 | -------------------------------------------------------------------------------- /src/app/[locale]/page.tsx: -------------------------------------------------------------------------------- 1 | // src/app/[locale]/page.tsx 2 | import { WriteUpProvider } from '@/contexts/WriteUpContext'; 3 | import { AppLayout } from '@/components/AppLayout'; 4 | 5 | export default async function HomePage({ params }: { params: Promise<{ locale: string }> }) { 6 | const { locale } = await params; 7 | return ( 8 | 9 | 10 | 11 | ); 12 | } 13 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import { redirect } from 'next/navigation'; 2 | 3 | export default function RootLayout({ 4 | children, 5 | }: { 6 | children: React.ReactNode; 7 | }) { 8 | // Si estamos en la raíz, redirigir a /en 9 | if (typeof window !== 'undefined' && window.location.pathname === '/') { 10 | redirect('/en'); 11 | } 12 | 13 | // Si no estamos en la raíz, mostrar el contenido 14 | return children; 15 | } -------------------------------------------------------------------------------- /src/hooks/useWriteUp.ts: -------------------------------------------------------------------------------- 1 | 2 | "use client"; 3 | 4 | import * as React from 'react'; // Changed import 5 | import { WriteUpContext } from '@/contexts/WriteUpContext'; 6 | 7 | export const useWriteUp = () => { 8 | const context = React.useContext(WriteUpContext); // Changed useContext 9 | if (context === undefined) { 10 | throw new Error('useWriteUp must be used within a WriteUpProvider'); 11 | } 12 | return context; 13 | }; 14 | -------------------------------------------------------------------------------- /components.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://ui.shadcn.com/schema.json", 3 | "style": "default", 4 | "rsc": true, 5 | "tsx": true, 6 | "tailwind": { 7 | "config": "tailwind.config.ts", 8 | "css": "src/app/globals.css", 9 | "baseColor": "neutral", 10 | "cssVariables": true, 11 | "prefix": "" 12 | }, 13 | "aliases": { 14 | "components": "@/components", 15 | "utils": "@/lib/utils", 16 | "ui": "@/components/ui", 17 | "lib": "@/lib", 18 | "hooks": "@/hooks" 19 | }, 20 | "iconLibrary": "lucide" 21 | } -------------------------------------------------------------------------------- /src/middleware.ts: -------------------------------------------------------------------------------- 1 | 2 | // src/middleware.ts 3 | import { createI18nMiddleware } from 'next-international/middleware'; 4 | import type { NextRequest } from 'next/server'; 5 | 6 | const I18nMiddleware = createI18nMiddleware({ 7 | locales: ['en', 'es'], 8 | defaultLocale: 'es', 9 | urlMappingStrategy: 'rewrite', 10 | }); 11 | 12 | export function middleware(request: NextRequest) { 13 | return I18nMiddleware(request); 14 | } 15 | 16 | export const config = { 17 | matcher: ['/((?!api|_next/static|_next/image|favicon.ico|.*\\..*).*)'], 18 | }; 19 | -------------------------------------------------------------------------------- /src/hooks/use-mobile.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react" 2 | 3 | const MOBILE_BREAKPOINT = 768 4 | 5 | export function useIsMobile() { 6 | const [isMobile, setIsMobile] = React.useState(undefined) 7 | 8 | React.useEffect(() => { 9 | const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) 10 | const onChange = () => { 11 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 12 | } 13 | mql.addEventListener("change", onChange) 14 | setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) 15 | return () => mql.removeEventListener("change", onChange) 16 | }, []) 17 | 18 | return !!isMobile 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # vercel 34 | .vercel 35 | 36 | # typescript 37 | *.tsbuildinfo 38 | next-env.d.ts 39 | 40 | .genkit/* 41 | .env* 42 | 43 | # firebase 44 | firebase-debug.log 45 | firestore-debug.log -------------------------------------------------------------------------------- /src/locales/client.ts: -------------------------------------------------------------------------------- 1 | // src/locales/client.ts 2 | 'use client'; 3 | import { createI18nClient } from 'next-international/client'; 4 | 5 | // Importamos los tipos de los archivos de locale para una mejor inferencia de tipos 6 | // Asegúrate de que tus archivos en y es exporten 'default' y estén marcados con 'as const' 7 | // Ejemplo: export default { greeting: "Hello" } as const; 8 | export const { 9 | useI18n, 10 | useScopedI18n, 11 | I18nProviderClient, 12 | useCurrentLocale, 13 | // Si necesitas cambiar de locale en el cliente, también puedes exportar useChangeLocale 14 | useChangeLocale, 15 | } = createI18nClient({ 16 | en: () => import('./en'), 17 | es: () => import('./es'), 18 | }); 19 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./src/*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /src/components/ui/textarea.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import {cn} from '@/lib/utils'; 4 | 5 | const Textarea = React.forwardRef>( 6 | ({className, ...props}, ref) => { 7 | return ( 8 |