Skip to content
NmickymichaelPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

OPEN TAB.

YOUR WINDOW TO EVERYTHING INTERESTING.

A Mickoryn Media publication.

OPEN TAB is an international digital publication covering sports, celebrities, creators, entertainment, technology, business, lifestyle, education, world affairs, video and opinion.

Technology

  • Next.js App Router + TypeScript
  • Tailwind CSS v4
  • Supabase Postgres, Auth, Row Level Security and Storage
  • Supabase Edge Functions for public engagement endpoints
  • Markdown + GitHub Flavored Markdown article rendering
  • Privacy-enhanced YouTube embeds

Local setup

  1. Install Node.js 20.9 or later.
  2. Run npm install.
  3. Copy .env.example to .env.local.
  4. Add the dedicated OPEN TAB Supabase project URL and anon key when the project is ready.
  5. Run the SQL files in order in the Supabase SQL editor:
    • supabase/schema.sql
    • supabase/migrations/20261118_open_tab_hardening.sql
    • supabase/migrations/20261118_engagement_limits.sql
    • supabase/migrations/20261118_editorial_audit.sql
    • supabase/migrations/20261118_video_publication_policy.sql
    • supabase/migrations/20261118_scheduled_publishing.sql
    • supabase/migrations/20261118_article_image_alt.sql
    • supabase/migrations/20261119_01_reader_role.sql
    • supabase/migrations/20261119_02_reader_and_editorial_features.sql
    • supabase/migrations/20261119_03_reader_video_library.sql
    • supabase/migrations/20261119_04_contributor_profiles.sql
    • supabase/migrations/20261119_05_photography_and_source_attribution.sql
    • supabase/migrations/20261119_06_photo_license_urls.sql
    • supabase/migrations/20261119_05_photography_and_source_attribution.sql
    • supabase/migrations/20261120_01_advertising_sponsorships.sql\n - supabase/migrations/20261122_01_open_tab_hourly_story_discovery.sql\n - supabase/migrations/20261122_02_open_tab_hourly_ai_editorial_writer.sql\n - supabase/migrations/20261122_03_open_tab_writer_three_runs_hourly.sql
  6. Run supabase/tests/rls_smoke_test.sql and complete identity-based tests for anon, author, editor and admin roles.
  7. Reader accounts are created at /account and receive the restricted reader role. Editorial staff accounts must be provisioned through a trusted administrator workflow and promoted to author, editor or admin only by a trusted owner; never expose staff role assignment to public clients. Promote the first administrator manually from the Supabase SQL editor.
  8. Run npm run dev.

Editorial desk

Visit /admin. Staff self-registration is disabled; editorial staff sign in with provisioned Supabase Auth accounts. Reader registration is separate at /account and does not grant editorial access.

  • Authors: create and edit their own draft/review articles.
  • Editors: manage stories, video library, creators, dynamic departments, media, comment moderation, newsroom analytics and an administrator-only audit trail.
  • Administrators: all editor capabilities plus newsletter audience access.

The dashboard supports article creation/editing, Markdown article bodies, admin-only publishing/scheduling, homepage placement flags (breaking news, story of the day, editor’s pick, weekend read and OPEN TAB Original), SEO fields, video/podcast records and transcripts, creator profiles, hierarchical categories, image uploads, comment moderation, newsletter audience management and database-backed headline/view counts. The protected /admin/desk adds writer assignments, due dates, reporting sources, public corrections, poll creation, scheduled-story overview, contributor output and article revision history.\n\n- Automated newsroom: hourly RSS discovery gathers international story leads; a protected Gemini-powered editorial writer runs three times per hour and turns eligible leads into attributed original drafts for editor review. Approved stories can then be published or scheduled through the normal editorial workflow.

Reader experience\n\nReader accounts can save articles, follow categories and creators, react to stories, vote in editorial polls, maintain a video Watch Later queue and view recently watched videos and notifications. Story pages include estimated reading time, adjustable text size, sharing, related stories and public corrections. OPEN TAB includes a breaking-news strip, curated homepage sections, trending stories, weekend reads, topic pages, creator/contributor profiles, video and podcast destinations, dark/light reading mode and an installable offline shell.\n\n## Media storage

The hardening migration creates a public-read open-tab-media bucket with an 8 MB image limit and an allowlist of image MIME types. Only editor/admin roles can upload, update or delete media. The browser uses the Supabase anon key and the database role policies; never put a service-role key in client-side code. Stories and videos can be scheduled from the CMS. The scheduler migration attempts to register a one-minute Supabase Cron job; verify that open-tab-publish-scheduled-content exists after migration, or configure public.publish_scheduled_content() to run every minute in Supabase Cron.

AI newsroom

  • /admin/ai-newsroom is an authenticated editorial assistant for story angles, headline/dek options, excerpts, first-draft copy, social captions and a fact-check checklist.
  • The API verifies the Supabase access token and the signed-in profile role before calling the configured OpenAI-compatible chat-completions endpoint. AI output is returned as working material only; it is never published automatically.
  • The assistant does not independently verify live facts or sources. Editors must confirm names, dates, quotes, statistics, claims, rights and links before publication.

Configure these server-side environment variables in the deployment platform (do not commit secrets):

  • OPENAI_API_KEY — private API key for the chosen compatible provider.
  • OPENAI_BASE_URL — optional API base URL; defaults to https://api.openai.com/v1.
  • OPENAI_MODEL — optional model name; defaults to gpt-4o-mini.

The public homepage now gives greater prominence to the lead story, latest headlines, editorial picks, OPEN TAB TV, trending stories, creators, departments and newsletter signup. New editorial sections include Gaming, Music, Movies and Viral Culture. The article editor captures photo credit, image source, image licence/permission details, original reporting/social source URL and source platform; public story pages display the photo credit and original source link. New editorial sections include Gaming, Music, Movies and Viral Culture. The article editor captures photo credit, image source, image licence/permission details, original reporting/social source URL and source platform; public story pages display the photo credit and original source link. Video and creator sections appear when their published records are available.

Global administration and revenue operations

  • /admin/overview is the dark, responsive Global Admin control room. It is restricted to the admin profile role and summarises publishing, video, reader, comment and article-view activity.
  • /admin/monetization manages advertiser records and campaign drafts, approvals, placements and budgets. Apply 20261120_01_advertising_sponsorships.sql before using this area. Public delivery data is exposed through the limited active_ad_creatives view; campaign budgets and advertiser contacts remain private.
  • Campaign payment collection, invoices and advertiser self-service are not enabled by this foundation and require a separately configured payment provider and verified workflows.

Edge Functions

Deploy these functions to the dedicated Supabase project:

  • newsletter-subscribe — validates and rate-limits signup requests, stores pending subscribers, and sends double opt-in confirmation.
  • newsletter-confirm — confirms a subscription using its one-time token.
  • newsletter-unsubscribe — processes one-click unsubscribe tokens.
  • comment-submit — validates and rate-limits public comments before placing them in the moderation queue.
  • article-view — records deduplicated story views through a trusted server-side endpoint.

Configure Edge Function secrets (never commit these values):

  • SUPABASE_URL
  • SUPABASE_SERVICE_ROLE_KEY
  • PUBLIC_SITE_URL — exact public origin, e.g. https://your-domain.example
  • RATE_LIMIT_SALT — long random secret used to hash source IP addresses
  • RESEND_API_KEY — required for newsletter confirmation email
  • NEWSLETTER_FROM — verified sender address for your email provider

The newsletter sender domain must be verified with the email provider. The subscription flow remains pending until a reader confirms their address. Public campaign sending is not included yet.

Deploy each function with the Supabase CLI after linking the dedicated project (the link step is intentionally deferred):

supabase functions deploy newsletter-subscribe
supabase functions deploy newsletter-confirm
supabase functions deploy newsletter-unsubscribe
supabase functions deploy comment-submit
supabase functions deploy article-view

The service-role key is used only inside Edge Function secrets.

SEO and discoverability

The app includes dynamic sitemap generation, a robots policy, canonical story URLs, Open Graph/Twitter metadata, article/video metadata and NewsArticle structured data. Set NEXT_PUBLIC_SITE_URL to the real canonical domain before deployment so metadata and sitemap URLs use the correct origin.

Security notes / launch checklist

The repository is now connected to the live Supabase project and the photography/source-attribution migration has been applied. Existing published stories have been updated with verified image credits, image-source links, licence details and reporting-source links. GitHub Actions run #178 passed the dependency audit, TypeScript check and production build. The Netlify production deployment is still not verified from this repository, and the project has not been independently security-certified.

Before opening the site to the public:

  • Continue validating RLS paths with separate reader, author, editor and admin test accounts; the current schema migrations are applied to the connected Supabase project.
  • Create separate anonymous, author, editor and admin test accounts; verify every RLS path.
  • Confirm the first admin role is assigned only through the trusted database owner workflow.
  • Deploy Edge Functions and set secrets in the Supabase dashboard.
  • In Netlify, configure NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY and NEXT_PUBLIC_SITE_URL for the production site. Use the publishable/anon key only in the browser; never expose the service-role key.
  • Configure a verified newsletter sender domain and test confirmation/unsubscribe handling.
  • Add CAPTCHA/Turnstile at the edge if comment/signup abuse warrants it; current Edge Functions include per-IP rate limits and server-side validation.
  • Review privacy, terms, contact and editorial-policy pages with accurate publisher/contact details and legal advice appropriate to your operating jurisdiction.
  • Configure backups, monitoring, error reporting, retention and incident response.
  • Run the GitHub Actions typecheck/build workflow and resolve any failures.
  • Test keyboard navigation, screen-reader labels, mobile layouts, image alt text, page performance and Core Web Vitals.
  • Use only media you own, have licensed, or are authorised to embed. Video entries use YouTube's privacy-enhanced embed host. Cover photography must carry a verified photographer/agency credit, original image-source URL and licence/permission details and a direct licence URL where applicable in the editorial desk. Never treat a publicly visible image as automatically reusable. AI-generated artwork must be labelled and must never be presented as documentary news photography. Social and viral coverage should link to original public posts and use platform-authorised embeds; do not reproduce full creator posts or videos without permission. Cover photography must carry a verified photographer/agency credit, original image-source URL and licence/permission details in the editorial desk. Never treat a publicly visible image as automatically reusable. AI-generated artwork must be labelled and must never be presented as documentary news photography. Social and viral coverage should link to original public posts and use platform-authorised embeds; do not reproduce full creator posts or videos without permission.

What remains intentionally separate

Supabase project connection and live website deployment are being left for the owner, as requested. No project credentials, service-role secrets, domain, or deployment target are stored in this repository.

Editorial departments

Home · Sports · Celebrities · Creators · Entertainment · Technology · Business · Lifestyle · Education · World · Videos · Opinions · OPEN TAB Originals.

Categories and subcategories are database-managed and can be created from the editorial desk.

© 2026 Mickoryn. All rights reserved.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages