database.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { database } from "../assets/database.js";
  2. const sample = {
  3. "project": {
  4. "name": "Sample test project",
  5. "description": "This is super simple test project."
  6. },
  7. "submissions": {
  8. "First": {
  9. "description": "This is first test submission.",
  10. "picture": "thumbnail_1.png",
  11. "elements": {
  12. "what": {
  13. "description": "This is element named 'What'.",
  14. "pictures": [
  15. "what_1.png",
  16. "what_2.png",
  17. "what_3.png"
  18. ],
  19. "meshes": [
  20. "mesh_a.stl",
  21. "mesh_b.stl"
  22. ],
  23. "solids": [
  24. "solid_a.step",
  25. "solid_b.step"
  26. ],
  27. "order": [
  28. "https://allegro.pl/show/item_a",
  29. "https://e-bay.com/x/y"
  30. ]
  31. },
  32. "is": {},
  33. "it": {}
  34. }
  35. },
  36. "Second": {
  37. "description": "This is second test submission.",
  38. "picture": "thumbnail_2.png",
  39. "elements": {
  40. "mini": {},
  41. "maxi": {}
  42. }
  43. }
  44. }
  45. };
  46. console.log("Loading database...");
  47. try {
  48. const test_db = new database(sample);
  49. } catch (exception) {
  50. console.error(exception);
  51. }
  52. console.log("Database loaded.");