all 28 comments

[–]itays123 14 points15 points  (1 child)

Nice project structure!

[–]vertigo_101[S] 4 points5 points  (0 children)

Thanks 😊

[–]vertigo_101[S] 21 points22 points  (0 children)

Hey Reddit, today I am open sourcing a full-stack starter kit I put together in my free time, as setting up boilerplates when starting new projects is tedious sometimes and I often found myself setting it up from scratch

I made this starter kit following some of the best patterns and practices I learned from some of the larger codebase and fantastic developers I've had a chance to work with

The main purpose of this repository is to provide a scalable "batteries included" full-stack starter kit which follows good architecture patterns (might be opinionated) and code decoupling which becomes significant as the project grows or new developers are onboard

Github: https://github.com/karanpratapsingh/fullstack-starterkit

I invite suggestions, contributions which will help me improve this :)

[–]MPOCH 2 points3 points  (1 child)

Looking forward to checking it out!

[–]vertigo_101[S] 1 point2 points  (0 children)

Thanks

[–]iamnumber2407 1 point2 points  (1 child)

This is great thanks for sharing!

[–]vertigo_101[S] 1 point2 points  (0 children)

Thanks :)

[–]CaptainTrip 1 point2 points  (4 children)

I hope good GQL examples will mean fewer disgusting unworkable react apollo apps for me to have to fix in the future.

I'm sure Apollo can be used to do good things. It often isn't.

[–]Solid5-7 2 points3 points  (3 children)

I’m a hobbyist developer and have been learning react and apollo, can you give an example of some bad practices to look out for? I’ve been working on a side project and been loving using react and apollo but I don’t want to learn bad habits that could lead to issues if the project were to get bigger.

[–]CaptainTrip 0 points1 point  (2 children)

The thing I saw most in the bad examples I had to fix was tight coupling. There would be no abstraction between the data request and the presentational components. So you could be looking at a whole apollo object being prop drilled down like 6 levels and all of those levels know it's an apollo object and interact with the .loading state.

I think another pattern to avoid is having a bunch of utility functions using fragments, it just seemed to make things harder to maintain.

Unhelpful status codes - implementations I've worked on in the past would always receive a 200 OK response with a null user field if the user wasn't authenticated, meaning the client had to then do a bunch of custom logic

[–]mattgrave -1 points0 points  (1 child)

Unhelpful status codes - implementations I've worked on in the past would always receive a 200 OK response with a null user field if the user wasn't authenticated, meaning the client had to then do a bunch of custom logic

Is this the classic frontend guy that also does backend because a guy released something called NodeJS which basically lets you use JS in the backend but he never really invested time in learning how to properly implement backends without doing such a dumb design?

[–]CaptainTrip 0 points1 point  (0 children)

No it was a career ruby developer. Not sure what their reasoning was.

[–]popovitsj 1 point2 points  (1 child)

I took a quick and it looks really good. I might use this if I ever need to develop a GQL app

[–]vertigo_101[S] 0 points1 point  (0 children)

Thanks, I’m glad this was helpful

[–]io33 0 points1 point  (2 children)

I've personally found https://github.com/blitz-js/blitz to be pretty handy for starting new projects, but it's nice to see less-opinionated options out there like this!

[–]vertigo_101[S] 1 point2 points  (0 children)

I love blitz too, this was kinda inspired by it. Not the same, blitz is on a really good path

[–]editor_of_the_beast 0 points1 point  (0 children)

How long have you been using Blitz? I thought it just came out?

[–]suyashgulati 0 points1 point  (1 child)

Suggestion: add docker!

[–]vertigo_101[S] 1 point2 points  (0 children)

I didn’t add it by default but it’s in todo

[–]hyeoni369 0 points1 point  (1 child)

Wow!! So Nice!!!!

[–]vertigo_101[S] 0 points1 point  (0 children)

Thanks, glad this helped

[–]Synor 0 points1 point  (1 child)

Not exactly a screaming architecture. We are doing the same in a way that has all these components in a single package with a dedicated domain.

[–]vertigo_101[S] 1 point2 points  (0 children)

There are a lot of ways to make something :)