{"id":43481805,"url":"https://github.com/r74tech/wikitext-backend","last_synced_at":"2026-02-03T08:33:44.124Z","repository":{"id":300342444,"uuid":"1005898361","full_name":"r74tech/wikitext-backend","owner":"r74tech","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-25T08:09:11.000Z","size":2111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2025-11-07T08:33:12.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/r74tech.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},"funding":{"github":"RTa-technology","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2025-06-21T03:37:08.000Z","updated_at":"2025-08-25T08:09:08.000Z","dependencies_parsed_at":"2025-06-21T06:27:54.846Z","dependency_job_id":"4e6f8e11-83fe-4a7e-a67e-713c93524fd8","html_url":"https://github.com/r74tech/wikitext-backend","commit_stats":null,"previous_names":["r74tech/wikitext-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/r74tech/wikitext-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r74tech%2Fwikitext-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r74tech%2Fwikitext-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r74tech%2Fwikitext-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r74tech%2Fwikitext-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r74tech","download_url":"https://codeload.github.com/r74tech/wikitext-backend/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r74tech%2Fwikitext-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29038628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T06:39:36.383Z","status":"ssl_error","status_checked_at":"2026-02-03T06:39:32.787Z","response_time":96,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-02-03T08:33:44.035Z","updated_at":"2026-02-03T08:33:44.118Z","avatar_url":"https://github.com/r74tech.png","language":"TypeScript","funding_links":["https://github.com/sponsors/RTa-technology"],"categories":[],"sub_categories":[],"readme":"# Wikitext Backend\n\nWikitext preview API built with Cloudflare Workers, Hono, and D1 database.\n\n## Features\n\n- Create and update wiki pages with revision history\n- Full revision history tracking with automatic revision counting\n- Deployed globally on Cloudflare's edge network\n- D1 SQLite database with type-safe queries (Kysely)\n- CORS support for web applications\n- Multi-environment support (staging/production)\n- FTML rendering via external WASM module\n- Zero-config deployment with Wrangler\n\n## Prerequisites\n\n- Node.js 18+ or Bun\n- Cloudflare account with Workers and D1 access\n- Wrangler CLI (`npm install -g wrangler`)\n\n## Setup\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/wikitext-backend.git\ncd wikitext-backend\n```\n\n2. Install dependencies:\n```bash\nnpm install\n# or\nbun install\n```\n\n3. Create D1 databases:\n```bash\n# Create staging database\nwrangler d1 create wikitext-db-stg\n\n# Create production database  \nwrangler d1 create wikitext-db-prd\n```\n\n4. Update `wrangler.toml` with your database IDs:\n```toml\n[[env.stg.d1_databases]]\ndatabase_id = \"YOUR_STG_DATABASE_ID\"\n\n[[env.prd.d1_databases]]\ndatabase_id = \"YOUR_PRD_DATABASE_ID\"\n```\n\n5. Run migrations:\n```bash\n# For local development\nnpm run db:migrate:local\n\n# For staging\nnpm run db:migrate:stg\n\n# For production\nnpm run db:migrate:prd\n```\n\n## Development\n\n```bash\n# Start development server (staging environment)\nnpm run dev\n\n# Start with production config\nnpm run dev:prd\n```\n\nThe API will be available at `http://localhost:8787`\n\n## Deployment\n\n### Manual Deployment\n\n```bash\n# Deploy to staging\nnpm run deploy:stg\n\n# Deploy to production\nnpm run deploy:prd\n```\n\n### Automated Deployment (GitHub Actions)\n\nThe project includes automated deployment workflows:\n- Push to `develop` branch → Deploy to staging\n- Push to `main` branch → Deploy to production\n- FTML WASM module is automatically deployed to GitHub Pages\n\n## API Endpoints\n\n### Health Check\n- `GET /` - API info and available endpoints\n- `GET /v1/health` - Health status\n\n### Data Management\n- `POST /v1/data` - Create new wiki page\n  ```json\n  {\n    \"title\": \"Page Title\",\n    \"source\": \"Wiki content\",\n    \"createdBy\": \"username\"\n  }\n  ```\n\n- `PATCH /v1/data/:shortId` - Update existing page\n  ```json\n  {\n    \"title\": \"Updated Title\",\n    \"source\": \"Updated content\",\n    \"createdBy\": \"username\"\n  }\n  ```\n\n- `GET /v1/data/:shortId` - Get current page data\n\n### History\n- `POST /v1/data/:shortId/history` - Get revision history\n- `POST /v1/data/:shortId/revision/:revisionNumber` - Get specific revision\n\n## Database Schema\n\n### indexdata\n- Current state of wiki pages\n- Tracks latest content and revision count\n- Auto-incrementing revision count via triggers\n\n### revisiondata\n- Historical revisions of pages\n- Immutable audit trail\n- Foreign key relationship to indexdata\n\n## Development Tips\n\n1. Use `wrangler tail` to view real-time logs\n2. Test locally with `wrangler dev --local`\n3. Use D1 console for database queries: `wrangler d1 execute`\n\n## Migration from PostgreSQL\n\nThis project was migrated from PostgreSQL/Docker to Cloudflare Workers. Key changes include:\n- PostgreSQL to D1 (SQLite)\n- Node.js/Bun runtime to Cloudflare Workers runtime\n- Docker deployment to Wrangler deployment\n- bcrypt to Web Crypto API (password features removed)\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr74tech%2Fwikitext-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr74tech%2Fwikitext-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr74tech%2Fwikitext-backend/lists"}