Skip to content

Commit

Permalink
Initial library items (#1)
Browse files Browse the repository at this point in the history
Initial library code samples with simple shake detection service.

---------

Co-authored-by: Tomas Neubauer <tomas@quix.io>
Co-authored-by: Quix Git Service <@quix>
Task/fixed versions (#3)

* Update deployment QR Settings Share

* Update deployment Shake detection

---------

Co-authored-by: Tomas Neubauer <tomas@quix.io>
Update app.yaml
Update app.yaml
  • Loading branch information
tomas-quix committed Sep 7, 2023
1 parent 40e6e45 commit 26a36d0
Show file tree
Hide file tree
Showing 113 changed files with 46,950 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

Shake detection/venv/

.DS_Store
47 changes: 47 additions & 0 deletions FleetConsole/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
.angular/
54 changes: 54 additions & 0 deletions FleetConsole/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Event Detection Demo UI

[This project](https://github.com/quixio/quix-samples/tree/main/nodejs/advanced/event-detection-ui)
is the UI for our event detection demo.

Stream data from your phone or a data generator and view the telemetry in this UI in real-time. Deploy an event detection service and you can also see the events time and location.

## How to run

Create a [Quix](https://portal.platform.quix.ai/self-sign-up?xlink=github) account or log-in and visit the Samples to use this project.

Clicking `Deploy` on the Sample, deploys a pre-built container in Quix. Complete the environment variables to configure the container.

Clicking `Edit code` on the Sample, forks the project to your own Git repo so you can customize it before deploying.

## Local development

To run this project locally update the following values in `environment-variables.service.ts`:

```
private workingLocally = false; // set to true if working locally
public token: string = ''; // Create a token in the Tokens menu and paste it here
public topic: string = ''; // Create a topic in the Topic tab - for this demo use `demo-data`
public eventTopic: string = ''; // Create a topic in the Topic tab - for this demo use `events`
public workspaceId: string = ''; // Look in the URL for the Quix Portal your workspace ID is after `workspace=`
```

The Token can be obtained from the Quix portal under the `Token` menu (top right of the page under your user avatar)

Then install dependencies:

```
Run `npm install --force` to install all the dependencies
```

And finally, run the solution:

```
Run `ng serve` to build and run the . Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
```

## Docs

This UI makes use of the Streaming Reader API. Check out the [API docs](https://docs.quix.io/apis/streaming-reader-api/intro/) for detailed API usage guidance and how to connect to the WebSockets API using SignalR.

## Contribute

Submit forked projects to the Quix [GitHub](https://github.com/quixio/quix-samples) repo. Any new project that we accept will be attributed to you and you'll receive $200 in Quix credit.

## Open source

This project is open source under the Apache 2.0 license and available in our [GitHub](https://github.com/quixio/quix-samples) repo.

Please star us and mention us on social to show your appreciation.
132 changes: 132 additions & 0 deletions FleetConsole/angular.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"quix-template": {
"projectType": "application",
"schematics": {
"@schematics/angular:component": {
"style": "scss",
"skipTests": true
},
"@schematics/angular:class": {
"skipTests": true
},
"@schematics/angular:directive": {
"skipTests": true
},
"@schematics/angular:guard": {
"skipTests": true
},
"@schematics/angular:interceptor": {
"skipTests": true
},
"@schematics/angular:pipe": {
"skipTests": true
},
"@schematics/angular:resolver": {
"skipTests": true
},
"@schematics/angular:service": {
"skipTests": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/quix-template",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "4mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "quix-template:build:production"
},
"development": {
"browserTarget": "quix-template:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "quix-template:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": false
}
}
15 changes: 15 additions & 0 deletions FleetConsole/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: FleetConsole
language: nodejs
variables:
- name: topic
inputType: FreeText
description: The topic to read telementry data from
defaultValue: phone-data
required: true
- name: eventTopic
inputType: FreeText
description: The topic to read events from
defaultValue: events
required: true
dockerfile: src/build/dockerfile
defaultFile: src/app/services/environment-variables.service.ts
12 changes: 12 additions & 0 deletions FleetConsole/browserslist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
# npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
44 changes: 44 additions & 0 deletions FleetConsole/karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/quix-template'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
Loading

0 comments on commit 26a36d0

Please sign in to comment.