Vic 🌮 Profile picture
Mar 4, 2022 10 tweets 4 min read Read on X
How do you build a fullstack app from scratch? I see this question here all the time.

The answer is something like:
- next.js
- python
- sagemaker
- tailwindcss
- C++
- typescript
- java
- sql

Makes 0 sense.

Here's a guide on building a fullstack JavaScript app in 15 mins 🧵
We're going to use Remix for this project.

Get started with:
❯ npx create-remix@latest

This will set up a directory with code and run npm install for you.

Start the site to see it:
❯ npm run dev
Idea: We're going to track our water and coffee drunk in a database.

Set up Prisma so we can talk to the db. Prisma is a database client for TypeScript and Node.

I install it, then add a new model. Now I can push my new table to SQLite. We can switch to something else later.
Before we can access our database from code, we also need to create a file that helps us make a connection to Prisma.

Add a file named app/lib/db.server.ts.

The .server.ts part of the filename is pretty cool. It ensures that Remix will never bundle it and send it to clients.
Another note here about Prisma. It comes with an inbuilt visual data browser for you to look at your database.

Try it out:
❯ npx prisma studio

I used the studio to manually add a few records of the liquids I've drunk today. 1 x ☕️, 2 x 💧
Now we are finally going to connect our app to the database! Drumroll 🥁 please.

Open up app/routes/index.tsx that the Remix create made for you and delete everything in it. Let's replace it with this instead.

Reload your site and behold, your beverage consumption ala Wordle.
We need to enter data into the database somehow, so next let's work on a form to submit what we are currently drinking.

Forms in Remix are super simple. No need to build an API or anything.

First we create a form, and then we create the form handler.
Let's try it out! And there we go. 🎇💥

Okay Twitter video upload is broken so I have to do a screenshot. I promise it works.
Twitter issue is killing me 😂 I'll convert this tutorial to a detailed post with code samples on my blog soon, along with how to deploy it to production. If that is something you're interested in, follow me and I'll post about it when it's ready.

Stay hydrated, my friends! 🌊
I haven't written the article yet but here's the code if that's helpful to someone. github.com/needcaffeine/f…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Vic 🌮

Vic 🌮 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @VicVijayakumar

May 7, 2023
In case you missed it-

The Prime Video team originally built a Video Quality Analysis service very quickly with Lambda + Step Functions.

They soon realized that passing data between distributed components was expensive. So they refactored their code to run as a single service. The initial architecture of...The updated architecture fo...
This was a distributed microservice with various serverless components that needed to pass data between steps (they used S3).

It got refactored into a single microservice (no more S3 between steps).

The team says they reused most of their code making this refactor inexpensive.
This entire thing is a success story.

They went with a serverless-first approach to ship quickly, then refactored their architecture when they became aware of new factors. In a different world, they may have stuck with Lambda because it worked perfectly fine.
Read 6 tweets
Jun 5, 2022
I'm solo parenting this morning and the 4yo wants to be left alone for a bit.

Here are 10 personal finance things I'm glad I learned about 10 years ago:
1/ Max out every retirement benefit

Max out your 401k, at least to get that employer math. This reduces your taxable income.

Max out your Roth IRA. If you're married you can 2x this even if your spouse is unemployed.

Max out your HSA. It is a triple tax advantaged power IRA.
2/ Don't pick stocks, choose index funds

Index funds diversify your holdings and lower your risk. As an example Vanguard's VTSAX fund contains 4112 stocks across 11 different sectors.

What a fund will cost you is called an expense ratio (ER). Select funds with low ER like 0.04%
Read 13 tweets
Mar 23, 2022
Hey, look at that! I went from 0 to 5K followers in...14 years 🥳😂😂

Here is my growth strategy and some observations about some of my most popular tweets:
I use Twitter as a way to document my life.

I'm a parent, runner, saas builder, engineer, former engineering director, cook, violinist. I tweet about all of it. This may not a good strategy if you're a small account wanting to grow.
Outrage is addicting. The engagement from outrage tweets is like consuming empty calories.

This viral tweet came with hundreds of followers. But the people who followed me did so for a response slamming someone else, they weren't there for me.
Read 12 tweets
Mar 23, 2022
It’s important to drive your own work-life balance. You only have the cognitive load to juggle so many balls. Can you drop some?

What *worked* for me was taking 2 weeks off to just staycation and work on my health, then shortening my week by taking Fridays off. #DevDiscuss
Not everyone can afford to destress by travel, and traveling is a logistics nightmare for me (kids, dog, chickens, plants, pandemic). However I do have plenty of PTO, so I use them up by just being a dad and husband 100% of the time. Cooking, running, biking, reading. #DevDiscuss
I often link people who say the B word to two burnout talks I resonated a lot with, and I hope you do too.

This one by @ashleymcnamara at AllThingsOpen:

This one by @jesslynnrose at DjangoCon US 2019:

Please watch. #DevDiscuss
Read 4 tweets
Mar 3, 2022
💯 You can tell an engineer why something won’t work based on your experience but they are far more likely to retain a lived experience.

My thing in those situations is to say “let’s see what happens if we try that approach”.

Don’t say “do it & you’ll see why it’s wrong”.
It’s also entirely possible that their suggestion will work, and you the senior engineer is going to learn something invaluable.
I am not trying to infantilize anyone here, but those of us with kids immediately see the parallels.

My 7yo is riding her bike. I say don’t slam the brakes when you’re going over dry leaves, coz physics. She does it anyway, gets a bloody knee.

She’ll retain this experience.
Read 6 tweets
Jan 6, 2022
The most valuable skill for a junior dev to learn is "communication".

I've been interviewing engineers for 15+ years, and maybe this advice will seem obvious.

A quick thread of great communication in an interview to help you land that software dev role.
The interview intro

Your interviewer will intro themselves and rundown how the next 30+ mins will be spent.

When they ask you to introduce yourself, remember that this is part of the interview!

You're not a prisoner of war, don't just state your name and rank, and go quiet.
Practice your intro beforehand

When an interviewer says tell me a little bit about yourself, please tell them about yourself.

Tell them where you're from, what you currently do, what kind of things interest you.
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(