How l3anav/generador-links works
Project type and purpose
• This is a single-page web application (React + Vite) whose purpose is to let end users fill out a form, preview a personalized “link page” (like linktr.ee), and then download a ZIP of static files.
• It relies on an external REST API (deployed on Render.com) for any server-side link generation or templating logic.
File structure
• Top-level config: .eslintrc.cjs, vite.config.js, vercel.json → build + deployment
• public/index.html → SPA entrypoint
• src/
• main.jsx → app bootstrap (ReactDOM.render, router setup)
• App.jsx → root component with Wouter routing
• pages/ → home page, preview page (styled with styled-components)
• components/ → reusable pieces (Formulario form, Links list, etc.)
• store/useStore.jsx → global state management (Zustand)
• svg/, font/, theme.css, loader.css → static assets + theming
• package.json → key dependencies: react, vite, styled-components, wouter, react-hook-form, react-select, zustand, file-saver
Insights from README
• Describes evolution from CLI to web app
• Points to external “mis-links-generador” API
• Emphasizes download via File-Saver (client-side ZIP)
• Deployed on Vercel, uses pnpm
a. Main components
• User’s Browser / Client UI
• React SPA (grouped into Routing, Pages, Components, Store, Utils)
• External REST API service (mis-links-generador)
• File generation library (File-Saver in the browser)
• CDN / Static hosting (Vercel or GitHub Pages)
b. Relationships and data flow
1. Browser loads the SPA from Vercel/GitHub Pages
2. User navigates via Wouter router → Home page → fills Formulario (React Hook Form + react-select)
3. Form submission triggers onSubmit util → optionally posts data to External API → receives template or metadata
4. Preview page renders links list (Links.jsx) using styled-components
5. Download action uses File-Saver to generate and download a ZIP of static HTML/CSS/JS files
c. Architectural patterns & design principles
• Component-based UI (React) with clear separation: Pages vs. shared Components
• Unidirectional data flow: Form → Store → Preview
• Hooks for state (Zustand) and form handling (React Hook Form)
• Utility modules for pure functions (validation, options, handlers)
• Client-side rendering (CSR) with SPA routing (Wouter)
d. Key technologies
• React + Vite (build tool)
• Wouter (routing)
• React Hook Form & React Select (forms)
• Zustand (state management)
• Styled-Components (CSS-in-JS)
• File-Saver (client-side file download)
• External REST API (mis-links-generador)