[FEATURE]: Add a backend server so articles can be submitted from the website

未关闭
#108 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃

调研方向

Start by reading the existing /submit page, lib/markdown-renderer.tsx, articles-index.json, and the GitHub Actions workflow to understand the current formats and deployment flow. Then decide where the separate API will run and how it will authenticate with GitHub; the issue leaves both decisions open. Done means validated submissions create a PR with the article, images, and a valid index entry, with clear errors and updated README and submission docs.

由索引模型根据 Issue 内容生成。

描述

documentation enhancement
Feature and its Use Cases

Title: [Feature] Add a backend server so articles can be submitted from the website (no manual PR)

Problem

Contributors currently have to fork the repo, add a .md file and images, hand-edit articles-index.json and open a PR. This is a barrier for non-developers, and mistakes in the index (a bad comma, a slug that doesn't match the filename) break the build.

Proposal

Turn the submission flow into a small client-server app:

  • Client (existing Next.js site, /submit): a form with title, author, date, excerpt, header image, a Markdown editor with live preview (reusing lib/markdown-renderer.tsx) and image upload. It also does basic client-side validation.
  • Server (new Node.js/Express API, hosted separately): the site is a static export on GitHub Pages, so it can't handle uploads itself. The server:
    1. receives and re-validates the submission (fields, date format, image type/size, slug uniqueness),
    2. generates the slug and the articles-index.json entry (featured: false),
    3. uses the GitHub API to create a branch, commit the .md and images, and open a PR for maintainer review.
  • On merge, the existing GitHub Actions workflow deploys the site as it does now.

Key requirements

  • No GitHub account needed to submit.
  • Keep the current file and index format, so nothing else changes.
  • Enforce the existing image rules (JPG/PNG/WebP, max 2 MB, hyphenated lowercase names).
  • The GitHub token stays server-side only.
  • Rate limiting, CAPTCHA or honeypot, and sanitization of submitted content.
  • The manual PR route keeps working, and the docs are updated.

Open questions

  • Where should the server be hosted, and who owns the GitHub bot token or app?
  • Is it OK to keep maintainer review via PR as the approval step?

Acceptance criteria

  • A user can submit an article from /submit without using Git.
  • Submission creates a PR with the .md, images and a valid index entry.
  • Invalid input is rejected with clear errors.
  • README and /submit docs are updated.

I'd like to work on this if the approach looks good.

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
主要语言
TypeScript
星标
9
派生
35
平均合并
4 天 15 小时
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

StabilityNexus/StableViewpoints 的其他 Issue

查看 StabilityNexus/StableViewpoints 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。