Skip to content

API endpoint for pilots of all ratings and aircraft to backup and store their logbook data. This API can be run on any NAS that supports Docker (for local redundant logbook backups).

License

Notifications You must be signed in to change notification settings

Daniel-Fernandez-951/Nauclerus-API

Repository files navigation

Flake8 Mypy Isort Pytest Coverage


Logo

Pilot Logbook API


Quickly Run Github Package 🛫

Make .env file like the sample file in the repo

docker run -d -p 80:80 --env-file .env ghcr.io/daniel-fernandez-951/nauclerus-api:release

Table of Contents
  1. About Nauclerus Logbook API
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Known Issues

About Nauclerus Logbook API

API endpoint for general aviation, rotorcraft and commercial pilots to store their logbook data. Nauclerus runs in a Docker container, allowing secure local access and redundant storage using NAS device that supports running Docker containers. Nauclerus can also send your logbook data to a cloud service, ensuring there's always a backup of your logbook (at the cost of security for data redundancy).

Database Diagram

Relational SQL database schema and relationships (subject to change):

diagram

Built With

For more details, checkout requirements.txt file.

Getting Started

Instructions for running the Dockerfile locally.

❓ Running this on a NAS device (Synology or QNAP), please refer to NAS distributor documentation for running Nauclerus API on your device.

Installation

Depending on your choice in this section Data Storage Options; either configure a remote database (the cloud) or save the database file locally.

  • You decide Data Storage Options!
  • Navigate to the repository on your local machine and open a terminal window in that directory
    docker build -t <foo> . && docker run -p 80:80 -it <foo>
    • Replace <foo> with your desired container name, like thanks-daniel.

Data Storage Options

  • Local Storage:

    • Change /app/sqlUtils/database.py
      from os import getenv
      from dotenv import load_dotenv
      from sqlalchemy import create_engine
      from sqlalchemy.orm import sessionmaker
      from sqlalchemy.ext.declarative import declarative_base
      
      load_dotenv()
      
      SQLALCHEMY_DATABASE_URL = getenv('HEROKU_SQL_DB')
      
      engine = create_engine(
          SQLALCHEMY_DATABASE_URL,
          connect_args={"check_same_thread": False}
      )
      
      SessionLocal = sessionmaker(
          autocommit=False,
          autoflush=False,
          bind=engine
      )
      
      Base = declarative_base()
      • Create /.env file
      • HEROKU_SQL_DB=sqlite:///./sql_app.db
        Change sql_app.db to any file name you'd like!
  • Cloud Database Storage:

    • Confirm /app/sqlUtils/database.py looks like this:

      from os import getenv
      from dotenv import load_dotenv
      from sqlalchemy import create_engine
      from sqlalchemy.orm import sessionmaker
      from sqlalchemy.ext.declarative import declarative_base
      
      load_dotenv()
      
      SQLALCHEMY_DATABASE_URL = getenv('HEROKU_SQL_DB')
      
      engine = create_engine(
          SQLALCHEMY_DATABASE_URL
      )
      
      SessionLocal = sessionmaker(
          autocommit=False,
          autoflush=False,
          bind=engine
      )
      
      Base = declarative_base()
    • Create /.env file

      ‼️ When copying URI from cloud provider, check (or change) preamble to postgresql://

      • HEROKU_SQL_DB=postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>
        Change values in < > to your setup (most have a preformatted URI).

Usage

Once the Docker image is running, navigate to localhost/docs or localhost/redoc for API documentation with input capabilities.

Check back later for more information.

Roadmap

  • Add an endpoint for uploading logbook in the following formats:
    • .xls
    • .xlsx
    • .csv
  • Frontend for data entry
  • Other Logbook styles (Professional and General Aviation) Now has a general layout to accomidate all types and Logbook styles!
  • GET endpoint for reports
  • More GET and POST endpoints

Please suggest some features! This is a one human project (now), and new ideas welcomed to break any calcification.

License

Distributed under GPL-3.0 License. See LICENSE for more information.

Support

Support me by buying me 1/10 of a gallon of AvGas, so I can practice my taxiing:

  • Stellar XLM: GBLOUZQPCQXVQAJAHSM2PUEWKHJT5M3TAQ63LKT6KQCQPNI2X5MZSL23

Or by suggesting features and pointing out any bugs.

Thank you!

Known Issues

  • When connecting to Heroku PostgresQL Datastore:
    • sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

Solution: Navigate to .env file and change your database URI from postgres:// --> postgresql://

About

API endpoint for pilots of all ratings and aircraft to backup and store their logbook data. This API can be run on any NAS that supports Docker (for local redundant logbook backups).

Topics

Resources

License

Stars

Watchers

Forks

Languages