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

Aberta
#108 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
express, github, next.js, node.js, typescript

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
TypeScript
Estrelas
9
Forks
35
Merge médio
4d 15h
PRs com merge (30d)
1

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de StabilityNexus/StableViewpoints

Todas as issues de StabilityNexus/StableViewpoints

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.