15 KiB
title
| title |
|---|
| freeCodeCamp Review Generator |
freeCodeCamp Review Generator (hereinafter the "Application") is a command-line tool that aggregates all review lesson pages from freeCodeCamp's Full Stack Developer curriculum into a single, comprehensive PDF document for offline study and reference.
1. User Documentation
This section is for those interacting with a live instance of the Application.
Overview
The Application generates a compiled PDF document containing all review pages from freeCodeCamp's Full Stack Developer curriculum. The generated PDF includes:
- A custom cover page with generation date
- An automatically generated table of contents with links to each review section
- All review content organized according to the curriculum structure
- Custom headers and footers for easy navigation
- Page numbers and links to community resources
Generated PDF Structure
The output PDF (fcc-review-pages.pdf) follows the freeCodeCamp curriculum structure:
- HTML Topics - Reviews covering basic HTML, semantic HTML, forms and tables, and accessibility
- CSS Topics - Reviews covering basic CSS, layout (Flexbox, Grid), styling, responsive design, animations, and more
- JavaScript Topics - Reviews covering variables, functions, arrays, objects, DOM manipulation, asynchronous programming, and more
- Frontend Libraries - Reviews covering React fundamentals, state management, routing, and frontend frameworks
- Python Topics - Reviews covering Python basics, data structures, algorithms, and object-oriented programming
- Relational Databases - Reviews covering SQL, Bash scripting, and Git
What to Expect
Each review page in the generated PDF contains:
- Topic headings - Clear section markers for each subject
- Code examples - Syntax-highlighted code snippets demonstrating concepts
- Explanations - Detailed descriptions of programming concepts and best practices
- Reference material - Quick-reference information for common patterns and methods
Output Format
- File name:
fcc-review-pages.pdf - Page format: Legal size (8.5" x 14")
- Margins: 0.75 inches on all sides
- Header: Displays "Naomi's freeCodeCamp Review"
- Footer: Contains page numbers and link to community Discord server
Disclaimer
This is not an officially sanctioned freeCodeCamp document. The Application is maintained independently and the generated content reflects the curriculum state at the time of generation. For the most up-to-date information, always refer to the official freeCodeCamp website.
2. Technical Documentation
This section is for those interested in running their own instance of the Application.
Prerequisites
- Node.js: Version 18.x or higher recommended
- pnpm: Package manager (version 10.18.0 or compatible)
- Operating System: Linux, macOS, or Windows
- Disk Space: Minimum 500MB for dependencies and output files
Installation
-
Clone the repository:
git clone <repository-url> cd fcc-review-generator -
Install dependencies:
pnpm installThis will automatically install Chrome browser via Puppeteer (required for PDF generation).
Directory Structure
fcc-review-generator/
├── content/ # Review lesson markdown files
│ └── review-*/ # Individual review topic directories
├── data/
│ └── order.json # Curriculum ordering configuration
├── src/
│ ├── config/
│ │ ├── options.ts # PDF generation options
│ │ └── text.ts # Cover page text template
│ └── index.ts # Main application entry point
├── package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration
Configuration
Content Source
- Copy review lesson markdown files from the freeCodeCamp repository to the
content/directory - The Application recursively walks the directory tree, so nested folders are supported
- Only
.mdfiles are processed; other files are ignored
Curriculum Ordering
- Copy the Full Stack curriculum order from
/curriculum/structure/superblocks/fullstack.jsonin the freeCodeCamp repository - Paste into
data/order.jsonin this project - The Application uses this to sort review pages in the correct curriculum order
PDF Customization
Modify src/config/options.ts to customize:
- Page size and margins
- Header and footer templates
- Styling and formatting
Modify src/config/text.ts to customize:
- Cover page content
- Introduction text
- Disclaimer text
Usage
Run the Application:
pnpm start
The Application will:
- Read all markdown files from
content/directory - Sort them according to
data/order.json - Generate a table of contents
- Compile all content into a single markdown file (
review.md) - Convert the markdown to PDF (
fcc-review-pages.pdf) - Clean up the temporary markdown file
Output
- Success: Generates
fcc-review-pages.pdfin the project root - Console: Displays progress messages during execution
- Errors: Logged to console with descriptive messages
Development
Build TypeScript
pnpm build
Compiles TypeScript files according to tsconfig.json.
Linting
pnpm lint
Runs ESLint with strict settings (max warnings: 0).
Testing
pnpm test
Currently outputs a placeholder message (no tests implemented).
Technical Architecture
Core Components
-
File Reader (
readDirectoryRecursively)- Recursively scans the content directory
- Returns flat array of file paths
- Handles nested directory structures
-
File Sorter (
sortFiles)- Sorts files based on curriculum order from
order.json - Matches file directory names to curriculum block names
- Maintains proper curriculum sequence
- Sorts files based on curriculum order from
-
Content Processor (
rollupFiles)- Extracts frontmatter metadata (title, ID, etc.)
- Strips frontmatter and freeCodeCamp-specific heading syntax
- Generates table of contents with anchor links
- Compiles all content into single markdown file
-
PDF Generator (
createPdf)- Uses
md-to-pdflibrary (which uses Puppeteer/Chrome) - Applies custom styling and layout options
- Generates headers, footers, and page numbers
- Writes final PDF to disk
- Uses
Dependencies
- md-to-pdf (v5.2.4): Markdown to PDF conversion using headless Chrome
- tsx (v4.20.6): TypeScript execution for development
- typescript (v5.9.3): TypeScript compiler
- eslint (v9.37.0): Code quality and style enforcement
Troubleshooting
Common Issues
Issue: Puppeteer/Chrome installation fails
- Solution: Ensure you have sufficient disk space and network connectivity. Run
pnpx puppeteer browsers install chromemanually.
Issue: PDF generation fails with "Protocol error"
- Solution: Chrome may need additional system dependencies. On Linux, install required libraries for headless Chrome.
Issue: Files not appearing in correct order
- Solution: Verify
data/order.jsonmatches the structure of your content directory names.
Issue: Out of memory errors
- Solution: The Application processes all content in memory. For very large datasets, consider increasing Node.js memory limit:
NODE_OPTIONS="--max-old-space-size=4096" pnpm start
Performance Considerations
- File processing is sequential for consistent ordering
- PDF generation uses headless Chrome, which is memory-intensive
- Typical generation time: 10-30 seconds depending on content volume
- Temporary markdown file is automatically cleaned up after PDF generation
System Requirements
- Memory: Minimum 2GB RAM (4GB recommended)
- CPU: Modern multi-core processor recommended
- Network: Required for initial dependency installation
- Storage: 500MB minimum for dependencies and output
3. Legal Documentation
This section is for expansions to our legal policies specific to the Application.
License
This software is licensed under Naomi's Public License. The full license text can be found at:
- Local: LICENSE.md
- Online: https://docs.nhcarrigan.com/#/license
Copyright is held by Naomi Carrigan.
Privacy Policy
The Application processes markdown files locally and does not collect, store, or transmit any personal data. For information about privacy practices related to the project infrastructure (repository hosting, issue tracking, etc.), please refer to:
- Local: PRIVACY.md
- Online: https://docs.nhcarrigan.com/#/privacy
Terms of Service
By using this Application, you agree to the Terms of Service. The full terms can be found at:
- Local: TERMS.md
- Online: https://docs.nhcarrigan.com/#/terms
Security Policy
If you discover a security vulnerability in the Application, please follow the responsible disclosure process outlined in our Security Policy:
- Local: SECURITY.md
- Online: https://docs.nhcarrigan.com/#/security
Content Attribution
The review content processed by this Application originates from freeCodeCamp.org and is subject to freeCodeCamp's licensing terms. This tool is an unofficial aggregator and is not endorsed by or affiliated with freeCodeCamp.org.
Users of the generated PDF should respect freeCodeCamp's intellectual property rights and use the content for personal educational purposes only.
Disclaimer of Warranty
THE APPLICATION IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. THE MAINTAINERS MAKE NO WARRANTY THAT:
- The generated PDF will be error-free or complete
- The content will be current or up-to-date with the latest freeCodeCamp curriculum
- The Application will function without interruption
Users should always refer to the official freeCodeCamp website for the most accurate and current curriculum information.
4. Contributing Documentation
This section is for documentation related to contributing to the Application's codebase.
Getting Started
We welcome contributions to the freeCodeCamp Review Generator! Before contributing, please review:
- Contributing Guidelines: https://docs.nhcarrigan.com/#/contributing
- Local reference: CONTRIBUTING.md
- Code of Conduct: https://docs.nhcarrigan.com/#/coc
- Local reference: CODE_OF_CONDUCT.md
Ways to Contribute
1. Report Bugs
If you encounter a bug, please open a GitHub issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs. actual behavior
- Your environment (OS, Node.js version, pnpm version)
- Any relevant error messages or logs
2. Suggest Enhancements
We appreciate feature requests and enhancement suggestions! Please open a GitHub issue describing:
- The problem you're trying to solve
- Your proposed solution
- Any alternative approaches you've considered
- How this would benefit other users
3. Submit Pull Requests
Ready to contribute code? Follow these steps:
-
Fork and Clone
git clone <your-fork-url> cd fcc-review-generator -
Create a Branch
git checkout -b feature/your-feature-name -
Make Changes
- Follow existing code style and patterns
- Update relevant documentation
- Ensure TypeScript types are correct
- Test your changes thoroughly
-
Run Quality Checks
pnpm lint # Check code style pnpm build # Ensure TypeScript compiles pnpm start # Test PDF generation -
Commit Changes
git add . git commit -m "feat: description of your changes"Follow conventional commit message format:
feat:for new featuresfix:for bug fixesdocs:for documentation changesrefactor:for code refactoringchore:for maintenance tasks
-
Push and Create PR
git push origin feature/your-feature-nameThen open a Pull Request on GitHub with a clear description of your changes.
Code Style Guidelines
- TypeScript: Use strict type checking; avoid
anytypes - Formatting: Follow the ESLint configuration (
@nhcarrigan/eslint-config) - Naming: Use descriptive variable and function names
- Comments: Include JSDoc comments for exported functions
- Error Handling: Use try-catch blocks and provide meaningful error messages
Project Conventions
Copyright Headers
All source files should include the copyright header:
/**
* @copyright NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
File Organization
- Place configuration in
src/config/ - Keep utility functions modular and focused
- Use ES modules (import/export)
- Maintain clear separation of concerns
TypeScript Configuration
The project uses strict TypeScript settings:
strict: true- Target: ES2022
- Module: ESNext
- No implicit any types
Testing
Currently, the project does not have an automated test suite. Contributions that add testing infrastructure are welcome! Potential testing improvements:
- Unit tests for file processing functions
- Integration tests for PDF generation
- Snapshot tests for output consistency
- CI/CD pipeline integration
Development Workflow
- Install dependencies:
pnpm install - Make changes to source files in
src/ - Test locally:
pnpm startto verify PDF generation - Check for errors:
pnpm lintandpnpm build - Commit and push your changes
- Create Pull Request for review
Review Process
Pull requests will be reviewed by project maintainers. The review process includes:
- Code quality and style verification
- Functionality testing
- Documentation completeness
- Alignment with project goals
Please be patient during the review process and be open to feedback and requested changes.
Communication
For questions, discussions, or help with contributions:
- GitHub Issues: For bug reports and feature requests
- Pull Requests: For code contributions and discussions
- Discord: Join the community at http://chat.nhcarrigan.com
- Email: contact@nhcarrigan.com for private inquiries
Recognition
All contributors will be recognized for their contributions. Significant contributions may result in being listed in a CONTRIBUTORS file or project documentation.
License for Contributions
By contributing to this project, you agree that your contributions will be licensed under the same license as the project (Naomi's Public License). You confirm that:
- You have the right to submit the contribution
- Your contribution is your original work or properly attributed
- You understand the contribution will be publicly available
Thank you for your interest in contributing to the freeCodeCamp Review Generator! Your contributions help make this tool better for everyone in the learning community.