HTML and Javascript
{{jsContent}}
Site files were retrieved from other hosting peers or IPFS and validated before serving to the visitor
Site's Database
Site can have a database. Site owner will define sql-like ddls to create and upgrade database versions. Hosting
Peers will maintain replicas.
Database create initial configuration for this site:
Post message to the Backend
Send a Post to the Backend.
Entity ID: {{entity_id}}
Title:
Post Body:
{{isAuthenticated===null ? '⌛' : 'Site Login'}}
Logged In as:
{{getShortAddress(identity_visitor_id)}}
{{entity_id ? 'UPDATE' : 'POST'}}
Can post: {{ tfynu(can_post_to_table)}}
Reason: {{ posts_to_table_reason }}
{{postMessageResult}}
{{postMessageMarker}}
Searches
Search terms will be sent to hosting peers or used locally when hosting this site.
Returned data will be validated (logically and cryptographically), refiltered and returned here.
Here you can search in post's title or body
{{foundRecords.length}}
{{record._sn_entity_id}} |
{{record.title}} | {{record.body}}
Search
⌛
{{searchResultMessage}}
{{foundRecords.length}}
How to control allowed visitors
Site owner can appoint a site admin or issue a grant record for the specified visitor to grant edit
access to a table.
Later the Site Owner can mark a grant record as deleted.
Validity of access will be checked periodically during the maintenance. (Enforced by the Serveronet client)
Functional enpoints
Every Serveronet Site has following endpoints. See this site's script for usage examples or
API
Documentation
query_endpoint - Endpoint for user data queries. You can use a subset of sql DQLs to retrieve
the needed records.
visitor_record_create - Backend to create new record. Requires authenticated visitor.
visitor_record_update - Backend update a record. Requires authenticated visitor.
visitor_files - Listing of visitor files. Requires authenticated visitor.
visitor_file_upload - Upload Visitor's file.
visitor_file_delete - Enpoint to mark Visitor File as deleted.
check_can_post_to_table - Check if Visitor can post to a specified table.
check_can_upload - Check if Visitor can upload files.
login - Route to redirect visitor if authentication is required
logout - Logout from Site
is_authenticated - Enpoint to quickly check if current visitor is authenticated
get_visitor_state - Site can verify if current user can post and upload files
csrf-cookie - Enpoint to regerate CSRF cookie. Just request it.
site_state - Enpoint to quickly check Site details
client_config - Enpoint to check configuration of the Serveronet client
Queries
Database queries will be sent to hosting peers or executed locally.
Site hosting state : {{siteState?.is_hosted ? 'Hosting' : 'Not Hosting'}}
Last update timestamp: {{siteState?.visitor_records_replication_end_ts}}
Show filtered
records
Show Count
⌛
{{queryRecords.length}}
{{queryResultMessage}}
{{sql}}
{{value.key}} - {{value.queryParam}}
Records Found:
{{ formatDate(record._sn_entity_id) }}
{{ record.title }}
{{ record.body }}
Query parameters:
Prettify
Grant Records
Site Admin or Owner can create grant records.
Grant Records are attached to new records as a proof that Visitor can post to a specified table or upload
files.
Are you a Site admin : {{tfynu(is_site_admin)}}
{{isAuthenticated===null ? '⌛' :
'Site Login'}}
Grantee Visitor ID:
Create Grant Record
DB
Create Grant Record for
Uploades
Visitor Files
This Sample site allows visitors to upload their images.
Only allowed visitors will be able to upload.
Uploaded images will be replicated to the hosting Peers.
{{isAuthenticated===null ? '⌛' :
'Site Login'}}
Visitor can upload files:
{{tfynu(can_upload_files)}} {{visitorState?.upload_files_reason ? '('+ visitorState?.upload_files_reason +')'
: '' }}
Visitor has {{visitorFiles.length}}
files already uploaded. Total: {{totalUploadedFiles()}} KB
Current file size is {{Math.round(file_size / 1024)}} KB
2. Pick an Image:
X
3. Upload
{{file_upload_result}}
List Current Visitor's Files
All Visitor Files
{{visitorFiles.length}}
X
File Link
{{visitorFile.original_file_name}} {{visitorFile.entity_id}}
Visitor State
Site can check status of a Visitor.
Your Visitor Id:
{{
visitorState?.visitor_id}}
Short: {{ getShortAddress(visitorState?.visitor_id) }}
Is a Site admin: {{ tfynu(is_site_admin) }}
Can post new records: {{ tfynu(can_post_to_table) }}
Reason: {{ posts_to_table_reason }}
Can upload new files: {{ tfynu(can_upload_files) }}
Reason: {{ upload_files_reason }}
{{isAuthenticated===null ? '⌛' :
'Site Login'}}
Check
Now
Links
Links are relative to Visitor's Client.
The Site Owner can use helper cookies to generate links properly.
site_root - Carries full url to current Site root path.
Example: https://yoursiteaddress.sn-client.example.com/
This Client:
{{siteRoot}}
client_root - Carries full url to the root of this client.
Example: https://sn-client.example.com/
This Client:
{{clientRoot}}
site_id - carries a Site ID of a current Site. Even when site is accessed by a domain,
actual site
id is available.
Example: bgxi6...
This Client:
{{siteId}}
Server Events
You can consume stream of events that this Serveronet Client will broadcast for a site.
Events will show here and in a pop-up.
Events are available for 60 seconds after occuring.
Post a record and Server will notify connected visitors soon after.
Documentation
EventSource
⌛ Please wait...
(Dev) Sample Database
Populate local database with sample records
{{isAuthenticated===null ? '⌛' :
'Site Login'}}
Populate On
Parallel
Delay:
maximumPopulateCount:
Populate
Local DB
Populated
(Dev) Image performance section
Go up to Visitor files
All Visitor Files in grid
{{visitorFiles.length}}
Batch Upload using Visitor Files
picker