Skip to content

6639835/chart-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

62 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Chart Viewer - EFB

A modern Electronic Flight Bag (EFB) style chart viewer for aviation charts.

Features

  • ๐Ÿ“Š Chart Management: Browse charts by airport and category
  • ๐Ÿ›ซ Multi-Airport Support: Easy switching between different airports
  • ๐Ÿ“ Smart Categorization: Charts organized by type (STAR, APP, TAXI, SID, OTHER, ็ป†ๅˆ™)
  • ๐Ÿ“„ PDF Viewer: Built-in PDF viewer with zoom and navigation controls
  • โš™๏ธ Configurable Directories: Web-based interface to select charts and CSV directories
  • ๐ŸŽจ Modern UI: Clean, professional EFB-style interface
  • ๐Ÿš€ Fast Performance: Next.js powered for optimal speed

Categories

  • STAR: Standard Terminal Arrival Routes (ๆ ‡ๅ‡†ไปช่กจ่ฟ›ๅœบๅ›พ)
  • APP: Approach Procedures (ไปช่กจ่ฟ›่ฟ‘ๅ›พ)
  • TAXI: Airport Taxi Charts (ๆœบๅœบๅ›พ_ๅœๆœบไฝ็ฝฎๅ›พ)
  • SID: Standard Instrument Departures (ๆ ‡ๅ‡†ไปช่กจ็ฆปๅœบๅ›พ)
  • OTHER: Other charts (ๅ…ถไป–, ๆœบๅœบ้šœ็ข็‰ฉๅ›พ็ญ‰)
  • ็ป†ๅˆ™: Airport Regulations (ๆœบๅœบ็ป†ๅˆ™)

Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Install dependencies
npm install

# Generate application icons
npm run generate-icons

Running the Development Server

Web Mode (Browser)

npm run dev

Open http://localhost:3000 in your browser.

Desktop Mode (Electron)

npm run electron:dev

This will start the Next.js dev server and launch the desktop application with native system dialogs for directory selection.

Configuring Data Directories

The application uses charts/ and csv/ directories by default. To use different directories:

  1. Click the Settings icon (โš™๏ธ) in the sidebar
  2. Use the Browse button to:
    • Desktop Mode: Opens native system file picker (Finder on macOS)
    • Web Mode: Use web-based directory browser
  3. Enter paths (relative to project root or absolute paths):
    • Charts Directory: Directory containing PDF chart files
    • CSV Directory: Directory containing Charts.csv file
  4. Click Save Changes

Configuration is saved to config.json in the project root.

Building for Production

Web Version

npm run build
npm start

Desktop Application (Local Build)

# Build for macOS
npm run electron:build:mac

# Build for Windows
npm run electron:build:win

# Build for Linux
npm run electron:build:linux

Built applications will be in the dist/ directory.

Desktop Application (Automated Build & Release)

The project includes GitHub Actions workflows for automated cross-platform builds:

Creating a Release:

# Interactive release tool
npm run release

# Or manually create a tag
npm version patch  # or minor, major
git push --tags

Build Triggers:

  • Stable releases: Push tags like v1.0.0 โ†’ Creates GitHub Release with installers
  • Pre-releases: Push tags like v1.0.0-beta.1 โ†’ Creates pre-release
  • Manual: Trigger builds from GitHub Actions tab
  • Pull Requests: Automatic build verification (no release)

Supported Platforms:

  • macOS: DMG installer + ZIP archive
  • Windows: NSIS installer + Portable executable
  • Linux: AppImage + DEB package

Download Options:

  • Artifacts available in GitHub Actions (7-14 days)
  • Releases published at: https://github.com/6639835/chart-viewer/releases

For detailed release documentation, see .github/workflows/README.md.

macOS Installation (Unsigned App)

Since the application is not code-signed with an Apple Developer certificate, macOS Gatekeeper may block it from running. After installing the DMG, run this command in Terminal to remove the quarantine attribute:

xattr -cr "/Applications/Chart Viewer.app"

Alternative methods:

  1. Right-click method: Right-click the app โ†’ Open โ†’ Click "Open" in the security dialog
  2. System Settings: Go to System Settings โ†’ Privacy & Security โ†’ Allow the app to run

Note: This is only required for the first launch. The command removes the quarantine flag that macOS applies to downloaded applications.

Project Structure

chart-viewer/
โ”œโ”€โ”€ app/                    # Next.js app directory
โ”‚   โ”œโ”€โ”€ api/               # API routes
โ”‚   โ”‚   โ”œโ”€โ”€ charts/        # Chart data API
โ”‚   โ”‚   โ”œโ”€โ”€ pdf/           # PDF serving API
โ”‚   โ”‚   โ”œโ”€โ”€ config/        # Configuration API
โ”‚   โ”‚   โ””โ”€โ”€ browse/        # Directory browsing API
โ”‚   โ”œโ”€โ”€ globals.css        # Global styles
โ”‚   โ”œโ”€โ”€ layout.tsx         # Root layout
โ”‚   โ””โ”€โ”€ page.tsx           # Home page
โ”œโ”€โ”€ components/            # React components
โ”‚   โ”œโ”€โ”€ Sidebar.tsx        # Airport & category navigation
โ”‚   โ”œโ”€โ”€ ChartList.tsx      # Chart list display
โ”‚   โ”œโ”€โ”€ PDFViewer.tsx      # PDF viewer component
โ”‚   โ””โ”€โ”€ SettingsModal.tsx  # Settings configuration
โ”œโ”€โ”€ electron/              # Electron application
โ”‚   โ”œโ”€โ”€ main.js           # Main process (app lifecycle)
โ”‚   โ””โ”€โ”€ preload.js        # Preload script (IPC bridge)
โ”œโ”€โ”€ lib/                   # Utility functions
โ”‚   โ”œโ”€โ”€ chartParser.ts     # CSV parsing logic
โ”‚   โ””โ”€โ”€ configManager.ts   # Configuration management
โ”œโ”€โ”€ types/                 # TypeScript types
โ”‚   โ”œโ”€โ”€ chart.ts           # Chart data types
โ”‚   โ”œโ”€โ”€ config.ts          # Configuration types
โ”‚   โ””โ”€โ”€ electron.d.ts      # Electron API types
โ”œโ”€โ”€ csv/                   # CSV data files
โ”‚   โ””โ”€โ”€ Charts.csv         # Chart metadata
โ”œโ”€โ”€ charts/                # PDF files
โ”‚   โ””โ”€โ”€ *.pdf              # Chart PDFs
โ””โ”€โ”€ config.json            # User configuration (generated)

Data Format

The application reads chart metadata from csv/Charts.csv with the following structure:

  • AirportIcao: Airport ICAO code (e.g., ZBAA)
  • ChartTypeEx_CH: Chart type in Chinese
  • PAGE_NUMBER: Page identifier used in PDF filename
  • Other metadata fields

Supported Chart Directory Formats

The application automatically detects and supports two directory formats for chart PDFs:

Format 1: Flat Structure (All charts in one directory)

charts/
  โ”œโ”€โ”€ ZBAA-AD2-ZBAA-1-1.pdf
  โ”œโ”€โ”€ ZBAA-AD2-ZBAA-1-2.pdf
  โ”œโ”€โ”€ ZSSS-AD2-ZSSS-1-1.pdf
  โ””โ”€โ”€ ๆœบๅœบ็ป†ๅˆ™.pdf

Format 2: Nested Structure (Organized by airport)

charts/
  โ”œโ”€โ”€ ZBAA/
  โ”‚   โ”œโ”€โ”€ ZBAA-AD2-ZBAA-1-1.pdf
  โ”‚   โ”œโ”€โ”€ ZBAA-AD2-ZBAA-1-2.pdf
  โ”‚   โ””โ”€โ”€ ZBAA-AD2-ZBAA-1-3.pdf
  โ”œโ”€โ”€ ZSSS/
  โ”‚   โ”œโ”€โ”€ ZSSS-AD2-ZSSS-1-1.pdf
  โ”‚   โ””โ”€โ”€ ZSSS-AD2-ZSSS-1-2.pdf
  โ””โ”€โ”€ ๆœบๅœบ็ป†ๅˆ™.pdf

Note: The system will automatically try the nested format first (checking {ICAO}/filename), then fall back to the flat format if the file is not found. No configuration needed!

Technologies Used

  • Next.js 14: React framework with App Router
  • TypeScript: Type-safe development
  • Tailwind CSS: Utility-first styling
  • React-PDF: PDF rendering
  • PapaParse: CSV parsing
  • Lucide React: Icon library

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Copyright (c) 2025 Justin


Made with โค๏ธ for aviation enthusiasts

About

A modern Electronic Flight Bag (EFB) application for viewing aviation charts.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published