Compare commits

...

3 Commits

16 changed files with 2893 additions and 3 deletions

4
.gitignore vendored
View File

@ -130,3 +130,7 @@ dist
.yarn/install-state.gz .yarn/install-state.gz
.pnp.* .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) <year> <owner> 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: 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;
}

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

@ -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

@ -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>