Settings

Theme

Ask HN: What are the best open source TypeScript projects I can learn from?

219 points by pototo666 3 years ago · 75 comments · 1 min read


What are the best open source TypeScript frontend and backend real world projects I can learn from?

I am a self-taught web developers and I haven't worked for any good companies. There are no seniors reviewing my code.

My code quality can be improved but I don't know how. Maybe reading some good codebase is a way out.

I use React in frontend and express in Backend. Do you know any good OSS projects that use those stacks?

Maybe I should read popular OSS frameworks instead of web app's source code? I am thinking of changing my job, so reading real web app's source code might be more relavant.

I am very thankful for any advices. And Happy New Year!

FBISurveillance 3 years ago

* https://github.com/excalidraw/excalidraw

* https://github.com/calcom/cal.com

* https://github.com/supabase/supabase

* https://github.com/appwrite/appwrite

* https://github.com/n8n-io/n8n

* https://github.com/appsmithorg/appsmith

* https://github.com/directus/directus

* https://github.com/Budibase/budibase

  • thisjeremiah 3 years ago

    https://github.com/excalidraw/excalidraw/blob/master/src/com...

    files like this make me feel like my files aren’t too long after all :)

  • mohanarpit 3 years ago

    Co-founder of Appsmith here. Thanks a lot for mentioning our project.

    We love Typescript and chose it to take advantage of static type checking. At Apspmith, since we are a small team, we wanted to reduce management overheads and opted for a monorepo layout. Typescript went a long way in helping us organize the code into modules and let our build scripts compile relevant modules for each changeset.

    Having said that, Appsmith has been a learning experience in efficiently running a large project with lots of files. Feel free to dig into our source code to learn from our experiences. :)

  • vijaybritto 3 years ago

    Extremely interesting projects here. Not just for typescript but also for

    Monorepo tooling, Build optimizations, complex webpack setups, performance tuning. For example from the above list I went through cal.com repo and I saw that the way they have organized dev and prod builds and openAPI spec browsing tooling is very good. This is exemplary for anyone wanting to look at good ways to setup a project!

  • robertwt7 3 years ago
  • pototo666OP 3 years ago

    Thanks for the list.

    I've decided to dive deep into cal.com. Its tech stacks are exactly same as mine.

    And thank everyone giving advice!

    • Peer_Rich 3 years ago

      cofounder of cal.com here, thank you @pototo666 the typescript, tailwind, nextjs, trpc stack has been amazing so far

      • FBISurveillance 3 years ago

        Hey Peer, wanted to take a chance and say thanks (as a paying customer) for building cal.com, and doing it in public. It's been extremely helpful for me personally, I learned a lot by following your process, your handbook, and your codebase.

  • arcturus17 3 years ago

    Thanks, these are extremely interesting beyond TypeScript.

  • TAForObvReasons 3 years ago

    n8n is not open source and many of the projects are using a hybrid licensing model. Code on GitHub is "source available", not necessarily "open source"

    • johnfn 3 years ago

      If you want to learn from source code, source available is all you need.

      • NetOpWibby 3 years ago

        You know people gotta be pedantic on here.

      • TAForObvReasons 3 years ago

        There are plenty of proprietary source code leaks, and those are technically "source available" since the source is available, but that is not a recommended practice.

Benjamin_Dobell 3 years ago

Depends whether you actually want to learn TypeScript or just how to consume it. More than 90% of TypeScript code I've seen is not actually taking advantage of TypeScript's static analysis capabilities to write safer more scalable code and is instead just being used as glorified autocomplete.

If you actually want to learn, then take a look at the implementation for stuff like Zod: https://github.com/colinhacks/zod/tree/master/src/helpers

You can do some really powerful stuff that hugely benefits your team. A decent example I stumbled across recently when I went to release my own library (that does the same thing) is https://github.com/leancodepl/ts-routes

  • reidjs 3 years ago

    I wouldn’t discount the value of glorified autocomplete. Being able to hit the period (.) and see what’s inside this imported object is great, especially when consuming libraries as you mentioned.

  • thdc 3 years ago

    So true, a lot of people I've worked with treat adding types as a box to check (eg afterthought) rather than something to leverage.

  • eyelidlessness 3 years ago

    Your suggestion of zod is a very good one. I’ll take it further and suggest that if one wants to really embrace and learn TypeScript (or type systems like it), implementing your own zod-like library is an excellent learning experience. Building a set of composable “parse, don’t validate” primitives will help you think in the way the type system is designed to be most effective. And you’ll generally write better code for it.

cheeseblubber 3 years ago

I work on Linen https://github.com/Linen-dev/linen.dev its an open source Slack alternative. Its a full stack typescript app. We do a mono repo with typesharing between both client and backend. If you are looking for a realworld typescript SAAS app this would be good

lioeters 3 years ago

This could be a good learning resource, a collection of client & server-side TypeScript projects.

Awesome TypeScript - https://github.com/dzharii/awesome-typescript

And here's a list of projects on GitHub tagged with the topic "TypeScript", sorted by most stars. Many build tools I see on the first page, starting with the TypeScript compiler itself - which is an impressive and interesting codebase, but it may not be so suitable for study purpose.

https://github.com/topics/typescript

You might enjoy learning from some books too.

The TypeScript Handbook - https://www.typescriptlang.org/docs/handbook/intro.html

TypeScript Deep Dive - https://basarat.gitbook.io/typescript/

christofosho 3 years ago

This is not exactly a codebase, but I believe it merits mention in this thread as a great TypeScript learning resource.

https://type-level-typescript.com/

A short online course about intermediate-to-advanced level TypeScript.

tuxracer 3 years ago

Senior dev here. Recently have some extra time. Happy to offer some code reviews to help you get started. Contact info in bio

mhluongo 3 years ago

I'm part of the team that maintains a digital wallet browser extension with a really clean codebase — check it out.

https://github.com/tallyhowallet/extension

austin-cheney 3 years ago

I am working on a Node/browser OS in TypeScript to solve for decentralization/peer-to-peer relations if you want to check that out.

https://github.com/prettydiff/share-file-systems

Selling points:

* No frameworks and minimal dependencies

* The GUI loads in the browser with full state restoration in about 260ms in Chrome.

* Full peer to peer file system access

* Original WebSocket service support faster than the popular NPM packages (ws, socket.io)

* Peer-to-peer end-to-end test automation in the browser that is faster and easier than the big browser test automation applications (puppeteer, playwrite)

* I am currently working on a streaming command terminal for the browser for support for for things like vim and irssi. The current experimental terminal only supports basic command input/output

zadler 3 years ago

Zapatos, check out how it does type safe querying. Very impressive work and shows that typescript’s type model has a lot of power.

sebrindom 3 years ago

You should check out https://github.com/medusajs/medusa

It’s an open source commerce engine built in Node w. TypeScript. The domain is fairly easy to wrap your head around and the architecture and code quality are often praised.

okhobb 3 years ago

I've found NestJs to be a very thoughtful application framework. I'd argue it demonstrates pro-level typescript coding.

https://github.com/nestjs/nest

  • jconley 3 years ago

    Nest is impressive. Especially if you came from .Net or Java. I just started a new project with Nest recently and it was a breath of fresh air. It has all the bits I had to add manually to other Node projects in the past. I feel like they go a bit over the top promoting design patterns in their documentation, though I appreciate how methodical they are with them in their own code.

plondon514 3 years ago

I definitely wouldn’t say it’s the “best” open source project but my side project https://github.com/codeamigo/codeamigo is a full stack project written in TypeScript and I’m happy to answer any questions you have about it. Full project here: https://codeamigo.dev

darkest_ruby 3 years ago

Fp-ts and io-ts, best examples of what functional programming along with strict type safety can achieve. The source code is a pleasure to read and explore

  • chrischen 3 years ago

    The author also writes some great articles on category theory that is approachable to TS developers.

TowerTall 3 years ago

This book gave me a good push in the right direction when I was in the same situation as you many years ago. It gave me the tools I needed, and it is still very relevant today. "old but not obsolete" as they say in the terminator movie.

https://en.wikipedia.org/wiki/Code_Complete

m_a_g 3 years ago

I want to ask the same question for Python and Go. I'd love to see some quality OSS using Python or Go and contribute to them if I can.

mburst 3 years ago

I started working on a project to solve this exact issue https://github.com/mburst/protomolecule. I haven't spent too much time building out other frameworks, but the first framework is React + Express which fits what you're looking for

dimitropoulos 3 years ago

https://github.com/type-challenges/type-challenges

The type challenges are a great thing to learn with. Admittedly, they're a bit intense but it's a great way to "expand your awareness".

As a shameless self plug, I'm participating in a 140-day long project to do them all (complete with video explanations) that just started yesterday, if you wanna follow along: https://github.com/type-challenges/type-challenges/issues/21...

nullandvoid 3 years ago

This could be a good place https://create.t3.gg (understanding all the code generation would be useful, but also you can deep dive into any one of the type safe libraries).

reducesuffering 3 years ago

https://github.com/shadcn/taxonomy has been very useful for me learning the new Next.js 13 app/ React Server Components in Typescript.

tuan3w 3 years ago

Outline: https://github.com/outline/outline

One of the best code base that I have seen, not just TypeScript.

nomilk 3 years ago

This is such a valuable question for other languages too. I wonder if there's a repo/resource listing such projects..

I asked a similar question about ruby some time ago, and came across one good recommendation (https://github.com/sharetribe/sharetribe), but would love to have many more. I'm also self-taught and feel I haven't read enough great ruby code!

bunnyfoofoo 3 years ago

For backend and general typescript knowledge, I’d highly recommend Apollo GraphQL: https://github.com/apollographql/apollo-server

Check out their apollo-server and apollo-client repos. It’s a very useful codebase to be knowledgeable about. This is something you should mention in an interview as a strong positive if the company wants graphql experience.

mirekrusin 3 years ago

https://github.com/preludejs for lightweight functional approach.

joshka 3 years ago

Meta question: I wonder what it would take to splat a code quality metric on every github repo. Obviously this is a combination of subjective and objective factors, but I wonder if doing this in bulk would lead to a general improvement in the industry. Particularly paired with CoPilot and having some sort of feedback into the training this would be pretty neat...

gherkinnn 3 years ago

How about a different approach. Instead doing more of the same, branch out in to a different language. Elm, for example. [0]

Elm specifically will teach you lots on the static types end of things. And it will only take a weekend or so of tinkering to show improvements in your TS life.

0 - https://elm-lang.org/

tajaheidkebbie 3 years ago

Lolssss you’ve all been duped… this list will be used to train an ai model, which will then take over your job!!

zhardy 3 years ago

I have the same question, but for Java. I'm was front-end developer that now learning back-end.

fatih-erikli 3 years ago

https://github.com/fatih-erikli/table

https://github.com/fatih-erikli/sketchbook

tttcos 3 years ago

This one is good reading, it's the backend of a real-time 2D multiplayer war game: https://github.com/wight-airmash/ab-server

schwartzworld 3 years ago

It's not popular, but I'm very proud of my ADT library I'm working on. https://github.com/schwartzworld/schtate

td8 3 years ago

I don't know about the quality, but Mattermost is in TS: https://github.com/mattermost/mattermost-webapp

ushakov 3 years ago

tRPC, because you can learn a lot of type-inference tricks using generics and proxies

https://github.com/trpc/trpc

  • cehrlich 3 years ago

    tRPC is awesome, but it will teach you about typescript wizardry and how to write a library, not how to write an application.

99112000 3 years ago

You should contribute to open source project that has reviewers, it's like doing a test and having it graded by teachers.

  • pototo666OP 3 years ago

    Special thanks, you make a great point!

    I will pick one interesting open source project and start contributing.

Matthias247 3 years ago

The vscode codebase might be interesting.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection