Can t3 app be deployed on a traditional server and a tradition database?
I kind of fear being locked into these solutions like planelscale, vercel, clerk etc. So, in case if I am not satisfied with my applications with these services, can I just simply move out?
Or do I have to create the whole thing from the start again.
please forgive me for my dumbness
42 Replies
@adityaj21 But can I just simply deploy it with a tradition server and database?
yup can always move out
change clerk with next auth
db with you choice
And what if I don't want to use serverless and co.
Can I just deploy it on a beatup vm I buy from hetzner?
i dont know about this never tried it actually
but normal express server will work just fine with next
But that means you have to create new backend. no?
yeah you have to
Is serverless and edge the same?
Got it.
next gives us the api endpoints so you dont have to create a server
This JS space goes way above my head. xD
it goes over mine too xD
How long did it takes to master t3 app?
And is it fast to work with?
And is it performant as well?
JS is scary coming from c#.
creating stuff is super fast as everything is setup v nicely
just have to understand some trpc way of writing apis and prisma schema
And how does prisma performs?
Is it fast? I have heard some bad stuff.
for me prisma is okay
for large scale apps idk
you can use drizzle
serverless and edge is basically the same
Both simplify requests to an extent where they provide u with a req and res object and u can work with it within the function
The difference is serverless uses the node runtime (which provides u with all the node apis)
But edge, for the sake of performance omits a couple of the node apis (like the crypto module), hence not ALL npm modules work on the edge
u CAN move out of those services, vendor lock in doesnt mean u CANT move out, just means it becomes a pain in the ass in ORDER to move out
in case of vercel, I strongly believe they dont do vendor lock-in in the traditional definition of the word.
AWS, GCP etc are just cloud providers and they make it VERY hard to change from one to another
But vercel is basically just a layer on TOP of AWS which SIMPLIFIES AWS, so by DEFINITION building apps on AWS is harder than building them on vercel, so people just tend to use vercel
Damn. Thank for the detailed answer.
I was just worried if in case I don't want to use them anymore and the price doesn't justify it, how hard will it be for me to just spin a VM and throw Next.JS there?
what
no you dont
Btw, what is your position with setting up TRPC or any API calls within React Query?
wdym
COMPARED to vercel VERY hard.. because the entire selling point of vercel is "simplifying website deployment" so vercel abstracts away a lot of the complex shit during hosting for u
what Im tryna say is.. going from vercel to AWS is just as hard as hosting on AWS directly.. there is minimal to no EXTRA difficulty
Any project u deply on vercel runs on AWS servers.. so y do people choose vercel? cuz its wayy simpler than AWS (primary selling point)
im sure someone can help you out
a lot of people have copy pasta scripts to ssh in and deploy
I mean using React Query for state management.
I don't know what approach does t3-app uses.
The tRPC client is a react query implementation
I don't get it. Does it use the TanStack React Query?
Yes
Will I be able to implement optimistic UI updates with it?
api.router.route.useQuery()
api.router.otherRoute.useMutation()
Just very clear what route you’re hitting
YupCan you give me a rough example?
Same way as normal react query
You just don’t need a queryFn / query function
As it’s part of the tRPC client that wraps react query
It does it for you
I don't understand a thing but let me do my research. xD
React Query Integration | tRPC
React Query Integration
But where is the optimistic UI update code?
I don't see it here.
It works the same as react query so there’s an example by react query on their docs
Surely you can just run Nginx and PM2 on your VPS and then just put your t3 app on there?
This might be a good guide for you
DigitalOcean
Deploying a Next.js Application on a DigitalOcean Droplet | Digital...
Next.js is a popular React framework for building server-rendered React applications with ease. In this tutorial, we'll walk through deploying a Next.js application on a DigitalOcean droplet using Nginx as a reverse proxy.
Or maybe this one
How To Deploy A Next.js Website To A DigitalOcean Server
Step-by-step guide to deploying a Next.js website to DigitalOcean with a custom domain, Nginx reverse-proxy, and HTTPS/SSL encryption.
You don't have to use digital ocean as your VPS/server obviously, but the steps should remain pretty universal
Basically,
1. Get a VPS
2. Clone your t3 app onto it
3. Set up firewall
4. Set up nginx
5. Set up some process manager, pm2, systemd or whatever you like
6. Certbot or cloudflare for your SSL certificate (https)
welcome to the real world is all im saying
🥲
can also host on simpler solutions?
fly.io
railway
render
Caddy will automatically manage TLS certificates with minimal config. Written in Go btw