This directory contains data import scripts for PK Spot.
scripts/
├── README.md # This file
├── spots-data.example.json # Generic spot data example
└── horizn-import/ # Horizn app import system
├── README.md # Complete documentation
├── import.ts # Main import script
├── validate.ts # Data validator
├── types.ts # Type definitions
├── importEngine.ts # Core logic
├── spotTransformer.ts # Data transformer
├── storageUploader.ts # Storage handler
├── duplicateChecker.ts # Duplicate detection
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
└── data/ # Your data (gitignored)
├── horizn-spots-output.json
└── spots_pics/
Never commit:
- Service account keys (
serviceAccountKey.json) - Data folders (
data/) - Compiled output (
dist/)
These are already in .gitignore.
The Horizn import system is modular. To add a new data source:
- Copy
horizn-import/folder structure - Update
types.tswith your data format - Create new transformer (like
spotTransformer.ts) - Reuse
importEngine.ts,storageUploader.ts,duplicateChecker.ts - Add npm scripts to root
package.json
Core components (importEngine, storageUploader, duplicateChecker) work with any source!
- All import scripts are TypeScript for type safety
- They use your actual schemas from
src/db/schemas/ - Compiled output goes to
dist/folder - Duplicate detection prevents reimporting existing spots
- Images get proper Storage URLs (not just paths)
For detailed Horizn import documentation, see: horizn-import/README.md