{"id":33309803,"url":"https://github.com/pmcfernandes/pipa-blog-engine","last_synced_at":"2026-05-01T21:04:00.309Z","repository":{"id":324791998,"uuid":"1097571459","full_name":"pmcfernandes/pipa-blog-engine","owner":"pmcfernandes","description":"a Good Enough Blog engine","archived":false,"fork":false,"pushed_at":"2025-11-17T21:30:07.000Z","size":992,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-17T23:24:37.615Z","etag":null,"topics":["blog-engine","honojs","nodejs"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/pmcfernandes.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-11-16T12:45:35.000Z","updated_at":"2025-11-17T21:30:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pmcfernandes/pipa-blog-engine","commit_stats":null,"previous_names":["pmcfernandes/pipa-blog-engine"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pmcfernandes/pipa-blog-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmcfernandes%2Fpipa-blog-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmcfernandes%2Fpipa-blog-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmcfernandes%2Fpipa-blog-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmcfernandes%2Fpipa-blog-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmcfernandes","download_url":"https://codeload.github.com/pmcfernandes/pipa-blog-engine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmcfernandes%2Fpipa-blog-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["blog-engine","honojs","nodejs"],"created_at":"2025-11-19T03:00:31.776Z","updated_at":"2026-05-01T21:04:00.280Z","avatar_url":"https://github.com/pmcfernandes.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Pipa Blog Engine (pipa)\n\nLightweight, self-hosted blog engine built with Hono, EJS templates and Sequelize (MySQL). The project is designed to be simple to run and customize — it exposes a small API, server-rendered blog pages and an admin area for creating and managing content.\n\n## Features\n\n- Server-side rendered blog and post pages using EJS templates\n- Admin area with login, registration and dashboard\n- REST-like controllers for posts, pages, blogs and navigation\n- Sequelize ORM for MySQL integration\n- RSS feed, robots.txt and favicon generation routes\n\n## Quick start\n\nRequirements\n\n- Node.js (v18+ recommended) — this project uses native ES modules\n- MySQL (or compatible) database\n\nInstall dependencies\n\n```powershell\nnpm install\n```\n\nCreate a `.env` file in the project root (see Environment variables below). Example:\n\n```env\n# Server\nPORT=3000\n\n# Database\nDB_HOST=localhost\nDB_DIALECT=mysql\nDATABASE_NAME=pipas_db\nDATABASE_USER=root\nDATABASE_PASSWORD=secret\n\n# Hash / JWT secret used for admin auth\nHASH_SECRET=your_hash_secret_here\n```\n\nRun in development\n\n```powershell\nnpm run dev\n```\n\nThis starts the server (by default on port 3000). The dev script runs `node src/index.js`.\n\nProduction / build\n\nThe `build` and `start` scripts are present in `package.json` but no explicit bundler is configured. `npm run start` expects a built `dist/index.js` — adjust or compile as needed for your deployment.\n\n## Environment variables\n\n- PORT — HTTP port (defaults to 3000)\n- DB_HOST — Database host\n- DB_DIALECT — Sequelize dialect (e.g. `mysql`)\n- DATABASE_NAME — Database name\n- DATABASE_USER — Database user\n- DATABASE_PASSWORD — Database password\n- HASH_SECRET — Secret used for signing admin JWTs\n\nMake sure the DB user has privileges to create tables. On startup the application calls `sequelize.sync()` to create missing tables.\n\n## Routes and admin area\n\nPublic routes (examples)\n\n- / — Root, handled by `RootController`\n- /rss.xml — RSS feed\n- /robots.txt — Robots file\n- /:blogSlug — Blog index pages (posts listing)\n- /:blogSlug/:postSlug — Post page\n- /:blogSlug/page/:pageSlug — Page page\n\nAdmin routes\n\n- GET/POST /admin/login — Admin login\n- GET/POST /admin/register — Admin registration\n- GET /admin/dashboard — Dashboard (requires JWT cookie)\n- GET /admin/create-blog — Create first blog\n\nAuthentication\n\nAdmin authentication uses a JWT stored in the `admin_jwt_token` cookie. `HASH_SECRET` must be set in the environment for signing and verification.\n\n## Project layout\n\n\n- `src/` — Application source\n  - `index.js` — App entry (Hono server, route registrations)\n  - `admin/` — Admin page handlers (Login, Register, Dashboard, CreatePost, CreatePage, CreateBlog)\n  - `controllers/` — API controllers (Auth, Blog, Post, Page, Navigation, Register, Root)\n  - `helpers/` — DB, models, template rendering, slug generator\n  - `middlewares/` — Middlewares (subdomain handling, validators)\n  - `pages/` — Blog-facing page handlers (BlogIndex, Post, Page, Rss, Robots, FavIcon)\n  - `templates/` — EJS templates for admin and blog pages\n  - `static/` — Static assets (CSS, fonts, images, admin JS)\n\n## Templates\n\nTemplates are EJS files located under `templates/`. The admin UI and blog UI are separated (`templates/admin` and `templates/blogs`). You can customize layouts and partials (header/footer/menu) to change the site's look.\n\n## Database / Models\n\nModels are defined in `src/helpers/models.js` and wired into Sequelize in `src/helpers/db.js`. On app start the code runs `sequelize.sync({ force: false })` which will create tables if they do not exist.\n\n## Development notes \u0026 tips\n\n- Adjust `HASH_SECRET` and use a strong random value for production.\n- Consider using a process manager (pm2, systemd) or containerization for production deployments.\n- Add migrations if you want more controlled schema changes instead of relying on `sequelize.sync()`.\n\n## Troubleshooting\n\n- If you see database connection errors, confirm environment variables and that MySQL is reachable.\n- If templates don't render, double-check the `templates/` path and that files haven't been moved.\n\n## Contributing\n\nContributions are welcome. Open an issue or submit a pull request with improvements.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmcfernandes%2Fpipa-blog-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmcfernandes%2Fpipa-blog-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmcfernandes%2Fpipa-blog-engine/lists"}