Logo

dev-resources.site

for different kinds of informations.

How to Read or Understand an Open-Source Projects

Published at
12/28/2024
Categories
opensource
softskill
tutorial
softwareengineering
Author
kasir-barati
Author
12 person written this
kasir-barati
open
How to Read or Understand an Open-Source Projects

It's always supper fun to dig into coding and try to make sense of open-source libs. it's been a while since I've started to use nestjs-query in my GraphQL services. It makes a lot of things easier. But I was puzzled with how the underlying implementation for Connection pagination and offset pagination works.

So I dug the lib and here is my final understanding: https://github.com/TriPSs/nestjs-query/issues/344#issuecomment-2562805549


I do not think it is gonna find its way into the docs someday, but nonetheless I decided to let you know how I get started to work with a new concept (GraphQL) and read this libs codebase in a manner that helped me to understand what's going on:

  1. I started with getting familiar with the structure of the root directory in nestjs-query. Just seeing what we are using and what we have.
  2. I felt I kinda missed some crucial parts of docs. So I went to the official docs and read a bit more about the packages that resides in this monorepo.
  3. I came back and ran one of the e2e tests in the debug mode. In fact I added plenty of breakpoints in my VSCode and tried to see how it works in general.

    I was really interested in knowing how it generates the resolvers, service layer and integrates with TypeORM.

  4. Now I had a pretty good idea about how it works but I still was not able to pin point where exactly in the codebase we are defining the default pagination strategy. That's where I went back to the docs and read it this time top to bottom once more.

  5. That's when I started to comprehend more and see how it work. Surprisingly it was really a no-brainer, I do not mean it is simple, I mean why they choose to implement certain things the way it's done in the lib. E.g. this lib is using mixins extensively and I love how modular it has made this lib as a result.

  6. Eureka moment. I finally grasped it.

NOTE

In this process I can tell you that I several times went back and forth, ran the e2e tests in the debug mode again and again to understand it. So if you tried to apply this approach and did not get the result you wanted do not be discouraged and try yet again.


BTW if you wanna develop a new GraphQL service in NestJS it is a really great tool to do the mundane and dull tasks with nestjs-query. So that you can focus on building what matters for your business.

And besides the fact that I am using it, I am actively as you can see invested in this lib and in fact my aim is to make it something comparable to HotChocolate as I explained it here: https://github.com/TriPSs/nestjs-query/discussions/333

And if you liked this post consider giving this repo a star on GH :).

GitHub logo TriPSs / nestjs-query

Easy CRUD for GraphQL.

Nestjs-query Logo

Test codecov Known Vulnerabilities slack

nestjs-query

Nestjs-Query is collection of packages to make crud for graphql easier.

Why?

While working on projects in nestjs it was very easy to get up and running with graphql however, there were many patterns that were common between the resolvers. In particular querying, sorting and paging.

Installation

Install Guide.

Docs

Packages

Nestjs-query is composed of multiple packages


Follow me:
Instagram: https://www.instagram.com/node.js.developers.kh/
Facebook: https://www.facebook.com/kasirbarati
X: https://x.com/kasir_barati
YouTube: https://www.youtube.com/@kasir-barati
GitHub: https://github.com/kasir-barati/
Dev.to: https://dev.to/kasir-barati
LinkedIn: https://linkedin.com/in/kasir-barati

softskill Article's
30 articles in total
Favicon
How to Read or Understand an Open-Source Projects
Favicon
The 10x Software Engineer's Secret: Balancing Bits and Life
Favicon
Emotional Intelligence in IT: Leveling Up Your Soft Skills
Favicon
Por que alguns desenvolvedores conseguem empregos rapidamente e outros não?
Favicon
I'm russian developer. Why everybody hate me?
Favicon
Soft Skills Development in Cyber Security Job Ready Programs
Favicon
"Empowering Futures: Completing the 'Prepare for Apprenticeships and Jobs' Course"
Favicon
“Managing up”: Developing your influence power
Favicon
Improve Your Soft Skills at Bangalore Training Institutes
Favicon
🚀 The Future of Developers: Embrace the Evolution! 🤖
Favicon
Learn the Art of Effective Communication - Talking to Your Boss without Being a Problem
Favicon
5 principles of effective communication with a team-lead
Favicon
Kĩ năng quản lý căng thẳng cho Developer
Favicon
The Essential Skills for Success as an Engineer, based on 500 responses
Favicon
Stop coding to improve your code and soft-skills
Favicon
How to deal with negative feedback at work
Favicon
Coffee Talk
Favicon
Journal of self-growth
Favicon
🔮O que eu diria para o meu EU de 10 anos atrás
Favicon
[Italian] Classi ed Oggetti, una semplice prospettiva filosofica con Platone
Favicon
FOCO : A Softskill mais valiosa na era da informação
Favicon
TechLead or DevLead ?
Favicon
Time and its management tools
Favicon
TOP 7 Soft Skills For IT Specialists
Favicon
Find your specialty by being a T-shaped person.
Favicon
Patience is a must-have soft skill for Developers. Here is why
Favicon
Communication and Software Development
Favicon
Pantang menyerah dalam kerja tim
Favicon
Engineering Daybook
Favicon
Soft-Skill 101 - Mentoria. Porque e como?

Featured ones: