A personal blog for AWS learning notes. Frontend only (React + TypeScript + Vite). Posts are stored as local mock data. Deployed to Netlify.
- React 18
- TypeScript
- Vite
- React Router DOM v6
- Plain CSS
npm install
npm run devOpen http://localhost:5173.
npm run build
npm run preview # preview the production build locally- Push to GitHub.
- Import the repo into Netlify.
- Build command:
npm run build - Publish directory:
dist - The
netlify.tomlfile handles the rest (SPA redirect rule).
src/
├── components/ # Reusable UI components (Header, PostCard)
├── data/ # Mock post data — replace with API calls later
├── pages/ # Route-level page components
├── types/ # TypeScript interfaces
├── App.tsx # Router setup
├── main.tsx # React entry point
└── index.css # Global base styles
Open src/data/posts.ts and add a new object to the posts array:
{
id: 'my-new-post', // used in the URL: /post/my-new-post
title: 'My New Post',
excerpt: 'Short summary shown on the home page.',
date: '2025-05-01',
readTime: 5,
tags: ['Tag1', 'Tag2'],
content: `<h2>Section</h2><p>Your HTML content here.</p>`,
}When the backend is ready, replace the mock data import in each page with a fetch call:
// Before (mock)
import { posts } from '../data/posts';
// After (API)
const res = await fetch(`${import.meta.env.VITE_API_BASE_URL}/posts`);
const posts = await res.json();Set VITE_API_BASE_URL in Netlify → Site settings → Environment variables.