PaperPlane is a modern aviation logbook application designed to help pilots track their flights, currency, and proficiency. It features a Next.js frontend, an Express/Node.js backend, and a Python-based OCR service for digitizing physical logbook entries.
- Digital Logbook: View, add, edit, and delete flight entries.
- OCR Integration: Upload photos of your paper logbook to automatically extract flight data.
- Flight Verification: Verify your logged flights against a database of archived flight records to ensure accuracy.
- Pilot Status: Track your flight times!
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- Python (v3.8 or higher)
- npm (usually comes with Node.js)
- Clone the repository:
git clone https://github.com/griffing52/PaperPlane.git cd PaperPlane - Setup the virtual environment for the OCR Service
python3 -m venv .venv source .venv/bin/activate pip install -r ocr/requirements.txt - Install Node.js dependencies (Frontend & Backend):
npm run install:all
- Install Python dependencies (OCR Service):
npm run install:ocr # OR manually: cd ocr # NOTE: May need to create a venv (if not already done) # pip install -r requirements.txt
- Put the
.envfile sent to their email in the root of the project. - Put the
serviceAccountKey.jsonsent in your email in theserver/directory of the project.
-
General Set up of Environment Variables:
(skip if using.envandserviceAccountKey.jsonfrom email)
Copy the sample environment file to.env:cp .env.sample .env
Edit
.envto add your configuration (e.g., Firebase API keys, OCR provider settings). -
Firebase Setup:
- Obtain your Firebase service account private key.
- Save it as
serviceAccountKey.jsonin theserver/directory.
This project uses SQLite. You need to initialize the database and seed it with data.
-
Run Migrations: Change directory to root. Run:
npx prisma migrate dev --name initial_migration
-
Generate Prisma Client:
npx prisma generate
-
Seed the Database: This populates the database with sample users and archived flight data for verification.
npm run seed
You can run all services (Frontend, Backend, OCR) concurrently with a single command:
npm run dev:allAlternatively, you can run them individually in separate terminals:
-
Frontend (http://localhost:3000):
npm run dev:frontend
-
Backend (http://localhost:3002):
npm run dev:server
-
OCR Service (http://localhost:8000):
npm run dev:ocr
To run all tests (Frontend, Backend, OCR):
npm run test:allOr run them individually:
- Backend Tests:
npm run test:server - Frontend Tests:
npm run test:frontend(if configured) - OCR Tests:
npm run test:ocr - E2E Tests:
npm run test:e2e
- Visit the home page at localhost:3000.
- Signup and login to your account.
- Play around with manual entries.
- Incorrect entries should show the errors in the user interface.
- Use the provided example image in
ocr/images/handwritten.pngto import several entries. - Test verification with the verify button (there is a tolerance of 60 minutes on the duration).
- After you do that, delete the invalid entries.
We also implemented a hybrid approach to OCR by using Textract to get raw outputs and Gemini to format into JSON.
To test this, please change the environment variable OCR_PROVIDER to HYBRID in .env.
The ocr/images/handwritten-2.png sample image will fail on the AWS provider but pass on the hybrid provider.
The dashboard includes a Verify button. This feature checks your logbook entries against the archived flight data in the database.
- Green Checkmark: The flight matches an archived record (same date, duration, and route).
- Red X: No matching flight was found in the archives.
To see the archived flights available for verification, you can use Prisma Studio:
cd server
npx prisma studioWe have two entities corresponding to a flight in our database. We have a "FlightEntry", which is what a pilot enters in their logbook. We also have a "Flight", which is what we get from our external flight database. When we verify a flight, a FlightEntry is associated with a Flight. A flight can be associated with any number of flight entries because there could be multiple pilots.
The following diagram provides a high-level overview of the app's components:

