Great work so far team! For your next tickets you'll be doing some code refactoring and implementing the MongoDB
[x] REFACTOR: You'll be revisiting your old ticket, but not to dev. You'll be refactoring your code.
I noticed a lot of "helper functions" and "interfaces" were in the about.tsx page. They look solid I now want you guys to create a special file called helpers.ts and interfaces.ts so we can keep about.tsx as clean as possible. I know we're using about.tsx as a "tester" page but ideally we'd still want to abstract these functions even more and put them in their own file so we simply "plug and play" when necessary. Include these files in a utils folder.
All of SidePanel logic in about.tsx should go in the SidePanel.tsx file. We want to keep that "about" tester page as clean as possible and to have everything modularized.
When implementing Button, SearchBar and other atomic elements included in the SidePanel, use the components that you made earlier instead of the MUI base components. We'll do this so we can customize our elements to adapt to a smaller screen.
[x] DEV / RESEARCH: Create schema, controllers and routes for our MongoDB creation. I have included the schema creation from our partner meeting under Schema section in the System Design Doc (H4I Notion Page). I gave an example schema creation in backend/src/models/Hexagon.ts, so I would say start with the Hexagon class. You are going to now create bring these schema to life! If you want to know more about a MongoDB database creation I've gone through how I created the DB under Setting Up the MongoDB Creation in the onboarding files in Notion. For now you will test the code you made manually using Postman. Create:
POST: /api/hexagons
GET: /api/hexagons
POST: /api/province
GET: /api/province
POST: /api/soum
GET: /api/soum
NOTE: We were supposed to have our MongoDB meeting last Friday, but it got pushed back so the schema isn't fully finalized. Nevertheless, I want you to get exposure with creating schemas, controllers and routes. I will give you example data to POST and GET in the Notion file under Setting Up the MongoDB Creation. Use PostMan to test your routes. I'm thinking of setting up automatic Jest tests in the future but not top priority right now.
For the research aspect, there's many ways to store the type of GeoJSON data we're working with, so I would you like guys to do some research and optimize the way you store the GeoJson Data in our MongoDB. I've included a starting to link that shows how to index this type of data. Enable GeoJSON indexing on MongoDB for faster geographic queries. MongoDB supports 2Dsphere indexes which optimize geospatial queries and allow you to query hexagon tiles within specific geographic bounds.
Working Directory:
-backend/src/controller - make a controller for hexagons, province and soum
-backend/src/models - make a schema for hexagons, province and soum
-backend/src/routes.ts
-backend/src/server.ts
Great work so far team! For your next tickets you'll be doing some code refactoring and implementing the MongoDB
[x] REFACTOR: You'll be revisiting your old ticket, but not to dev. You'll be refactoring your code.
I noticed a lot of "helper functions" and "interfaces" were in the
about.tsx
page. They look solid I now want you guys to create a special file calledhelpers.ts
andinterfaces.ts
so we can keepabout.tsx
as clean as possible. I know we're usingabout.tsx
as a "tester" page but ideally we'd still want to abstract these functions even more and put them in their own file so we simply "plug and play" when necessary. Include these files in autils
folder.All of
SidePanel
logic inabout.tsx
should go in theSidePanel.tsx
file. We want to keep that "about" tester page as clean as possible and to have everything modularized.When implementing
Button
,SearchBar
and other atomic elements included in theSidePanel
, use the components that you made earlier instead of the MUI base components. We'll do this so we can customize our elements to adapt to a smaller screen.[x] DEV / RESEARCH: Create schema, controllers and routes for our MongoDB creation. I have included the schema creation from our partner meeting under
Schema
section in the System Design Doc (H4I Notion Page). I gave an example schema creation inbackend/src/models/Hexagon.ts
, so I would say start with the Hexagon class. You are going to now create bring these schema to life! If you want to know more about a MongoDB database creation I've gone through how I created the DB underSetting Up the MongoDB Creation
in the onboarding files in Notion. For now you will test the code you made manually using Postman. Create:POST: /api/hexagons
GET: /api/hexagons
POST: /api/province
GET: /api/province
POST: /api/soum
GET: /api/soum
NOTE: We were supposed to have our MongoDB meeting last Friday, but it got pushed back so the schema isn't fully finalized. Nevertheless, I want you to get exposure with creating schemas, controllers and routes. I will give you example data to POST and GET in the Notion file under
Setting Up the MongoDB Creation
. Use PostMan to test your routes. I'm thinking of setting up automatic Jest tests in the future but not top priority right now.For the research aspect, there's many ways to store the type of GeoJSON data we're working with, so I would you like guys to do some research and optimize the way you store the GeoJson Data in our MongoDB. I've included a starting to link that shows how to index this type of data. Enable GeoJSON indexing on MongoDB for faster geographic queries. MongoDB supports 2Dsphere indexes which optimize geospatial queries and allow you to query hexagon tiles within specific geographic bounds.
Working Directory: -
backend/src/controller
- make a controller for hexagons, province and soum -backend/src/models
- make a schema for hexagons, province and soum -backend/src/routes.ts
-backend/src/server.ts
Tutorials: