RealDevSquad / RealDevSquad/website-backend
[RFC] Create schemas/models to model the backend data
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 74
- Forks
- 276
- Avg merge
- 1d 26m
- Merged PRs (30d)
- 14
Description
Overview
Firestore is a NoSQL database, which allows developers to be flexible and add new features instantly, however error handling and handling various edge cases to data becomes difficult.
Proposed Solution
Create model classes and initialize them whenever we fetch the data from DB. Instead of sending the raw object we get from firestore, we initialize the data we get using a class, that class will abstract all the logic related to data, and our service that we use to fetch the data currently will return the instance of that class
This way we will be able provide null values to fields we don't get and the user (developer who will be using the service function) won't have to check for undefined fields on their end.
Since most of the error handling logic and other data manipulation logic will be handled, this will save us a lots of repetitive code.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or specific entry points are named. Start by tracing the existing services that fetch raw objects from Firestore and their consumers; the work is done when model instances are returned, missing fields have defined null values, and data handling is centralized as proposed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100