Skip to content
mousabePublic

About

Local-first X (Twitter) archive dashboard — browse your tweets, DMs, ads, and analytics privately. No servers, no accounts, no telemetry.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

XArchive

XArchive banner

Next.js 14 TypeScript SQLite MIT License PRs Welcome

Your X archive. Your machine. No servers, no accounts, no telemetry.

Local-first archive search, analytics, surveillance-style insights, Grok history, media browsing, and export in a single Next.js app.

Why This Exists

Most archive tools push data into hosted dashboards, require API keys, or split the app into a frontend and backend stack. XArchive is intentionally simpler:

  • One local Next.js app
  • One local SQLite database
  • No scraping
  • No external services
  • No telemetry

Quick Start

Clone, install, and run locally:

git clone https://github.com/yourusername/XArchive
cd XArchive
npm install
npm run dev
# Open http://localhost:3000

What You Get

  • Full archive import from the official X ZIP export
  • Fast full-text search powered by SQLite FTS5
  • Overview metrics for originals, replies, retweets, likes, media, and account history
  • Timeline browsing with search, filters, deleted tweet vault support, and exact tweet linking
  • Analytics for posting patterns, yearly activity, top posts, hashtags, mentions, languages, and social graph snapshots
  • Grok history browser with searchable conversations, session grouping, and inline archive media
  • Security audit views for connected apps, login history, and registered devices
  • Insights tab for personalization labels, ad targeting, advertiser exposure, and conversion data
  • Local media browsing with lightbox navigation and direct file serving from the stored archive
  • Export options for CSV, JSON, Markdown ZIP, and a screenshot-ready Your X Wrapped card

Getting Your X Archive

In X, open Settings and privacy -> Your account -> Download an archive of your data. X usually emails a download link after a waiting period that can take up to 24 hours.

Tech Stack

  • Next.js 14 App Router
  • TypeScript in strict mode
  • better-sqlite3 for local persistence
  • Tailwind CSS v3 with CSS custom properties for X dark theming
  • Recharts plus a custom SVG heatmap
  • Zustand and TanStack Query v5
  • JSZip for client-side and server-side archive inspection
  • Framer Motion for transitions and metric animations

Modules

  • Overview: account snapshot, top posts, archive coverage, and username history
  • Timeline: published tweets, deleted tweets, search, filters, and deep links
  • Analytics: yearly activity, heatmaps, topics, languages, and social graph analysis
  • Insights: personalization profile and ad surveillance data X normally buries
  • Security: connected apps, login audit history, and registered device inventory
  • Grok: searchable browser for archived Grok conversations and Grok media
  • Media: gallery view with modal browsing, download, and jump-to-tweet actions
  • Export: whole-account dossier exports plus Your X Wrapped

Screens

Import view placeholder Overview placeholder Analytics placeholder

Architecture

Runs entirely on your machine.

  • Next.js serves the UI and local API routes
  • The official archive ZIP is stored locally and re-used for lazy indexing of heavy datasets
  • JSZip and local archive readers parse official X export files without external APIs
  • better-sqlite3 stores parsed data in a single archive.db
  • Media, Grok assets, deleted tweet media, and profile assets are served locally
  • Queries, analytics, audits, and exports are generated from local data only

Security Model

This app runs entirely locally. No data is transmitted. No analytics. No telemetry.

  • No API keys or remote account sync
  • No background upload jobs
  • No external analytics scripts
  • No archive data leaves your machine unless you explicitly export it
  • The imported archive ZIP, SQLite database, and derived assets stay on disk locally

Privacy

No scraping, no background sync, and no data leaves the local machine.

flowchart LR
  A["X Archive ZIP"] --> B["Next.js Import Route"]
  B --> C["Local Parser + Archive Indexer"]
  C --> D["better-sqlite3 archive.db"]
  C --> E["Stored archive ZIP / local media assets"]
  D --> F["Overview / Timeline / Analytics / Insights / Security / Grok / Export"]
  E --> F
Loading

Project Structure

src/app           Next.js app routes and API routes
src/components    UI, layout, charts, and page compositions
src/lib           Database, parser, queries, and exporters
src/hooks         React Query hooks
src/store         Zustand state
src/types         Shared TypeScript types
data/archive      Stored local archive ZIP used for lazy indexing
assets/media      Imported archive media
archive.db        Local SQLite database

Development

npm run typecheck
npm run build
npm run audit

The project is designed to run fully offline after dependencies are installed.

Contributing

  1. Fork the repository.
  2. Create a feature branch for your work.
  3. Run npm install, npm run typecheck, and npm run build.
  4. Open a pull request with screenshots for UI changes and sample archive notes for parser changes.

License

MIT

About

Local-first X (Twitter) archive dashboard — browse your tweets, DMs, ads, and analytics privately. No servers, no accounts, no telemetry.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages