ephoto

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2022 License: AGPL-3.0

README

Licence CLI Version live version dev version

DPhoto

Backup photo to your private AWS Cloud, and share them with family and friends. Core features:

Feature Version Description
Backup medias v1.0 Backup photos and videos from USB Sticks, Flash drives, and Camera (USB) when they're plugged
Organise by album v1.0 Photos and videos are organised by album based on their creation date. Each album is a directory in S3.
Migration script v1.0 Medias already uploaded in S3 are re-ordered by albums and de-duplicated (with interactive command line interface)
Web viewer v1.5 See photos by albums, tag them, search by tag or dates
Faster UI - Pre-generate miniatures, supports browser caching (miniature + medium quality) and backend cache medium-quality images.
API Driven - Provide enhanced API to tip the business on the backend side: CLI authenticated by Google Token (vs AWS Credentials)
Android App - Minimalist app to synchronise local medias to DPhoto.
Media sharing - Albums can be shared and contributed by several users.
Tagging - Adding tags to medias to find them later, share them, or print them
Google Photo - Support Google Photo to push images and video, or import from Google Photo.

Getting Started

Install 'dphoto' command line interface and configure it using the following:

go install github.com/thomasduchatelle/dphoto/dphoto@latest
dphoto configure

Then use command backup to upload media in a directory, or scan to interactively organise the albums.

dphoto scan /x/y/z
dphoto backup /x/y/z

Contribute

Components:

  • infra-data: terraform project to create required infrastructure on AWS for the CLI to work. Project won't be re-usable in a different context without overriding backend and some other defaults.
  • domain: core domain model and business logic from Hexagonal Architecture. This domain is integrated and used from both CLI and app's APIs
  • DPhoto CLI: installed on the end-user computer, backup photos and videos using command line interface
  • APP: deployed on top of infra-data, contains the viewer UI, and APIs for the UI and the CLI
Install development environment

Required tools:

  • Infra:
    • terraform: brew install tfenv, Makefile
    • Serverless Framework: npm install -g serverless
    • AWS CLI: brew install awscli
  • Languages & build tools:
    • make
    • GoLang: brew install golang
    • Yarn: brew install yarn
  • Docker and Docker Compose

Setup the environment:

make install all

# Run tests & build (all sub-projects)
make
Releasing process

Bootstrap an environment with built-in command (one-of pre-requisite):

go run ./tools/infra-bootstrap -domain <domain> -email <email> -env dev -google-client-id <id>

To release a new version:

  1. make changes on a feature branch and bump the CLI version:

    ./ci/pre-release.sh 1.5.0
    
  2. create a pull request to develop, review the terraform plan and tests then merge -> it will deploy to https://dphoto-dev.duchatelle.net

  3. create a pull request develop -> main, review the terraform plan then merge -> it will deploy to https://dphoto.duchatelle.net and create a tag for the CLI

  4. (optional) update local versions of dphoto by running

    go install github.com/thomasduchatelle/dphoto/dphoto@latest
    
  5. to avoid confusion, next development iteration can be started by running ./ci/pre-release.sh 1.6.0-alpha.

Tech debt
  1. go cli is using AWS SDK 1.x and should use 2.x
  2. go install github... doesn't work anymore: go modules are not properly defined.

Directories

Path Synopsis
api
lambdas Module
cmd
fphoto/config
Package config create AWS session and distribute it (alongside other config value) to any package interested.
Package config create AWS session and distribute it (alongside other config value) to any package interested.
fphoto/printer
Package printer display in standard output simple info/success/error messages
Package printer display in standard output simple info/success/error messages
fphoto/screen
Package screen provides building blocks to represent progress bars.
Package screen provides building blocks to represent progress bars.
pkg
acl/aclcore
Package aclcore manage what an API consumer is granted to do, and issue access tokens to represent it.
Package aclcore manage what an API consumer is granted to do, and issue access tokens to represent it.
acl/catalogacl
Package catalogacl contains the logic to authorise access to catalog resources based on user requesting it.
Package catalogacl contains the logic to authorise access to catalog resources based on user requesting it.
acl/catalogaclview
Package catalogaclview is a layer on top of catalog (same business model) which apply ACL rules before performing any action
Package catalogaclview is a layer on top of catalog (same business model) which apply ACL rules before performing any action
archiveadapters/archivedynamo
Package archivedynamo extends catalogdynamo to add media locations to the main table
Package archivedynamo extends catalogdynamo to add media locations to the main table
archiveadapters/s3store
Package s3store implements archive.StoreAdapter with AWS S3 backend
Package s3store implements archive.StoreAdapter with AWS S3 backend
backup
Package backup is providing commands to inspect a file system (hard-drive, USB, Android, S3) and backup medias to a remote DPhoto storage.
Package backup is providing commands to inspect a file system (hard-drive, USB, Android, S3) and backup medias to a remote DPhoto storage.
backupadapters/analysers/exif
Package exif parse image files to extract key details.
Package exif parse image files to extract key details.
backupadapters/analysers/m2ts
Package m2ts is parsing M2TS files followings specs: https://en.wikipedia.org/wiki/MPEG_transport_stream https://en.wikipedia.org/wiki/Packetized_elementary_stream https://en.wikipedia.org/wiki/Program-specific_information
Package m2ts is parsing M2TS files followings specs: https://en.wikipedia.org/wiki/MPEG_transport_stream https://en.wikipedia.org/wiki/Packetized_elementary_stream https://en.wikipedia.org/wiki/Program-specific_information
backupadapters/analysers/mp4
Package mp4 parse a MP4 file to retrieve creation date, length, and other details found in the stream.
Package mp4 parse a MP4 file to retrieve creation date, length, and other details found in the stream.
backupadapters/filesystemvolume
Package filesystemvolume scan a local filesystem to find medias in it
Package filesystemvolume scan a local filesystem to find medias in it
catalog
Package catalog provides tools to maintain an index of all medias that have been backed up.
Package catalog provides tools to maintain an index of all medias that have been backed up.
catalogadapters/catalogarchivesync
Package catalogarchivesync is calling archive domain directly
Package catalogarchivesync is calling archive domain directly
catalogadapters/catalogdynamo
Package catalogdynamo package store all the data in a single multi-tenant table:
Package catalogdynamo package store all the data in a single multi-tenant table:
dns
Package dns expose functions to renew SSL certificates on AWS
Package dns expose functions to renew SSL certificates on AWS
meta
Package meta expose information about the application like the version.
Package meta expose information about the application like the version.
tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL