Or run it locally on VS Code with Dev Containers:
To run this project locally, you'll need:
-
Clone the repository:
git clone https://github.com/jordigarciaventura/course-catalog.git cd course-catalog -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open http://localhost:4321/course-catalog in your browser.
All commands are run from the root of the project, from a terminal:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run lint |
Run ESLint to check for code issues |
npm run format |
Format code with Prettier |
npm run type-check |
Run TypeScript type checking |
-
Emojis:
-
Archive of Icons:
- Streamline Icons (Top choice)
- iconify (Top choice)
- icons8
- Iconfinder
-
Icon Sets:
This comprehensive guide will help you personalize the course catalog to fit your own learning journey. Follow these steps in order for the best experience.
Start by updating the basic app configuration:
// Update the base path for your deployment
export const APP_BASE_PATH = "/your-project-name"; // For subdirectory deployment
// or
export const APP_BASE_PATH = ""; // For root deployment
// Update your site URL
export const APP_SITE_URL = "https://yourusername.github.io";Update the main configuration file:
// Change the creator name
export const creator = "Your Name" as const;
// Modify supported languages (currently supports English, Spanish, Catalan)
export const languages = ["en", "es", "ca"] as const;
// Change default language
export const defaultLanguage = "en" as const;-
Update Types (
src/types.ts):// Add your new category to the courseCategories array in src/config.ts first export const courseCategories = [ "data-science", "cloud-devops", "programming", // Add your new category here "your-new-category", ] as const;
-
Define Category Details (
src/content/categories.tsx):import { YourIcon } from "lucide-react"; // Import your icon // Add to the categories array { id: "your-new-category", label: { en: "Your Category Name", es: "Nombre de tu Categoría", ca: "Nom de la teva Categoria", }, icon: <YourIcon />, // Use Lucide React icons color: "emerald", // Choose from available colors }
-
Available Colors:
emerald,sky,violet,blue,purple,orange,pink,red,yellow,slate
- Remove the category from
courseCategoriesarray insrc/config.ts - Remove the category definition from
src/content/categories.tsx - Delete or reassign any courses using that category
-
Create or Edit Category File (
src/content/courses/):- Files are named by category (e.g.,
programming.tsx,web-development.tsx) - If adding a new category, create a new
.tsxfile
- Files are named by category (e.g.,
-
Course Structure:
import type { Course } from "@/types"; const courses: Course[] = [ { id: "unique-course-id", // Must be unique across all courses title: { en: "Course Title in English", es: "Título del Curso en Español", ca: "Títol del Curs en Català", }, description: { en: "Course description in English", es: "Descripción del curso en español", ca: "Descripció del curs en català", }, date: "DD/MM/YYYY", // Format: day/month/year duration: "X", // Duration in hours iconUrl: "/icons/your-icon.svg", // Path to icon in public/icons/ category: "your-category", // Must match a category from config.ts }, ]; export default courses;
Icon Location: All course icons should be placed in public/icons/
Supported Formats:
- SVG (recommended): Vector graphics that scale perfectly
- PNG/JPG: Raster images work but may not scale as well
Icon Guidelines:
- SVG files are preferred for crisp display at all sizes
- Recommended size: 64x64px or scalable SVG
- Use consistent style across all icons
Adding New Icons:
- Place your icon file in
public/icons/ - Reference it in your course definition:
iconUrl: "/icons/your-icon.svg" - The path is relative to the
publicdirectory
Favicon: Replace public/favicon.svg with your own icon
Tab Title Translations: The main page titles are in src/i18n/translations.tsx:
index: {
title: {
en: "Your Learning Journey",
es: "Tu Viaje de Aprendizaje",
ca: "El Teu Viatge d'Aprenentatge",
}
}Update all text content for your languages:
export const ui = {
index: {
title: {
en: "Your Title",
es: "Tu Título",
ca: "El Teu Títol",
},
subtitle: {
en: "Your subtitle description",
es: "Tu descripción de subtítulo",
ca: "La teva descripció de subtítol",
},
// ... more translations
}
};-
Update Language Configuration (
src/config.ts):export const languages = ["en", "es", "ca", "fr"] as const; // Add French
-
Update Type Definition (
src/types.ts): TheMultilingualTexttype will automatically include your new language -
Add Translations: Update all
MultilingualTextobjects throughout the project:src/i18n/translations.tsxsrc/content/categories.tsx- All course files in
src/content/courses/
- Remove from
languagesarray insrc/config.ts - Remove translations from all multilingual text objects
- TypeScript will help you find missing translations
The project uses strict TypeScript checking. Key type files:
src/types.ts: Main type definitionssrc/config.ts: Configuration types and constants
Category Not Found:
- Ensure your category is added to
courseCategoriesinsrc/config.ts
Missing Translations:
- All
MultilingualTextobjects must include all languages from thelanguagesarray
Invalid Course Structure:
- Follow the
Courseinterface exactly as defined insrc/types.ts
If deploying to yourusername.github.io/repository-name:
app.config.js:
export const APP_BASE_PATH = "/repository-name";
export const APP_SITE_URL = "https://yourusername.github.io";- Keep courses organized by category in separate files
- Use consistent naming conventions for course IDs
- Group related courses together
- Optimize images before adding them to
public/icons/ - Use SVG icons when possible for better scalability
- Keep course descriptions concise but informative
- Regularly update course completion dates
- Keep categories balanced (not too many courses in one category)
- Test the site after adding new languages or categories
- Use descriptive course titles and descriptions
- Ensure proper alt text for any custom images
- Test with screen readers if adding complex content
Build Errors:
- Run
npm run type-checkto identify TypeScript issues - Ensure all required translations are present
- Check that category IDs match between config and course files
Missing Icons:
- Verify icon files exist in
public/icons/ - Check file paths in course definitions
- Ensure proper file extensions (.svg, .png, .jpg)
Translation Errors:
- All
MultilingualTextobjects must include every language fromsrc/config.ts - Use TypeScript errors to identify missing translations
Deployment Issues:
- Verify base path configuration matches your deployment setup
- Check that asset URLs are correctly generated with the
asset()function
This guide should help you fully customize the course catalog to showcase your own learning journey. Remember to test thoroughly after making changes, and use the TypeScript compiler to catch potential issues early!