Quickstart
This guide will help you set up the Seguros NAG project on your local machine and start developing.Prerequisites
Before you begin, ensure you have the following installed:- Node.js (LTS version recommended)
- npm (comes with Node.js)
- Git for version control
Getting Started
Install dependencies
Install all required packages using npm:This command installs all dependencies defined in
package.json, including:- Next.js 16.1.6
- React 19.2.3
- TypeScript 5
- Tailwind CSS 4
- Nodemailer for email functionality
- Testing libraries (Vitest, React Testing Library)
Configure environment variables
Create a
.env.local file in the root directory for email configuration:The email API route at
app/api/enviar-email/route.ts uses these credentials to send quote submissions via Gmail.Available Scripts
The project includes several npm scripts defined inpackage.json:
Script Details
dev- Starts Next.js development server with hot reloadbuild- Creates an optimized production buildstart- Runs the production server (requiresbuildfirst)lint- Runs ESLint to check code qualitytest- Executes Vitest test suite
Project Structure
Understanding the key directories will help you navigate the codebase:app/ Directory
The main application code using Next.js App Router:
lib/ Directory
Shared utilities and configuration:
segurosConfig.ts file defines all insurance types (automotor, vida, hogar, etc.) with their respective form fields, validation rules, and options.
public/ Directory
Static assets served directly:
Configuration Files
next.config.ts- Next.js configurationtsconfig.json- TypeScript compiler optionstailwind.config.js- Tailwind CSS customizationvitest.config.ts- Vitest test runner configurationeslint.config.mjs- ESLint rules
Key Features to Explore
Quote Form System
The quote form system is powered by the configuration inlib/segurosConfig.ts:42-150. Each insurance type has:
- Custom field definitions
- Type-specific validation (min/max values, required fields)
- Dropdown options for selections
- Dynamic rendering based on insurance type
Email Templates
Email submissions are handled by the API route atapp/api/enviar-email/route.ts:4-123. The route:
- Accepts POST requests with quote data
- Generates branded HTML emails with gradient styling
- Includes WhatsApp contact links with Argentina country code
- Uses Nodemailer with Gmail SMTP
Layout and Metadata
The root layout atapp/layout.tsx:58-76 configures:
- Geist font families
- Open Graph metadata for social sharing
- Favicon and Apple touch icons
- Vercel Analytics integration
- Global components (Header, Footer, WhatsApp button)
Next Steps
Now that you have the project running:- Explore the homepage at
app/page.tsx - Test the quote form at
/cotizacion - Review the insurance configuration in
lib/segurosConfig.ts - Check out the reusable components in
app/components/
Remember to configure your
.env.local file with valid Gmail credentials to test the email functionality.