Prerequisites
Before you begin, ensure you have the following installed:- Node.js (version 14 or higher)
- npm (comes with Node.js) or yarn
- A modern web browser (Chrome, Firefox, Safari, or Edge)
Technology stack
The application is built with:- Next.js 14.1.0 - React framework for production
- React 18 - UI library
- Tailwind CSS 3.3 - Utility-first CSS framework
- jsPDF 2.5.1 - PDF generation library
- html2canvas 1.4.1 - HTML to canvas conversion
- @react-pdf/renderer 3.3.8 - React PDF components
- js-cookie 3.0.5 - Cookie management
- react-cropper 2.3.3 - Image cropping for profile photos
Installation
Install dependencies
Install all required Node.js packages using npm:This command installs all dependencies listed in
package.json:Start the development server
Run the development server:The application will start and be accessible at:
The development server includes hot-reloading, so changes you make to the code will automatically refresh in your browser.
Available scripts
The application includes several npm scripts defined inpackage.json:
Project structure
Understanding the project structure helps with customization:Configuration
Tailwind CSS
The application uses Tailwind CSS with custom configuration:Next.js Configuration
The application uses Next.js 14 with:- App Router (not Pages Router)
- Client-side rendering for forms and interactive components
- Google Fonts integration (Inter, Titillium Web, Courgette, Roboto, Playfair Display)
- Image optimization for profile photos and template previews
Data Storage
The application stores data locally:Development tips
Adding a new CV template
Adding a new CV template
To create a new CV template:
- Create a new directory in
src/app/disenios/(e.g.,cv4/) - Add a
page.jsxfile with your template component - Use the existing CV components from
src/components/informacion/ - Implement the PDF generation using jsPDF and html2canvas:
Customizing form fields
Customizing form fields
Form fields are defined in component state. To add a new field:
- Add state variable in the page component:
- Add the field to the form JSX
- Update the save function to include the new field in the cookie data
- Update the load function to restore the new field value
Styling and theming
Styling and theming
The application uses:
- Tailwind CSS for utility classes
- Custom CSS classes in
globals.css:.Button- Primary button style.Titulo- Section title style.Alerta- Alert/warning text style.MsjExito- Success message style
src/app/globals.css to change the application theme.Troubleshooting
Port 3000 is already in use
Port 3000 is already in use
If port 3000 is occupied, Next.js will automatically try the next available port (3001, 3002, etc.).To specify a different port manually:
PDF generation issues
PDF generation issues
If PDFs are not generating correctly:
- Ensure the
contenido-pdfdiv has fixed dimensions - Check that html2canvas can access all images (CORS issues)
- Verify jsPDF is properly imported
- Test with a simple template first
Cookie/localStorage not persisting
Cookie/localStorage not persisting
Building for production
To create a production-ready build:Deploy to Vercel (recommended)
The easiest way to deploy is using Vercel:
- Push your code to GitHub
- Import the repository in Vercel
- Vercel automatically detects Next.js and configures deployment
- Your application will be live at
your-project.vercel.app
Next steps
- Read the Quick Start Guide to understand the user workflow
- Explore the three CV templates to understand the rendering logic
- Customize the templates to match your design preferences
- Add new form fields for additional CV sections
- Implement additional export formats (Word, plain text)
