Skip to content

ImToon/CV-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CV Builder

A TypeScript-based CV/Resume generator that creates professional PDF documents from JSON data files. Supports multiple languages and customizable templates.

πŸš€ Features

  • βœ… Multi-language support (English, French, or add your own)
  • βœ… Generate professional PDF resumes
  • βœ… JSON-based content management
  • βœ… Customizable HTML template
  • βœ… Environment-based configuration
  • βœ… Automatic results folder creation

πŸ“‹ Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn

πŸ› οΈ Installation

  1. Clone the repository:
git clone <repository-url>
cd builder
  1. Install dependencies:
npm install
  1. Configure environment variables (see Environment Configuration)

  2. Set up your content files (see Content Structure)

βš™οΈ Environment Configuration

Create a .env file in the root directory:

fileName=cv_yourname

Environment Variables

Variable Description Example
fileName Base name for generated PDF files (without language suffix) cv_servais_guillaume

The final PDF will be named: {fileName}_{language}.pdf
Example: cv_servais_guillaume_en.pdf, cv_servais_guillaume_fr.pdf

πŸ“ Content Structure

All content files are located in the content/ directory. You need to create/customize the following files:

1. Experiences (content/experiences/)

Create language-specific files: en.json, fr.json

[
	{
		"title": "Software Developer",
		"place": "Company Name",
		"startDate": "2024-01-01",
		"endDate": null,
		"description": "Brief description of the role",
		"tasks": ["Task or achievement 1", "Task or achievement 2"],
		"technologies": [".NET", "React", "SQL"]
	}
]

Fields:

  • title (string): Job title
  • place (string): Company name
  • startDate (string): ISO date format (YYYY-MM-DD)
  • endDate (string|null): ISO date format or null for current position
  • description (string): Role description
  • tasks (array|null): List of responsibilities or achievements
  • technologies (array): Technologies used (optional, for reference)

2. Skills (content/skills/content.json)

Not language-specific (same for all languages):

["JavaScript", "TypeScript", "React", "Node.js", "SQL"]

3. Languages (content/languages/)

Create language-specific files: en.json, fr.json

[
	{
		"name": "English",
		"level": "C1"
	},
	{
		"name": "French",
		"level": "Native"
	}
]

Fields:

  • name (string): Language name
  • level (string): Proficiency level (A1-C2, Native, etc.)

4. Education (content/educations/)

Create language-specific files: en.json, fr.json

[
	{
		"school": "University Name",
		"place": "City",
		"degree": "Bachelor's in Computer Science",
		"year": "2019 - 2022"
	}
]

Fields:

  • school (string): Institution name
  • place (string): Location
  • degree (string): Degree/qualification
  • year (string): Period or graduation year

5. Certifications (content/certifications/content.json)

Not language-specific:

[
	{
		"title": "AWS Certified Developer",
		"date": "2024-03-15"
	}
]

Fields:

  • title (string): Certification name
  • date (string): ISO date format (YYYY-MM-DD)

6. Hackathons (content/hackathons/)

Create language-specific files: en.json, fr.json

[
	{
		"place": "Hackathon Name 2024",
		"project": "Project Title",
		"description": "Brief project description",
		"date": "2024-06-01",
		"price": "First Place Prize"
	}
]

Fields:

  • place (string): Hackathon name/event
  • project (string): Project name
  • description (string): Project description
  • date (string): ISO date format (YYYY-MM-DD)
  • price (string|null): Award/prize or null

7. Translations (content/translations/)

Create language-specific files: en.json, fr.json

{
	"now": "Present",
	"drivingLicense": "Driver's License",
	"age": "years old",
	"title": "Software Developer",
	"won": "Won"
}

Required Keys:

  • now: Text for current/ongoing positions
  • drivingLicense: Driving license text
  • age: Age suffix text
  • title: Your professional title
  • won: Text for prizes/awards

8. Profile Picture

Place your profile picture at: content/profile_picture.jpg

Recommended: Square image, 500x500px or larger

9. HTML Template

Edit content/base.html to customize the CV layout and styling.

Available placeholders:

  • {{ProfilePicture}} - Base64 encoded profile image
  • {{Title}} - Professional title
  • {{DrivingLicense}} - Driving license text
  • {{Experiences}} - Work experience section
  • {{Languages}} - Languages section
  • {{Skills}} - Skills section
  • {{Educations}} - Education section
  • {{Certifications}} - Certifications section
  • {{Hackathons}} - Hackathons/Projects section

πŸƒ Running the CV Builder

Generate your CV PDFs:

npm run build-cv

This will:

  1. Read all content files
  2. Generate HTML for each language (en, fr)
  3. Convert HTML to PDF using Puppeteer
  4. Save PDFs in the results/ folder

Output

Generated PDFs will be saved as:

  • results/cv_yourname_en.pdf
  • results/cv_yourname_fr.pdf

🌍 Adding More Languages

To add a new language (e.g., Spanish):

  1. Add language files in these directories:

    • content/experiences/es.json
    • content/educations/es.json
    • content/languages/es.json
    • content/hackathons/es.json
    • content/translations/es.json
  2. Update model/LanguageOptions.ts:

export type LanguageOptions = 'fr' | 'en' | 'es';
  1. Update builder.ts:
const languages = ['fr' as LanguageOptions, 'en' as LanguageOptions, 'es' as LanguageOptions];

πŸ“‚ Project Structure

builder/
β”œβ”€β”€ content/              # All CV content
β”‚   β”œβ”€β”€ certifications/
β”‚   β”œβ”€β”€ educations/
β”‚   β”œβ”€β”€ experiences/
β”‚   β”œβ”€β”€ hackathons/
β”‚   β”œβ”€β”€ languages/
β”‚   β”œβ”€β”€ skills/
β”‚   β”œβ”€β”€ translations/
β”‚   β”œβ”€β”€ base.html        # HTML template
β”‚   └── profile_picture.jpg
β”œβ”€β”€ model/               # TypeScript interfaces
β”œβ”€β”€ utils/               # Helper functions
β”œβ”€β”€ results/             # Generated PDFs (auto-created)
β”œβ”€β”€ .env                 # Environment configuration
β”œβ”€β”€ builder.ts           # Main entry point
└── package.json

πŸ”§ Development

Build Script

npm run build-cv

TypeScript Compilation

The project uses tsx for TypeScript execution without pre-compilation.

πŸ“ Tips

  • Date Formats: Always use ISO format (YYYY-MM-DD) for dates
  • Current Position: Set endDate to null for ongoing roles
  • Optional Fields: Set tasks, price, or description to null if not needed
  • Sorting: Experiences are automatically sorted by most recent first
  • Profile Picture: Use JPG format for best compatibility

πŸ› Troubleshooting

"ENOENT: no such file or directory"

  • Make sure all required JSON files exist for your languages
  • Check that file names match exactly (case-sensitive)

PDF not generating

  • Verify all JSON files have valid syntax
  • Check that dates are in correct ISO format (YYYY-MM-DD)
  • Ensure profile picture exists at content/profile_picture.jpg

Missing environment variable

  • Create .env file with fileName variable
  • Restart the build process after creating .env

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published