{"id":31578365,"url":"https://github.com/siyabuilds/ai_powered_devblog","last_synced_at":"2026-05-18T04:33:12.745Z","repository":{"id":317380541,"uuid":"1066584720","full_name":"siyabuilds/ai_powered_devblog","owner":"siyabuilds","description":"Crafted with Astro, this blog boosts dev workflows using AI features. It’s fast, modern, and a playground for full-stack ideas.","archived":false,"fork":false,"pushed_at":"2025-09-30T14:20:44.000Z","size":336,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-30T15:23:35.397Z","etag":null,"topics":["ai","astro","blog","markdown"],"latest_commit_sha":null,"homepage":"https://blog.samson.codes","language":"Astro","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siyabuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T17:27:01.000Z","updated_at":"2025-09-30T14:24:57.000Z","dependencies_parsed_at":"2025-09-30T15:23:39.057Z","dependency_job_id":"2495932a-f82e-4ec9-b6dc-923a11606763","html_url":"https://github.com/siyabuilds/ai_powered_devblog","commit_stats":null,"previous_names":["siyabuilds/ai_powered_devblog"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/siyabuilds/ai_powered_devblog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fai_powered_devblog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fai_powered_devblog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fai_powered_devblog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fai_powered_devblog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siyabuilds","download_url":"https://codeload.github.com/siyabuilds/ai_powered_devblog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fai_powered_devblog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278510917,"owners_count":25998997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","astro","blog","markdown"],"created_at":"2025-10-05T19:57:10.889Z","updated_at":"2026-05-18T04:33:12.738Z","avatar_url":"https://github.com/siyabuilds.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI-Powered Developer Blog\n\n\u003e ⚠️ **AI-Generated Content**: This blog automatically creates posts using OpenAI's GPT models. While we aim for quality, always verify technical details and test code before using in production.\n\nA modern developer blog built with Astro, featuring automated content generation powered by AI. The blog covers topics ranging from web development, DevOps, cloud computing, AI/ML, SaaS best practices, and career development.\n\n**Live Site**: [blog.samson.codes](https://blog.samson.codes)\n\n## ✨ Features\n\n- ✅ AI-powered content generation using OpenAI API\n- ✅ Automated blog post creation with topic rotation\n- ✅ Minimal, performant styling (100/100 Lighthouse)\n- ✅ SEO-friendly with canonical URLs and OpenGraph data\n- ✅ Sitemap and RSS feed support\n- ✅ Markdown \u0026 MDX support\n- ✅ Content collections with type-safe frontmatter\n\n## 🚀 Quick Setup\n\n### Prerequisites\n\n- Node.js 18+ installed\n- An OpenAI API key\n\n### Installation\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/siyabuilds/ai_powered_devblog.git\n   cd ai_powered_devblog\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure environment variables**\n\n   Create a `.env` file in the root directory:\n\n   ```bash\n   OPENAI_API_KEY=your_openai_api_key_here\n   ```\n\n   Replace `your_openai_api_key_here` with your actual OpenAI API key.\n\n4. **Start the development server**\n\n   ```bash\n   npm run dev\n   ```\n\n   The site will be available at `http://localhost:4321`\n\n## 🧞 Available Commands\n\nAll commands are run from the root of the project:\n\n| Command                   | Action                                           |\n| :------------------------ | :----------------------------------------------- |\n| `npm install`             | Installs dependencies                            |\n| `npm run dev`             | Starts local dev server at `localhost:4321`      |\n| `npm run build`           | Build your production site to `./dist/`          |\n| `npm run preview`         | Preview your build locally, before deploying     |\n| `npm run astro ...`       | Run CLI commands like `astro add`, `astro check` |\n| `npm run astro -- --help` | Get help using the Astro CLI                     |\n\n## 📁 Project Structure\n\n```text\n├── public/\n│   └── fonts/              # Custom fonts\n├── src/\n│   ├── assets/             # Images and media files\n│   ├── components/         # Astro components\n│   │   ├── BaseHead.astro\n│   │   ├── Footer.astro\n│   │   ├── FormattedDate.astro\n│   │   ├── Header.astro\n│   │   └── HeaderLink.astro\n│   ├── content/\n│   │   └── blog/           # Blog post markdown files\n│   ├── layouts/\n│   │   └── BlogPost.astro  # Blog post layout\n│   ├── pages/\n│   │   ├── about.astro     # About page\n│   │   ├── index.astro     # Homepage\n│   │   ├── rss.xml.js      # RSS feed generation\n│   │   └── blog/           # Blog routes\n│   ├── styles/\n│   │   └── global.css      # Global styles\n│   └── utils/              # AI content generation scripts\n│       ├── fetchAndSavePost.js\n│       ├── fetchPost.js\n│       ├── generateFrontmatter.js\n│       ├── savePost.js\n│       ├── topicTracker.js\n│       └── data/\n│           ├── topics.js\n│           └── topicTracker.json\n├── astro.config.mjs        # Astro configuration\n├── package.json\n├── tsconfig.json\n└── README.md\n```\n\n## 🤖 AI Content Generation System\n\nThe blog uses a modular Node.js script system in `src/utils/` to automatically generate blog posts using OpenAI's API.\n\n### How It Works\n\n#### 1. **Topic Management** (`topics.js` \u0026 `topicTracker.js`)\n\n- **`topics.js`**: Contains an array of predefined blog topics across various categories:\n\n  - Web Development (React, Next.js, CSS, PWAs, etc.)\n  - DevOps (CI/CD, Docker, Kubernetes, monitoring)\n  - Cloud (AWS, Azure, GCP, multi-cloud strategies)\n  - AI/ML (machine learning, NLP, computer vision)\n  - SaaS \u0026 Startups (MVP building, scaling, analytics)\n  - Programming Languages \u0026 Tools (TypeScript, Python, Git)\n  - Career Development (interviews, networking, remote work)\n  - Architecture (microservices, event-driven design)\n\n- **`topicTracker.js`**: Implements a round-robin topic selection system\n  - Reads the last used topic index from `topicTracker.json`\n  - Selects the next topic in sequence\n  - Saves the current index to persist state between runs\n  - Automatically cycles back to the first topic after reaching the end\n\n#### 2. **Post Fetching** (`fetchPost.js`)\n\n- Takes a topic object with `title` and `about` properties\n- Constructs a detailed prompt for the OpenAI API\n- Calls OpenAI's `gpt-4.1-mini` model with specific instructions:\n  - Conversational yet knowledgeable tone\n  - 1500-2000 word length\n  - Markdown formatting with headings and lists\n  - Practical examples and code snippets\n  - Links to official documentation\n- Returns the generated content or fallback error message\n\n#### 3. **Frontmatter Generation** (`generateFrontmatter.js`)\n\n- Creates YAML frontmatter for each post\n- Generates current date in \"Month Day, Year\" format\n- Includes title, publication date, and description\n- Formats properly for Astro's content collections\n\n#### 4. **Post Saving** (`savePost.js`)\n\n- Converts the post title into a URL-friendly slug\n- Creates the full markdown file with frontmatter + content\n- Saves to `src/content/blog/` directory\n- Ensures the directory exists before writing\n- Returns the file path for confirmation\n\n#### 5. **Orchestration** (`fetchAndSavePost.js`)\n\n- Main entry point that coordinates all utilities\n- Executes the full workflow:\n  1. Gets the next topic from the tracker\n  2. Fetches AI-generated content\n  3. Saves the post to a markdown file\n  4. Logs success or error messages\n\n### Running the Content Generator\n\nTo generate a new blog post:\n\n```bash\nnode src/utils/fetchAndSavePost.js\n```\n\nThis will:\n\n1. Select the next topic in rotation\n2. Generate a new blog post using OpenAI\n3. Save it to `src/content/blog/`\n4. Update the topic tracker\n\n### Customizing Topics\n\nEdit `src/utils/data/topics.js` to add, remove, or modify topics:\n\n```javascript\n{\n  title: \"Your Topic Title\",\n  about: \"Detailed description of what the post should cover\"\n}\n```\n\n### Configuration\n\nThe AI generation uses these parameters (in `fetchPost.js`):\n\n- **Model**: `gpt-4.1-mini`\n- **Max Tokens**: 3000\n- **Temperature**: 0.7\n- **System Role**: Technical writer and content creator\n\nModify these values to adjust output length, creativity, and style.\n\n## 🛠️ Development\n\n### Adding New Content Manually\n\n1. Create a new `.md` file in `src/content/blog/`\n2. Add frontmatter:\n   ```yaml\n   ---\n   title: \"Your Post Title\"\n   pubDate: \"Jan 10, 2024\"\n   description: \"Brief description of your post\"\n   ---\n   ```\n3. Write your content in Markdown below the frontmatter\n\n### Modifying Styles\n\n- Global styles: `src/styles/global.css`\n- Component-specific styles: Use `\u003cstyle\u003e` tags in `.astro` components\n\n### Updating Site Configuration\n\nEdit `astro.config.mjs` to:\n\n- Change the site URL (currently set to `https://example.com`)\n- Add or remove integrations\n- Configure build settings\n\n## 📊 Content Collections\n\nThis blog uses Astro's Content Collections feature for type-safe frontmatter:\n\n- Collection definition: `src/content.config.ts`\n- Blog posts: `src/content/blog/*.md`\n- Retrieve posts: `getCollection('blog')`\n\nSee [Astro's Content Collections docs](https://docs.astro.build/en/guides/content-collections/) for more information.\n\n## 🚢 Deployment\n\nThe blog is hosted at **[blog.samson.codes](https://blog.samson.codes)**.\n\n### Building for Production\n\n```bash\nnpm run build\n```\n\nThis creates a static site in the `./dist/` directory.\n\n### Preview Production Build\n\n```bash\nnpm run preview\n```\n\n## 🙏 Credits\n\n- Built with [Astro](https://astro.build)\n- Theme based on [Bear Blog](https://github.com/HermanMartinus/bearblog/)\n- Content generated by [OpenAI](https://openai.com)\n- Icons from [Font Awesome](https://fontawesome.com)\n\n## 📧 Contact\n\nFor questions or feedback about this blog, visit [blog.samson.codes](https://blog.samson.codes).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiyabuilds%2Fai_powered_devblog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiyabuilds%2Fai_powered_devblog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiyabuilds%2Fai_powered_devblog/lists"}