diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4466847 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +{ + "name": "Preferred.AI Blog Development", + "image": "mcr.microsoft.com/devcontainers/typescript-node:22", + "features": { + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "bradlc.vscode-tailwindcss", + "yzhang.markdown-all-in-one", + "DavidAnson.vscode-markdownlint", + "bierner.markdown-preview-github-styles" + ], + "settings": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.tabSize": 2, + "files.trimTrailingWhitespace": true, + "typescript.preferences.importModuleSpecifier": "relative" + } + } + }, + "forwardPorts": [3000], + "portsAttributes": { + "3000": { + "label": "Next.js Dev Server", + "onAutoForward": "openPreview" + } + }, + "postCreateCommand": "corepack enable && pnpm install", + "postStartCommand": "echo '✅ Ready! Run: pnpm dev to start the development server'", + "remoteUser": "node" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..3d521ef --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "bradlc.vscode-tailwindcss", + "yzhang.markdown-all-in-one", + "DavidAnson.vscode-markdownlint", + "bierner.markdown-preview-github-styles" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9db1683 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Next.js: debug server-side", + "type": "node-terminal", + "request": "launch", + "command": "pnpm dev" + }, + { + "name": "Next.js: debug full stack", + "type": "node-terminal", + "request": "launch", + "command": "pnpm dev", + "serverReadyAction": { + "pattern": "- Local:.+(https?://.+)", + "uriFormat": "%s", + "action": "debugWithChrome" + } + } + ] +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..37f1ce1 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Install Dependencies", + "type": "shell", + "command": "pnpm install", + "problemMatcher": [], + "group": "build" + }, + { + "label": "Start Dev Server", + "type": "shell", + "command": "pnpm dev", + "problemMatcher": [], + "isBackground": true, + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "Build for Production", + "type": "shell", + "command": "pnpm build", + "problemMatcher": [], + "group": "build" + }, + { + "label": "Lint", + "type": "shell", + "command": "pnpm lint", + "problemMatcher": ["$eslint-stylish"], + "group": "test" + } + ] +} diff --git a/README.md b/README.md index 01c3085..0d3c5c8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,28 @@ ## Quick Start (Development) +### Option 1: GitHub Codespaces (No Local Setup!) + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/PreferredAI/PreferredAI.github.io) + +1. Click the button above (or go to repo → **Code** → **Codespaces** → **Create codespace on main**) +2. Wait ~2-3 minutes for the environment to set up +3. Run the dev server: + ```bash + pnpm dev + ``` +4. A preview window will automatically open +5. Edit files in `content/posts/` and see live changes! +6. Commit and push when done + +> **Free Tier Limits:** +> - **GitHub Free:** 120 core-hours/month (~60 hrs on 2-core machine) +> - **GitHub Pro:** 180 core-hours/month (~90 hrs on 2-core machine) +> - Auto-stops after 30 min idle (just close the tab when done!) +> - Check usage: [github.com/settings/billing](https://github.com/settings/billing) + +### Option 2: Local Development + ```bash pnpm install pnpm dev @@ -11,7 +33,15 @@ Visit [http://localhost:3000](http://localhost:3000) ## Creating a Blog Post -### Via GitHub Web Interface (No Installation Required): +### Via GitHub Codespaces (Cloud IDE - Preview Available) + +1. Open the project in Codespaces (see above) +2. Create a new file in `content/posts/` named `your-post-title.md` +3. Copy content from `.github/BLOG_POST_TEMPLATE.md` +4. Edit your post and preview live at port 3000 +5. Commit and push + +### Via GitHub Web Interface (No Installation Required - No Preview) 1. Copy content from `.github/BLOG_POST_TEMPLATE.md` 2. Go to `content/posts/` on GitHub @@ -34,7 +64,7 @@ Visit [http://localhost:3000](http://localhost:3000) 6. Write your content in Markdown. Upload images to `public/uploads/YYYY/MM/` first if needed. 7. Commit to a **new branch** and create a **Pull Request** -### Interactive Local Setup (Requires Installation): +### Local Development (Requires Installation Locally - Preview Available) 1. Ensure you have [Node.js](https://nodejs.org/) and [pnpm](https://pnpm.io/) installed. 2. Clone the repository: ```bash