|
| 1 | +# Gemini Code Context: `const-correctness.github.io` |
| 2 | + |
| 3 | +This document provides context for the AI assistant to understand the structure, conventions, and purpose of this codebase. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is a personal website and blog built with React, TypeScript, and Vite. It features interactive 3D elements using `three.js` and `react-three-fiber`, and hosts technical articles written in a Jupyter Book. |
| 8 | + |
| 9 | +- **Frontend**: A single-page application built with React and TypeScript, styled with Material-UI. The main application logic is in `src/App.tsx`. |
| 10 | +- **3D Graphics**: The site includes a 3D model viewer (`src/components/ModelViewer.tsx`) that displays a `.glb` model. |
| 11 | +- **Blog Content**: The technical articles are managed in the `jupyter-books` directory. These are converted to HTML using Jupyter Book and served as part of the React application. |
| 12 | +- **Deployment**: The site is deployed to GitHub Pages via a GitHub Actions workflow defined in `.github/workflows/deploy.yml`. |
| 13 | + |
| 14 | +## Building and Running the Project |
| 15 | + |
| 16 | +The project uses `npm` for package management. |
| 17 | + |
| 18 | +- **Install dependencies**: |
| 19 | + ```bash |
| 20 | + npm install |
| 21 | + ``` |
| 22 | + |
| 23 | +- **Run the development server**: |
| 24 | + Starts the Vite dev server at `http://localhost:5173`. |
| 25 | + ```bash |
| 26 | + npm run dev |
| 27 | + ``` |
| 28 | + |
| 29 | +- **Build for production**: |
| 30 | + This command transpiles the TypeScript and builds the Vite project. |
| 31 | + ```bash |
| 32 | + npm run build |
| 33 | + ``` |
| 34 | + |
| 35 | +- **Build and serve the Jupyter Book**: |
| 36 | + The Jupyter Book content needs to be built and copied to the `public` directory to be accessible by the Vite application. |
| 37 | + ```bash |
| 38 | + npm run build:book |
| 39 | + npm run copy:book |
| 40 | + ``` |
| 41 | + |
| 42 | +- **Linting**: |
| 43 | + This project uses ESLint for code linting. |
| 44 | + ```bash |
| 45 | + npm run lint |
| 46 | + ``` |
| 47 | + |
| 48 | +## Development Conventions |
| 49 | + |
| 50 | +- **Styling**: The project uses Material-UI for UI components. Styling is done via the `sx` prop. |
| 51 | +- **State Management**: Component-level state is managed with React hooks (`useState`). |
| 52 | +- **3D Models**: 3D models are stored in the `public/models` directory. |
| 53 | +- **Blog Posts**: Blog posts are written in Markdown (`.md`) or Jupyter Notebooks (`.ipynb`) in the `jupyter-books` directory. To create a new post, add a file to this directory and update the `_toc.yml` file. |
| 54 | +- **Proxy**: The Vite development server is configured with proxies in `vite.config.ts` to correctly serve the Jupyter Book content. |
0 commit comments