Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whether the atomic_server ( with browser UI) can deploy independent ? I meaning offline or isolate #604

Closed
iRobinZ opened this issue Mar 2, 2023 · 11 comments · Fixed by #608

Comments

@iRobinZ
Copy link

iRobinZ commented Mar 2, 2023

looks the Rect js code contains many hard code that point to "http://atomicdata.dev" , especial in Datatype,

so it is necessary for running the atomic_server ?

@joepio
Copy link
Member

joepio commented Mar 2, 2023

Yes, it should be able to run without an internet connection. The server's binary file actually contains the atomicdata.dev ontology, which includes all properties / classes used by default.

@iRobinZ
Copy link
Author

iRobinZ commented Mar 2, 2023

the file 'datatypes.ts' in the data-browser project , it was defined like :

export enum Datatype { /** A Resource - either a URL string or a Nested Resource */ ATOMIC_URL = 'https://atomicdata.dev/datatypes/atomicURL', /** True / false */ BOOLEAN = 'https://atomicdata.dev/datatypes/boolean', /** ISO date YYYY-MM-DD */ DATE = 'https://atomicdata.dev/datatypes/date', /** Floating point number (number with comma) */ FLOAT = 'https://atomicdata.dev/datatypes/float', INTEGER = 'https://atomicdata.dev/datatypes/integer', /** UTF-8 Markdown string */ MARKDOWN = 'https://atomicdata.dev/datatypes/markdown', /** Array of Resources and */ RESOURCEARRAY = 'https://atomicdata.dev/datatypes/resourceArray', /** String with only letters, numbers and dashes in between */ SLUG = 'https://atomicdata.dev/datatypes/slug', STRING = 'https://atomicdata.dev/datatypes/string', /** Milliseconds since unix epoch */ TIMESTAMP = 'https://atomicdata.dev/datatypes/timestamp', UNKNOWN = 'unknown-datatype', }

if so it have to connect dev site as root host ? sorry for this question, just confuse this logic .

@joepio
Copy link
Member

joepio commented Mar 2, 2023

I don't think these are fetched typically - even though they are retrievable URLs. In many cases, these URLs are just used as names.

However, if you edit a resource, some Property definitions are loaded, so there is some dependency to AtomicData.dev there. When Atomic Data Browser starts, it sends a request to https://atomicdata.dev/properties/, because it makes the app feel faster if you want to edit resources that use these properties.

@iRobinZ
Copy link
Author

iRobinZ commented Mar 3, 2023

if network broken, some data brow page of the atomic_server can not render properly ...

@joepio
Copy link
Member

joepio commented Mar 3, 2023

Most seems to work, but edit forms only show error. I could work around this a little by adjusting the views.

Screenshot 2023-03-03 at 10 29 28

Also, I could probably change the atomicdata.dev/properties call to something that's included on the server. I'll have to think a bit more about that.

In the mean time, could you provide some more information about your usecase and a screenshot of what's wrong @iRobinZhang ? Thanks !

@iRobinZ
Copy link
Author

iRobinZ commented Mar 3, 2023

I just run the data-browers project from console, then start the rust server , then open chrome web browser , navigate to 'http://localhost:5173/',

I try to create a 'Article' but the Article edit page not render as normal, of course it works online but network broken, I meaning if internet disconnected then the edit Article page not works as expected

@joepio
Copy link
Member

joepio commented Mar 3, 2023

I can do this, which adds property labels to errored properties:

Screenshot 2023-03-03 at 11 06 29

And store all core properties on a specific endpoint / include them in the browser build step. Also possible.

@iRobinZ
Copy link
Author

iRobinZ commented Mar 3, 2023

image
image

it looks strange or maybe I have not explain my question clearly ...

@joepio
Copy link
Member

joepio commented Mar 3, 2023

I understant, to fix this we have two options: Include the atomicdata.dev ontology in the front-end, or the back-end.

I think including it in the back-end is a lit less error-prone, as that is the system that contains the default_store.json file. But that misses a few key properties (see populate_base_models), so it is incomplete and should not be used as-is.

  • We could generate a store_generated.json during build.rs that we put in the assets dir, which will be included in the server binary, which in turn can be requested by the front-end.
  • We could add an endpoint for /base-store or something that just returns all atomicdata.dev classes and properties. Perhaps this can simply be a Collection.
  • We could let the front-end use the local /collections/properties instead of the one at atomicdata.dev, and let that also include external properties. This seems by far the simplest!

@iRobinZ
Copy link
Author

iRobinZ commented Mar 3, 2023

that would be great 👍

@joepio
Copy link
Member

joepio commented Mar 3, 2023

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants