No description
- Svelte 74.5%
- TypeScript 19.8%
- JavaScript 3%
- CSS 1.7%
- HTML 1%
| .forgejo/workflows | ||
| src | ||
| static | ||
| .gitignore | ||
| .npmrc | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| svelte.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
Cortina Svelte Base Template
This is intended as a simple starting point for a svelte based interactive.
The main features of this template are:
- Setup for route based navigation
- Defaults to using Svelte Animations
- Includes a Timeout screen that can then be styled/modified
- Automatically will pull data from either a CMS or from locally cached content
- Built in build for deploying directly to either Application Manager or the extranet
Usage
Use the "Use this template" Button above to create a new repository based on this template.
Build Pipelines
To enable build pipelines in the new repository under settings -> actions -> variables define the following variables:
- AZURE_DESTINATION this will be the location on the cortinabuilds bucket that this app will deploying
- SOURCE this will be the output location of npm run build
- Rename .forgejo/workflows/main.yml.bak to main.yml
Analytics
Capture analytics data in the application and send it as a JSON to a given destination.
new Analytics(endpoint: string, appId: string, appInstId: string, username: string, password: string)- Declare a new instance of Analytics and configure where data events get sent using a given POST endpointtrackNewSession(isSessionADA: boolean): () => void- Generates a UUID as it starts a new session using the internal SessionTracker class. This should be called once the user begins a session by interacting with the attractsubmitAnalytics(hierarchy: string, eventName: string, screenName: string, parameters: object | null): () => void- Send captured analytics data to its POST endpoint Parameters- Parameters are optional and defaulted to null. It is an object that would contain any additional information needing to be captured.
In order to use these analytics utilities, first create a store for the anayltics data. Example:
import { analyticsStore } from "$lib/stores/analyticsstore";
import Analytics from "$lib/utils/Analytics";
$analyticsStore = new Analytics("Application_Endpoint", "My_App_Analytics", "My_App_Instance_Id", "MyUsername", "MyPassword");
$analyticsStore.trackNewSession(false);
const onExampleEvent = (param) => {
$analyticsStore.submitAnalytics("", "event_name", "screen_name", null);
}