Database Architecture - CappyStone/ProjectCapybara GitHub Wiki

Updated NoSQL schema (Oct 6 2022)

overall schema

company container schema

company equipment schema

Schema

  • Company(companyID, companyName, companyAddress, contactEmail, employees, ownedEquipment)
  • Equipment(equipmentID, year, price, productName, vehicleClass, manufacturer, cityFuelConsumption, hwyFuelConsumption, combFuelConsumption, cO2Emissions, cO2Rating, smogRating, fuelType)

Important Notes

  • Changed schema as project scope changed, now focusing on cars.
  • For gasoline cars cityFuelConsumption, hwyFuelConsumption, and combFuelConsumption are litres / 100km. For electric it is kWh / 100km which can be coverted to gas by dividing by 8.9 (1 litre of gas = 8.9 kWh). cO2Emissions is g/km. cO2Rating and smogRating are rated 1 - 10 with 1 being worst and 10 being best.

NoSQL schema (Feb 7 2022)

overall schema

company container schema

company equipment schema

Schema

  • Company(companyID, companyName, companyAddress, companyContactEmail, employees, ownedEquipment)
  • Equipment(equipmentID, category, tags, productName, description, manufacturer, serialNumber, greenScore, efficiencyRating, estimatedPrice)

Initial SQL Schema

https://docs.google.com/document/d/1fs43z7q0_RBTMRBALLB0Bc3U_kpZIFipnn_bSUl1tbI/edit

https://www.energystar.gov/products/spec?s=mega

Diagram : https://app.diagrams.net/#G1GRqQt-n3dLDzsRZz2b3x9jb_uv5vMWPw

Schema

  • User(UserID, Name, isAdmin, CompanyID)
  • Company(CompanyID, Name, Address, EquipmentID, VehicleID, ComponentID)
  • EmployedBy(UserID, CompanyID)
  • Tools(ToolID, Type, Name, kWh/y, accepted)
  • Vehicles(VehicleID, Type, Name, gas/powerUsage, accepted)
  • Renovations(RenovationID, Type, Name, Efficiency, accepted)
  • ToolsOwnedBy(UserID, CompanyID, amount)
  • VehiclesOwnedBy(UserID, CompanyID, amount)
  • RenovationsOwnedBy(UserID, CompanyID, amount)

Meeting Notes

February 7th

  • Redesigned database schema.

  • Redesign schema diagram.

  • Next Steps

  • Implement database on CosmosDB.

January 29th

  • Decided on Cosmos DB for the database

  • Created containers to structure database

  • Created items using JSON commands

  • Next Steps

  • Wiki with guidelines and formatting for JSON
  • Connecting to Firebase server (with Justin and Max’s help)