photoprism / photoprism

AI-Powered Photos App for the Decentralized Web 🌈💎✨
https://www.photoprism.app
Other
35.38k stars 1.97k forks source link

Native smartphone apps #12

Closed lastzero closed 4 years ago

lastzero commented 6 years ago

For Android and iOS. Interface should be similar to the Web UI (Material Design).

Main reason why this is important: Automatic upload / sync of photos stored on the devices, especially if PhotoPrism is hosted at home (devices need to be in the same Wifi network).

Maybe use NativeScript? https://www.nativescript.org/

danieldaeschle commented 6 years ago

Maybe use flutter :) Easy Material Design built in!

lastzero commented 6 years ago

Flutter is on the watchlist. Actually tried to build an app with https://godoc.org/golang.org/x/mobile & flutter, but didn't work due to compile / run errors.

Would be amazing if somebody with experience in mobile app development could help us!

danieldaeschle commented 6 years ago

I've never saw that golang has the ability to create mobile apps 😁

You easly can use flutter without go...

lastzero commented 6 years ago

It was an experiment. The whole project is an experiment. Not satisfied with the status quo.

Kerumen commented 6 years ago

@lastzero To be honest, this seems a bit huge for a "good first issue" 😄

lastzero commented 6 years ago

It's actually a first idea ;) It's good because there is nothing yet, a green field to play on.

Kerumen commented 6 years ago

Agree with you on that part. However, you have to know very well the API imo.

lastzero commented 6 years ago

If you already know how to build it, yes. I don't have an idea yet what technology to use. It should be simple and good to maintain. Not like 10 wrapped containers with hipster tech. Working with Web technologies might be great because of code reuse, but then it's probably hipster tech. Open to suggestions.

Stmol commented 6 years ago

Ok, looks like you've got three options:

1) ReactNative cross-platform, it uses JS under the hood, and built on top of components paradigm (same like Vue). Unlike Flutter, RN has a huge library of existing components for every taste.

2) Flutter cross-platform, it uses own unpopular language Dart by Google, and also, in a nutshell, for building apps it has components similar to React (it's calling Widgets). Young framework but rapidly gaining popularity, and much inferior in the number of existing production-ready widgets.

3) Native language and platform specific SDK. Swift for iOS and Kotlin for Android. Because simple and good to maintain is not about Objective-c and Java.

Also, you have tons of options like NativeScript or Vue Native. But trust me, I had experience with React Native and every time you want to do something more complex than "Hello World" tutorial you get a lot of troubles. So using all this SOMETHING-NATIVE promises big trouble in deep dive.

Conclusion. If you want to be a hipster and you believe in the idea of code reuse, take ReactNative. It has a good community and you can expect a ton of pull requests.

If you want to fun and learning something new take Flutter. This will be a great challenge. BTW, Dart is quite simple and I liked it as an alternative for JS and TS.

But if you are good guys and have a lot of free time at your disposal, use Swift and Kotlin. This will be the best solution for any project that harder than "Hello World" tutorial. Swift and Kotlin are modern languages that are rapidly developing and allow you to do anything with extraordinary ease.

Anyway, I am glad to help you with any of this three cases :relieved:

danieldaeschle commented 6 years ago

I'm also could help with thesre three. But react native i never used really :D

lastzero commented 6 years ago

What about uploading in the background and accessing photo meta data? Is that possible with reactnative or flutter?

danieldaeschle commented 6 years ago

You still have to write native services in this case. Flutter and React Native are only for views.

lastzero commented 6 years ago

I thought maybe this is so common that there are ready to use APIs / components for this. Sounds like a native approach is unavoidable anyways, best we can do is mix native code with JS? Not sure if that makes it simpler to maintain...

danieldaeschle commented 6 years ago

In addition, the native google libraries have better design libraries uncluded or provided from google. React Native doesn't really have a good Material Design library. Only flutter has a good design library which works really good.

Flutter has the advantage to provide good design and transition on any smartphone. If you want to do the same with native you maybe get confronted with devices which crashes on special configurations... This can be vers annoying.

lastzero commented 6 years ago

@danieldaeschle When doing the UI with Flutter, the Dart code can be reused for an iOS app, the UI would look almost the same on both platforms and only platform specific code needs to be written in Swift or Kotlin - did I get this right?

danieldaeschle commented 6 years ago

Yes, exactly

lastzero commented 6 years ago

Sounds like a plan. Does it make sense to create a photoprism-mobile repo for that, containing shared Dart/Flutter code in one directory and platform-specific code for iOS and Android in two other directories?

danieldaeschle commented 6 years ago

A flutter project already provides this structure.

lastzero commented 6 years ago

See https://hackernoon.com/scalable-app-structure-in-flutter-dad61a4bc389

Stmol commented 6 years ago

Sounds like a plan. Does it make sense to create a photoprism-mobile repo for that, containing shared Dart/Flutter code in one directory and platform-specific code for iOS and Android in two other directories?

It doesn't. First things first, you should google about features like accessing photo meta data, parallel background uploading (multiple objects), is it easy or not to work with photo editing, list component perfomance with a huge count of image objects and etc.

The trivial details like UI kit or project architecture are minor points. Any of the technology we discussed in this topic do it well.

lastzero commented 6 years ago

Ideally somebody with experience can help us here... I probably won't have time to seriously experiment with those technologies in depth before next year. At best I can do a simple feasibility study.

danieldaeschle commented 6 years ago

With flutter you can very easly do a lazy loading view. Editing photos should be possible with Dart. Parallel uplaoding should be made with kotlin/swift

santoshgistto commented 6 years ago

@lastzero i am not able to find rest api doc, is there any ?

lastzero commented 6 years ago

@santoshgistto As a first step, I just added a page to our Wiki and added routes & parameters to the inline docs:

https://godoc.org/github.com/photoprism/photoprism/internal/api

It was actually a bit annoying since my code is outside the GOPATH and the godoc server doesn't seem to work with that yet, so I had to push the changes to test them...

santoshgistto commented 6 years ago

Thanks @lastzero for reply. i tested the api

http://localhost:2342/api/v1/photos?count=1
The response missing thumbnail url
[{"ID":19,"CreatedAt":"2018-11-06T07:31:22Z","UpdatedAt":"2018-11-06T07:31:22Z","DeletedAt":"0001-01-01T00:00:00Z","TakenAt":"2018-08-11T10:51:32Z","PhotoTitle":"Handkerchief / 2018","PhotoDescription":"","PhotoArtist":"","PhotoKeywords":"","PhotoColors":"chocolate, coral, darkorange, gray, grey, lightslategray, lightslategrey, orangered, slategray, slategrey, tomato","PhotoVibrantColor":"#f76f1f","PhotoMutedColor":"#925b97","PhotoCanonicalName":"20180811_105132_2FFDA64D425B","PhotoLat":0,"PhotoLong":0,"PhotoFavorite":false,"CameraID":2,"CameraModel":"Unknown","CameraMake":"","LensID":3,"LensModel":"Unknown","LensMake":"","CountryID":"","CountryName":"","LocationID":0,"LocDisplayName":"","LocName":"","LocCity":"","LocPostcode":"","LocCounty":"","LocState":"","LocCountry":"","LocCountryCode":"","LocCategory":"","LocType":"","FileID":19,"FilePrimary":true,"FileMissing":false,"FileName":"2018/08/20180811_105132_2FFDA64D425B.jpg","FileHash":"2ffda64d425b0f9ca49318bc0b951d1a7c081266","FilePerceptualHash":"adb5","FileType":"jpg","FileMime":"image/jpeg","FileWidth":564,"FileHeight":414,"FileOrientation":1,"FileAspectRatio":1.36,"Tags":"handkerchief"}]

Are we need request separately for thumbnails ?

http://localhost:2342/api/v1/thumbnails/square/500/df54169be1f0c93805dccc82b753153c30d1c1c0
lastzero commented 6 years ago

Thumbnails are created dynamically depending on the parameters like size and format, there is not a single constant URL. We could add a default / example thumbnail URL to the search result if this helps?

santoshgistto commented 6 years ago

Thanks @lastzero it helped. i don't see more api like getting albums and tags details etc. i believe still in under development.

lastzero commented 6 years ago

Yes, currently busy with documenting etc - adding new features / apis when that is done

santoshgistto commented 6 years ago

ok cool, currently i am also looking into flutter. i will try to build the POC App using existing api.

Thanks,

lastzero commented 6 years ago

@santoshgistto You are welcome to add yourself to our contributors list:

https://github.com/photoprism/photoprism/wiki/Contributors

lastzero commented 6 years ago

@santoshgistto Put all relevant information including links to example apps here: https://github.com/photoprism/photoprism/wiki/Mobile-Apps

jantznick commented 4 years ago

I've used react-native some and think it would be good for views, additionally it seems easy to hook it into native app code. Really it all depends what the main goal is? For instance, just creating something that can display photos would be a great first step and enough to get people interested in using photoprism, then down the road more features could be added(uploading and whatever else you want)

lastzero commented 4 years ago

Work in progress, see https://github.com/photoprism/photoprism-mobile

I'll close this here.