A node based fully configurable node based factory planer/calculator using a linear solver.
By default you configure runtime and build time in a single config.json by default the config.json is searched for in the projekt root.
You can manually override config.json location by setting CONFIG_JSON environment variable.
example config.json:
{
"server": {
"host": "localhost",
"port": 8000,
"frontendOrigins": [
"https://localhost:5173",
"https://127.0.0.1:5173"
],
"logRequests": false,
"ssl": {
"certFile": "../certs/localhost-cert.pem",
"keyFile": "../certs/localhost-key.pem"
}
},
"auth": {
"jwtAlgorithm": "HS256",
"jwtTtlSeconds": 604800,
"passwordHashIterations": 200000,
"defaultSessionVersion": 1,
"cookie": {
"name": "graphcalc_session",
"httpOnly": true,
"secure": true,
"sameSite": "lax",
"path": "/"
}
},
"mongo": {
"host": "localhost",
"port": 27017,
"authenticationMode": "none",
"username": "",
"password": "",
"authDatabase": "graphcalc",
"database": "graphcalc",
"allowNoAuthFallback": true,
"tls": {
"enabled": false,
"verifyServerCertificate": true,
"checkCertificateRevocation": true,
"clientCertificate": {
"pfxFile": "",
"pfxPassword": "",
"certFile": "",
"keyFile": ""
}
}
},
"solver": {
"maxConcurrency": 2,
"requestTimeoutSeconds": 5,
"queueLimit": 32
},
"caching": {
"sweepIntervalSeconds": 15,
"entryIdleTtlSeconds": 300,
"dirtyWriteBackSeconds": 30
},
"rateLimiting": {
"global": {
"authRequestsPerMinute": 120,
"solveRequestsPerMinute": 40,
"guestSolveRequestsPerMinute": 20,
"crudRequestsPerMinute": 2000
},
"perUserOrIp": {
"authRequestsPerMinute": 20,
"solveRequestsPerMinute": 8,
"guestSolveRequestsPerMinute": 4,
"crudRequestsPerMinute": 300
}
}
}Run backend with:
./run_backend.ps1Run frontent with:
./run.ps1First generate self signed certificates for dev, make sure to configure the relative or absoulute path in config.json
npm --prefix $PATH_TO_FRONTENT run devso from the project root:
npm --prefix ./frontend run devdotnet run --project $PATH_TO_BACKEND_API_PROJECTso from the project root:
dotnet run --project ./backend/GraphCalc.Api/GraphCalc.Api.csprojThe backend is written in c# using ASP.NET using a MongoDB database using Google OR-Tools linear solver for solving.
The Frontent is a React + React-Flow Vite app.