Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e0ffe01
docs: add build spec and May 2026 reference
Muawiya-contact Nov 16, 2026
f9919f0
chore: scaffold Next.js foundation
Muawiya-contact Nov 16, 2026
66758dd
chore: lock foundation dependencies
Muawiya-contact Nov 16, 2026
1c2ae90
feat: add editorial design system
Muawiya-contact Nov 16, 2026
f595474
feat: build public magazine website
Muawiya-contact Nov 16, 2026
f524ef2
feat: add Supabase foundation and editor access
Muawiya-contact Nov 16, 2026
e06146e
feat: add editor desk and magic-link access
Muawiya-contact Nov 16, 2026
19c24d7
feat: add secure API stubs
Muawiya-contact Nov 16, 2026
ab75ea1
chore: secure Vercel function configuration
Muawiya-contact Nov 16, 2026
8575c97
ci: add app, ingest, and LaTeX workflows
Muawiya-contact Nov 16, 2026
914ab97
docs: add foundation setup and project status
Muawiya-contact Nov 16, 2026
8e4af86
chore: align lint toolchain versions
Muawiya-contact Nov 16, 2026
1bf46e5
fix: omit undated editions from sitemap
Muawiya-contact Nov 16, 2026
bfb12ed
fix: narrow editor navigation permissions
Muawiya-contact Nov 16, 2026
d6b76cb
fix: guard missing Supabase claims
Muawiya-contact Nov 16, 2026
e8ea58f
chore: remove deprecated region exports
Muawiya-contact Nov 16, 2026
07fbc6f
chore: sync TypeScript config with Next.js
Muawiya-contact Nov 16, 2026
34f0e7b
fix: load tcolorbox shadow styles from skins
Muawiya-contact Nov 16, 2026
4950134
fix: use supported lettrine color styling
Muawiya-contact Nov 16, 2026
ea06ebb
fix: use tcolorbox title background keys
Muawiya-contact Nov 16, 2026
c266599
fix: scope uppercase formatting to section titles
Muawiya-contact Nov 16, 2026
2772dbf
fix: place section dividers on separate lines
Muawiya-contact Nov 16, 2026
d48d1af
fix: escape ampersands in source labels
Muawiya-contact Nov 16, 2026
adc1472
fix: prevent editor email enumeration
Muawiya-contact Nov 16, 2026
3b5bb64
fix: constrain auth callback redirects
Muawiya-contact Nov 16, 2026
138a51c
fix: limit public edition fields
Muawiya-contact Nov 16, 2026
5a39a81
docs: use a tracked cover placeholder
Muawiya-contact Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Public canonical URL for metadata and auth redirects.
NEXT_PUBLIC_SITE_URL=
# Supabase project URL.
NEXT_PUBLIC_SUPABASE_URL=
# Supabase anon/publishable key.
NEXT_PUBLIC_SUPABASE_ANON_KEY=
# Supabase service-role key; server only.
SUPABASE_SERVICE_ROLE_KEY=
# Shared secret for GitHub Actions API calls.
CRON_SECRET=
# Reserved for the later AI phase; unused by the foundation.
GEMINI_API_KEY=
# Reserved model name for the later writing phase.
WRITER_MODEL=
# Reserved model name for the later design phase.
DESIGNER_MODEL=
# Reserved for later workflow dispatch; unused by the foundation.
GITHUB_DISPATCH_TOKEN=
# App URL used by GitHub Actions; also add as the APP_URL repository secret.
APP_URL=
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_SITE_URL: http://localhost:3000
NEXT_PUBLIC_SUPABASE_URL: http://127.0.0.1:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY: ci-anon-key
SUPABASE_SERVICE_ROLE_KEY: ci-service-role-key
CRON_SECRET: ci-cron-secret-at-least-32-characters-long
APP_URL: http://127.0.0.1:3000
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Build
run: npm run build
41 changes: 41 additions & 0 deletions .github/workflows/ingest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Scheduled ingest

on:
schedule:
- cron: "0 1,8,15 * * *"
workflow_dispatch:

permissions: {}

concurrency:
group: ingest-${{ github.ref }}
cancel-in-progress: false

jobs:
call-ingest:
runs-on: ubuntu-latest
steps:
- name: Call the ingest stub
env:
APP_URL: ${{ secrets.APP_URL }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
run: |
if [[ -z "$APP_URL" ]]; then
echo "::notice title=Configuration::APP_URL is not set; skipping the scheduled request."
exit 0
fi
if [[ -z "$CRON_SECRET" ]]; then
echo "::error title=Configuration::CRON_SECRET is not set."
exit 1
fi
http_code=$(curl --silent --show-error \
--output "$RUNNER_TEMP/ingest-response.json" \
--write-out "%{http_code}" \
--request POST \
--header "Authorization: Bearer $CRON_SECRET" \
"$APP_URL/api/cron/ingest")
cat "$RUNNER_TEMP/ingest-response.json"
if [[ ! "$http_code" =~ ^2[0-9][0-9]$ ]]; then
echo "::error title=Ingest request failed::The endpoint returned HTTP $http_code."
exit 1
fi
39 changes: 39 additions & 0 deletions .github/workflows/latex-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: LaTeX check

on:
push:
paths:
- "latex/**"
- ".github/workflows/latex-check.yml"
pull_request:
paths:
- "latex/**"
- ".github/workflows/latex-check.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: latex-${{ github.ref }}
cancel-in-progress: true

jobs:
compile-reference:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Compile the May reference
uses: xu-cheng/latex-action@v4
with:
texlive_version: 2026
root_file: latex/reference/may-2026.tex
work_in_root_file_dir: true
args: -pdf -file-line-error -halt-on-error -interaction=nonstopmode
- name: Upload PDF artifact
uses: actions/upload-artifact@v4
with:
name: may-2026-reference
path: latex/reference/may-2026.pdf
if-no-files-found: error
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# dependencies
/node_modules
/.pnp
.pnp.*

# build output
/.next/
/out/
/build/

# local environment files (keep .env.example tracked)
.env*
!.env.example

# Supabase local state
/supabase/.temp/

# debug logs
npm-debug.log*
yarn-debug.log*
pnpm-debug.log*

# editor and OS files
.DS_Store
*.pem
.idea/
.vscode/*
!.vscode/extensions.json

# generated local files
/coverage/
*.tsbuildinfo
next-env.d.ts
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
26.13.1
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"plugins": ["prettier-plugin-tailwindcss"],
"semi": true,
"singleQuote": false,
"trailingComma": "all"
}
71 changes: 44 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,63 @@

The newsroom behind **Machine Intelligence**, the magazine of the Department of Artificial Intelligence at NFC IET Multan.

This app is planned to gather AI news from trusted sources, group articles about the same event, and prepare short summaries for editors. Editors will review each story, approve or reject it, and build the next magazine issue as a PDF or LaTeX for Overleaf.
The foundation is in place: a public magazine site, a Supabase-backed editor allowlist, a mobile-friendly editor desk, secure API stubs, and GitHub Actions for CI, scheduled ingest calls, and LaTeX checks. The first issue and editor story cards still use clearly labeled sample data.

> **Project status:** This repository is being bootstrapped. The app, specification, environment template, and automation are not in place yet; they will be added in focused pull requests.
## Foundation status

## Planned workflow
- **Public site:** home, issue archive and issue detail, About, How it is made, Privacy, sitemap, robots, Open Graph image, and a custom not-found page.
- **Editor desk:** email magic links for emails on the editor list; Draft, Stories, Quarantine, Sources, Images, Issues, and admin-only Editors pages.
- **Supabase:** editors, editions, and runs tables; row-level security; public issues and private drafts buckets; vector extension.
- **API:** health endpoint plus authenticated ingest and compile-callback stubs. The stubs only write run records.
- **Automation:** CI checks, a three-times-daily GitHub Actions request, and a LaTeX reference compile workflow.
- **Not active yet:** RSS ingestion, Gemini calls, story clustering or scoring, draft rendering, PDF publishing, and publication logic.

1. **Collect.** Scheduled jobs read RSS feeds from trusted news sites, official company blogs, and research pages.
2. **Write.** An AI step summarizes each story with key facts and links to its sources. Facts and numbers are checked against the original articles.
3. **Review.** Editors approve or reject stories. Rejected stories go to Quarantine and can be restored.
4. **Design.** A second AI step assigns stories to positions and styles from the magazine's existing design pieces.
5. **Build.** Code turns the approved layout into LaTeX, and a GitHub Action compiles the PDF.
6. **Publish.** Once an issue is released, its stories are marked as used and the next draft starts with fresh news.
## Stack

## Planned stack
Next.js App Router, React, TypeScript, Tailwind CSS, Supabase Auth/Postgres/Storage, GitHub Actions, Vercel, and TeX Live. Gemini is reserved for a later phase.

Next.js · TypeScript · Tailwind · Supabase (Postgres, Storage, Auth) · Gemini API · GitHub Actions · TeX Live · Vercel
## Development

## Planned project layout
Use Node.js 26.13.1, matching .nvmrc.

~~~text
app/ pages and API routes
lib/ingest/ RSS, full text, and story grouping
lib/ai/ writer, designer, tone, and layout checks
lib/render/ LaTeX components and escaping
lib/score.ts story ranking
lib/select.ts draft selection
config/ magazine settings and writing style guide
supabase/migrations/ database schema
.github/workflows/ ingest, compile, and deploy
~~~bash
nvm install
nvm use
npm ci
cp .env.example .env.local
npm run dev
~~~

## Development
The public site can show its sample preview without Supabase credentials. Sign-in, the editor desk, and API stubs need the required values in .env.local. See [the setup guide](docs/SETUP.md).

~~~bash
npm run lint
npm run typecheck
npm run build
~~~

The application scaffold has not been added yet, so local run instructions will follow with the first application setup pull request. A Supabase project and Gemini API key will be needed for the completed app.
## Project documents

Never commit real API keys. Use the example environment file when it is added.
- [Developer setup](docs/SETUP.md)
- [Build specification](docs/SPEC.md)
- [May 2026 LaTeX design reference](latex/reference/may-2026.tex)

## Deployment
## Project layout

The intended deployment uses Vercel for the Next.js app and GitHub Actions for scheduled jobs and PDF builds. Deployment workflows and environment setup will be added in later pull requests.
~~~text
app/ public pages, editor desk, and API routes
components/ shared site, editor, and UI components
config/ magazine identity, sections, and slot counts
content/site.ts public and editor-facing copy
lib/data/ clearly labeled sample issue and story data
lib/ingest/ phase 2 feed collection
lib/ai/ phase 2 model providers
lib/render/ later LaTeX rendering
supabase/migrations/ database schema and access policies
.github/workflows/ CI, ingest request, and LaTeX check
~~~

A [Coding Moves](https://codingmoves.com) project.

## Contributions

Expand Down
79 changes: 79 additions & 0 deletions app/(site)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import type { Metadata } from "next";
import Link from "next/link";
import { magazine } from "@/config/magazine";
import { siteCopy } from "@/content/site";
import { PageHeading } from "@/components/page-heading";
import { Section } from "@/components/ui/section";

export const metadata: Metadata = {
title: "About",
description: siteCopy.about.intro,
};

export default function AboutPage() {
return (
<>
<Section>
<PageHeading
eyebrow={siteCopy.about.eyebrow}
title={siteCopy.about.title}
description={siteCopy.about.intro}
/>
</Section>
<Section variant="mist" className="border-y border-line">
<div className="grid gap-10 md:grid-cols-2 md:gap-16">
<div>
<h2 className="text-3xl tracking-tight">{siteCopy.about.purposeTitle}</h2>
<p className="mt-4 max-w-xl text-sm leading-7 text-muted">
{siteCopy.about.purpose}
</p>
</div>
<div className="space-y-8">
<section>
<h2 className="text-2xl tracking-tight">{siteCopy.about.supervisionTitle}</h2>
<p className="mt-3 text-base text-ink">{magazine.supervisor.name}</p>
<p className="mt-1 text-sm leading-6 text-muted">{magazine.supervisor.title}</p>
<p className="text-sm leading-6 text-muted">{magazine.universityShort}</p>
</section>
<section>
<h2 className="text-2xl tracking-tight">{siteCopy.about.editorsTitle}</h2>
<ul className="mt-3 space-y-2 text-sm leading-6 text-muted">
{magazine.editors.map((editor) => (
<li key={editor}>{editor}</li>
))}
</ul>
</section>
</div>
</div>
</Section>
<Section>
<div className="grid gap-10 md:grid-cols-3 md:gap-12">
<section>
<h2 className="text-2xl tracking-tight">{siteCopy.about.correctionTitle}</h2>
<p className="mt-3 text-sm leading-6 text-muted">{siteCopy.about.correction}</p>
<a
className="mt-4 inline-flex rounded-sm text-sm font-medium text-leaf-dark underline underline-offset-4 hover:text-ink"
href="https://github.com/Coding-Moves/machine-intelligence-app/issues"
target="_blank"
rel="noreferrer"
>
{siteCopy.about.correctionLink}
</a>
</section>
<section className="md:col-span-2">
<h2 className="text-2xl tracking-tight">{siteCopy.about.contributionTitle}</h2>
<p className="mt-3 max-w-2xl text-sm leading-6 text-muted">{siteCopy.about.contribution}</p>
<Link
className="mt-4 inline-flex rounded-sm text-sm font-medium text-leaf-dark underline underline-offset-4 hover:text-ink"
href="https://github.com/Coding-Moves/machine-intelligence-app/blob/main/CONTRIBUTING.md"
target="_blank"
rel="noreferrer"
>
{siteCopy.about.contributionLink}
</Link>
</section>
</div>
</Section>
</>
);
}
Loading
Loading