Skip to content

Repository files navigation

davidrich.es

image

Welcome to davidrich.es, my personal website. This repository contains the source code and configuration for the site.

Technologies Used

  • Next.js v16: A React framework for building optimized and scalable web applications.
  • React v19: JavaScript library for building user interfaces.
  • TypeScript v5: Typed superset of JavaScript for better developer experience.
  • Contentful: A headless CMS for managing and delivering content.
  • pnpm: Fast, disk space efficient package manager.
  • Netlify: Hosting platform for fast deployment and continuous delivery.

Features

  • Dynamic Content: Content managed through Contentful for seamless updates.
  • Responsive Design: Optimized for desktop, tablet, and mobile devices.
  • Performance Optimized: Leveraging Next.js's capabilities for server-side rendering (SSR) and static site generation (SSG).
  • Netlify Hosting: Deployed with continuous integration for rapid updates.

Getting Started

Follow the instructions below to set up and run the project locally.

Prerequisites

Ensure you have the following installed:

  • Node.js (v18 or higher recommended)
  • pnpm (v8 or higher recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/davidrich.es.git
    cd davidrich.es
  2. Install dependencies:

    pnpm install
  3. Configure environment variables:

    Create a .env.local file in the root directory and add the following variables:

    CONTENTFUL_SPACE_ID=your-space-id
    CONTENTFUL_ACCESS_KEY=your-access-token
    CONTENTFUL_REVALIDATE_SECRET=any-long-random-string

    Replace your-space-id and your-access-token with your Contentful API credentials. These are server-only — never prefix them with NEXT_PUBLIC_, which would expose the token to the browser. The same names must be set in Netlify's environment variables for deploys.

    CONTENTFUL_REVALIDATE_SECRET guards the POST /api/revalidate endpoint, which clears the Contentful data cache on demand. To make published edits appear immediately, add a webhook in Contentful (Settings → Webhooks) pointing at https://davidrich.es/api/revalidate with a custom header x-revalidate-secret: <the same secret>, triggered on entry publish/unpublish. Without the webhook, content updates appear when the cache expires (days).

Running the Development Server

Start the development server:

pnpm dev

Open http://localhost:3000 in your browser to view the site.

Building for Production

Build the application for production:

pnpm build

Start the production server:

pnpm start

Deployment

This project is deployed on Netlify. Pushes to the main branch trigger an automatic build and deployment.

For manual deployment:

  1. Run the production build:

    pnpm build
  2. Deploy the .next folder to Netlify.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.


If you have any questions or feedback, feel free to contact me via the website or open an issue in this repository.

About

Personal website built with Next.js, Contentful and hosted on Netlify.

Topics

Resources

Stars

9 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages