kahneman

a configurable comparative investment tool

MIT License

Stars
0

kahneman

a configurable comparative investment tool

This is a Blitz.js app.

name

Getting Started

Run your app in the development mode.

blitz dev

Open http://localhost:3000 with your browser to see the result.

Environment Variables

Ensure the .env.local file has required environment variables:

DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/kahneman

Ensure the .env.test.local file has required environment variables:

DATABASE_URL=postgresql://<YOUR_DB_USERNAME>@localhost:5432/kahneman_test

Tests

Runs your tests using Jest.

yarn test

Blitz comes with a test setup using Jest and react-testing-library.

Commands

Blitz comes with a powerful CLI that is designed to make development easy and fast. You can install it with npm i -g blitz

  blitz [COMMAND]

  dev       Start a development server
  build     Create a production build
  start     Start a production server
  export    Export your Blitz app as a static application
  prisma    Run prisma commands
  generate  Generate new files for your Blitz project
  console   Run the Blitz console REPL
  install   Install a recipe
  help      Display help for blitz
  test      Run project tests

You can read more about it on the CLI Overview documentation.

What's included?

Here is the starting structure of your app.

kahneman
├── app/
│   ├── api/
│   ├── auth/
│   │   ├── components/
│   │   │   ├── LoginForm.tsx
│   │   │   └── SignupForm.tsx
│   │   ├── mutations/
│   │   │   ├── changePassword.ts
│   │   │   ├── forgotPassword.test.ts
│   │   │   ├── forgotPassword.ts
│   │   │   ├── login.ts
│   │   │   ├── logout.ts
│   │   │   ├── resetPassword.test.ts
│   │   │   ├── resetPassword.ts
│   │   │   └── signup.ts
│   │   ├── pages/
│   │   │   ├── forgot-password.tsx
│   │   │   ├── login.tsx
│   │   │   ├── reset-password.tsx
│   │   │   └── signup.tsx
│   │   └── validations.ts
│   ├── core/
│   │   ├── components/
│   │   │   ├── Form.tsx
│   │   │   └── LabeledTextField.tsx
│   │   ├── hooks/
│   │   │   └── useCurrentUser.ts
│   │   └── layouts/
│   │       └── Layout.tsx
│   ├── pages/
│   │   ├── _app.tsx
│   │   ├── _document.tsx
│   │   ├── 404.tsx
│   │   ├── index.test.tsx
│   │   └── index.tsx
│   └── users/
│       └── queries/
│           └── getCurrentUser.ts
├── db/
│   ├── migrations/
│   ├── index.ts
│   ├── schema.prisma
│   └── seeds.ts
├── integrations/
├── mailers/
│   └── forgotPasswordMailer.ts
├── public/
│   ├── favicon.ico
│   └── logo.png
├── test/
│   ├── setup.ts
│   └── utils.tsx
├── .eslintrc.js
├── babel.config.js
├── blitz.config.ts
├── jest.config.ts
├── package.json
├── README.md
├── tsconfig.json
└── types.ts

These files are:

  • The app/ folder is a container for most of your project. This is where you’ll put any pages or API routes.

  • db/ is where your database configuration goes. If you’re writing models or checking migrations, this is where to go.

  • public/ is a folder where you will put any static assets. If you have images, files, or videos which you want to use in your app, this is where to put them.

  • integrations/ is a folder to put all third-party integrations like with Stripe, Sentry, etc.

  • test/ is a folder where you can put test utilities and integration tests.

  • package.json contains information about your dependencies and devDependencies. If you’re using a tool like npm or yarn, you won’t have to worry about this much.

  • tsconfig.json is our recommended setup for TypeScript.

  • .babel.config.js, .eslintrc.js, .env, etc. ("dotfiles") are configuration files for various bits of JavaScript tooling.

  • blitz.config.ts is for advanced custom configuration of Blitz. Here you can learn how to use it.

  • jest.config.js contains config for Jest tests. You can customize it if needed.

You can read more about it in the File Structure section of the documentation.

Tools included

Blitz comes with a set of tools that corrects and formats your code, facilitating its future maintenance. You can modify their options and even uninstall them.

  • ESLint: It lints your code: searches for bad practices and tell you about it. You can customize it via the .eslintrc.js, and you can install (or even write) plugins to have it the way you like it. It already comes with the blitz config, but you can remove it safely. Learn More.
  • Husky: It adds githooks, little pieces of code that get executed when certain Git events are triggerd. For example, pre-commit is triggered just before a commit is created. You can see the current hooks inside .husky/. If are having problems commiting and pushing, check out ther troubleshooting guide. Learn More.
  • Prettier: It formats your code to look the same everywhere. You can configure it via the .prettierrc file. The .prettierignore contains the files that should be ignored by Prettier; useful when you have large files or when you want to keep a custom formatting. Learn More.

Learn more

Read the Blitz.js Documentation to learn more.

The Blitz community is warm, safe, diverse, inclusive, and fun! Feel free to reach out to us in any of our communication channels.

economic vs financial health?

Basically, economic health optimizes on personal subjective value, involving non-financial inputs and outputs.

Economics is both a quantitative approach to sociology and also a study of the optimal allocation of resources. Basically, a good economic health app can help you understand what you should be doing at any time. Like a life coach.

  1. A basic example is taking a vacation. It's expensive and will never be selected as an optimal investment using purely financial investing strategies.
  2. Other examples would be: Eat more expensive health food to improve your health. The return is non-financial and only very indirectly might relate to long term income gains. Most budgeting systems would treat this as a pure expense. An economic health app can proactively select increased health spending as an optimal economic investment.
  3. Time is forefront in importance in an economic health app. Budgets tell you what to do with your money, and cutting-edge ones might have a calender integration that tells you when a bill is due. Economics take this trend 10 years into the future. Every hour has an opportunity cost. You could be sleeping, studying, working out, or doing something else. How do you compare all of these options? You can use your own judgement and intuition, but an economic health app assist your judgement and intuition to compare these things in a low-bias, high-precision way.
  4. Economic health apps also prioritize behavioral considerations. We see a little of this in behavioral finance, but it rarely makes it's way into financial planning. Dave Ramsey's snowball justification (motivation from small wins) is a rare example of this kind of thing, but it's still not very tailored. Ideally, economic health strategies are adapted to your specific personality.
  5. Economic health apps are personalized far more than traditional investing and budgeting. In traditional investing you consider risk tolerance, and in sophisticated investment you consider some basic forms of time preference such as target retirement date. In economic health apps we also care about other stuff like health preference, stress tolerance, vicarious utility (I don't value my health but my wife would be mad if I died so I vicariously value it), even religious values! After all, what you should be doing is fundamentally a moral question no?

maybe partially intended to supersede my old budget tool? https://github.com/Vandivier/budget-tool

Badges
Extracted from project README
Blitz.js