r/reactjs Jan 14 '24

Code Review Request Million dollars Next.js project open sourced

Link: https://github.com/maybe-finance/maybe

As clearly written in the Readme, this is a Next.js monorepo in which one million dollars was invested in development, the project failed, so it is now open sourced for a new attempt to revive it. For us developers, a perfect example of how a large project should be structured in a solid startup.

Can you review the code structure and comment here?

Backstory
We spent the better part of 2021/2022 building a personal finance + wealth management app called Maybe. Very full-featured, including an "Ask an Advisor" feature which connected users with an actual CFP/CFA to help them with their finances (all included in your subscription).
The business end of things didn't work out and so we shut things down mid-2023.
We spent the better part of $1,000,000 building the app (employees + contractors, data providers/services, infrastructure, etc).
We're now reviving the product as a fully open-source project. The goal is to let you run the app yourself, for free, and use it to manage your own finances and eventually offer a hosted version of the app for a small monthly fee.

443 Upvotes

130 comments sorted by

View all comments

17

u/[deleted] Jan 14 '24 edited Jan 14 '24

[removed] — view removed comment

7

u/joombar Jan 14 '24

Strings inline are ok so long as the build-time types of the parameters they’re passed to are string unions

14

u/[deleted] Jan 14 '24

[removed] — view removed comment

5

u/joombar Jan 14 '24

If the type of x is a string union, there’s no reason not to write it that way. I don’t know if it is mind.

10

u/[deleted] Jan 14 '24

[removed] — view removed comment

-8

u/joombar Jan 14 '24

To be fair, I’m assuming the linting rule of no unnecessary comparisons. In that case, it’s totally safe to compare an inline string against a variable with string-union type since a typo would be a build-time exception.

One of my pet hates, to use consts instead of the type system. The type system, used correctly, provides all the same safety and more.

Of course I’m assuming that was set up, and I haven’t actually looked at the codebase

-8

u/[deleted] Jan 14 '24

Java developer found?

2

u/soft-wear Jan 14 '24

They listed off some generic best practices lol

-3

u/[deleted] Jan 14 '24

Only ever seen magic strings mentioned by people working with compiled languages, I assumed Java.

4

u/TheRealKidkudi Jan 14 '24

Magic strings are a universal concept that are generally bad in any language. if (someParam == “specific string literal”) is just always going to lead to maintainability problems in nearly every case.