RealDevSquad / RealDevSquad/website-backend

[RFC] Create schemas/models to model the backend data

Open
#1,534 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.