Compare commits

..

3 Commits

24 changed files with 3019 additions and 145 deletions

150
.gitignore vendored
View File

@ -1,26 +1,136 @@
# ---> Go
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# ---> Node
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Test binary, built with `go test -c`
*.test
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Dependency directories (remove the comment below to include it)
vendor/
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Go workspace file
go.work
# Coverage directory used by tools like istanbul
coverage
*.lcov
# Compiled binary
blt
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# Compiled CSS and JS files
public/css/
public/js/

61
Gruntfile.js Normal file
View File

@ -0,0 +1,61 @@
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
style: 'compressed'
},
files: [{
expand: true,
cwd: 'assets/styles',
src: ['**/*.scss'],
dest: 'public/css',
ext: '.css'
}]
}
},
uglify: {
options: {
mangle: false
},
compile: {
files: {
'public/js/bedabin.min.js': ['assets/js/**/*.js']
}
}
},
watch: {
css: {
files: ['assets/styles/**/*.scss'],
tasks: ['sass'],
options: {
atBegin: true,
spawn: false
}
},
js: {
files: ['assets/js/**/*.js'],
tasks: ['uglify'],
options: {
atBegin: true,
spawn: false
}
}
}
});
// Load plugins.
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
// CLI tasks.
grunt.registerTask('default', ['sass', 'uglify']);
};

View File

@ -1,4 +1,4 @@
Copyright (c) 2023 Bit Goblin
Copyright (c) 2023 Bit Goblin
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@ -1,3 +1,30 @@
# blt
# Benchmark Logging Tool
Benchmark logging tool
BLT is a web UI for recording and managing PC hardware benchmarking results comparisons.
## Project Goals
The goals of this project are to:
* Record benchmarking results from multiple devices - e.g. log from a laptop or a phone.
* Group results into tests - it's good practice to run a benchmark multiple times for accuracy.
* Create comparisons of hardware tests to compare performance.
* Generate graphs of hardware comparisons for usage in videos and articles.
## Development
To run the BLT server in development mode with automatic reloading, you first need to install dependencies:
`npm install`
Then you need to run nodemon:
`npm run nodemon`
And that's it! You just need to visit http://localhost:3000 in a browser and you're good to go!
For reference, nodemon watches files in the following directories:
* `src/`
* `views/`
* `index.js`

3
assets/js/bedabin.js Normal file
View File

@ -0,0 +1,3 @@
$(document).ready(function() {
console.log("ready");
});

65
assets/styles/nardah.scss Normal file
View File

@ -0,0 +1,65 @@
$primary-color: navy;
$primary-color-highlight: lighten($primary-color, 10%);
$nav-height: 65px;
body{
margin: 0;
padding: $nav-height 0 0;
background: white;
}
a{
color: $primary-color;
transition: all 230ms ease-in-out;
&:hover{
color: $primary-color-highlight;
}
}
#main-nav{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: $nav-height;
background: $primary-color;
color: #eee;
font-size: 2rem;
ul{
list-style: none;
li{
display: inline-block;
}
}
.nav-left{
float: left;
}
.nav-right{
float: right;
}
a{
display: inline-block;
padding: 15px 10px;
color: #eee;
text-decoration: none;
&:hover{
color: white;
}
}
.site-logo{
margin-left: 25px;
margin-right: 25px;
font-weight: bold;
}
}
#main-wrapper{
max-width: 1180px;
margin-top: 15px;
padding: 15px 20px;
}

24
blt.go
View File

@ -1,24 +0,0 @@
package main
import (
"github.com/flamego/flamego"
"github.com/flamego/template"
web "git.metaunix.net/bitgoblin/blt/src/web"
)
func main() {
// initialize Flamego instance
f := flamego.Classic()
// enable templates
f.Use(template.Templater(template.Options{
Directory: "./views",
}))
// register routes
web.RegisterRoutes(f)
// start Flamego
f.Run()
}

21
go.mod
View File

@ -1,21 +0,0 @@
module git.metaunix.net/bitgoblin/blt
go 1.18
require (
github.com/alecthomas/participle/v2 v2.0.0 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/charmbracelet/log v0.2.3 // indirect
github.com/flamego/flamego v1.9.4 // indirect
github.com/flamego/template v1.2.2 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
golang.org/x/sys v0.7.0 // indirect
)

33
go.sum
View File

@ -1,33 +0,0 @@
github.com/alecthomas/participle/v2 v2.0.0 h1:Fgrq+MbuSsJwIkw3fEj9h75vDP0Er5JzepJ0/HNHv0g=
github.com/alecthomas/participle/v2 v2.0.0/go.mod h1:rAKZdJldHu8084ojcWevWAL8KmEU+AT+Olodb+WoN2Y=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E=
github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c=
github.com/charmbracelet/log v0.2.3 h1:YVmBhJtpGL7nW/nlf5u+SEloU8XYljxozGzZpgwIvhs=
github.com/charmbracelet/log v0.2.3/go.mod h1:ZApwwzDbbETVTIRTk7724yQRJAXIktt98yGVMMaa3y8=
github.com/flamego/flamego v1.9.4 h1:SNsooIfNa6ljQM1rBmfg4cFcXPIhQdG/uvNHqXxPvD8=
github.com/flamego/flamego v1.9.4/go.mod h1:2tAVbugA3fgX8xOBoqR2jmJSSvZDLBFGXTFCR5h5eAU=
github.com/flamego/template v1.2.2 h1:aMpt8RzXBb2ZGuABf9p/q8oBBpXrurUV8rgBbz7mj2o=
github.com/flamego/template v1.2.2/go.mod h1:xTAmwCCPaOuxN5t4CpzOP7WZN5WkLRiJfJCpsiB0aUg=
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

22
index.js Normal file
View File

@ -0,0 +1,22 @@
const express = require('express');
const Twig = require("twig");
const app = express();
const port = 3000;
// serve static files
app.use(express.static('public'));
// configure Twig templating
app.set("twig options", {
allowAsync: true, // Allow asynchronous compiling
strict_variables: false
});
// register routes
const routes = require('./src/routes');
routes.registerRoutes(app);
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});

12
nodemon.json Normal file
View File

@ -0,0 +1,12 @@
{
"verbose": true,
"watch": [
"src/",
"views/",
"./index.js"
],
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,twig"
}

2610
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
package.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "benchmark-logging-tool",
"version": "0.1.0",
"description": "Bit Goblin PC hardware benchmarking logging tool",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"nodemon": "nodemon",
"grunt": "grunt"
},
"repository": {
"type": "git",
"url": "https://git.metaunix.net/BitGoblin/blt"
},
"keywords": [
"hardware",
"benchmarking",
"gaming"
],
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
"license": "BSD-2-Clause",
"dependencies": {
"express": "^4.18.2",
"twig": "^1.16.0"
},
"devDependencies": {
"grunt": "^1.6.1",
"grunt-contrib-sass": "^2.0.0",
"grunt-contrib-uglify": "^5.2.2",
"grunt-contrib-watch": "^1.1.0",
"nodemon": "^3.0.1",
"sass": "^1.68.0"
}
}

0
public/.gitkeep Normal file
View File

View File

@ -0,0 +1,7 @@
const getIndex = (req, res) => {
res.render('index/dashboard.twig');
};
module.exports = {
getIndex
};

7
src/routes.js Normal file
View File

@ -0,0 +1,7 @@
// load controllers
const indexController = require('./controllers/indexController');
// index routes
exports.registerRoutes = (app) => {
app.get('/', indexController.getIndex);
};

View File

@ -1,12 +0,0 @@
package web
import (
"github.com/flamego/flamego"
"git.metaunix.net/bitgoblin/blt/src/web/routes"
)
func RegisterRoutes(f *flamego.Flame) {
// top-level routes
f.Get("/", routes.GetTopIndex)
}

View File

@ -1,12 +0,0 @@
package routes
import (
"net/http"
"github.com/flamego/template"
)
func GetTopIndex(t template.Template, data template.Data) {
data["title"] = "Dashboard"
t.HTML(http.StatusOK, "index")
}

View File

@ -1,5 +0,0 @@
{{ template "header" . }}
<p>This is a test!</p>
{{ template "footer" . }}

View File

@ -0,0 +1,9 @@
{% extends 'layout/default.twig' %}
{% block title %}Dashboard{% endblock %}
{% block content %}
<p>This is a test.</p>
{% endblock %}

19
views/layout/default.twig Normal file
View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{% endblock %} | BLT</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
<link rel="stylesheet" href="/css/nardah.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="/js/bedabin.js"></script>
</head>
<body>
{% include 'partials/navbar.twig' %}
<div class="container">
{% block content %}{% endblock %}
</div>
</body>
</html>

View File

@ -1,4 +0,0 @@
{{ define "footer" }}
</body>
</html>
{{ end }}

View File

@ -1,11 +0,0 @@
{{ define "header" }}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{ .title }} | BLT</title>
</head>
<body>
{{ end }}

View File

@ -0,0 +1,10 @@
<nav id="main-nav">
<ul class="nav-left">
<li class="site-logo">BLT</li>
<li><a href="/">Dashboard</a></li>
<li><a href="/test">Test</a></li>
<li><a href="/result">Results</a></li>
</ul>
</nav>