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 theowat
42 Replies
Sawaid
SawaidOP16mo ago
@adityaj21 But can I just simply deploy it with a tradition server and database?
aditya
aditya16mo ago
yup can always move out change clerk with next auth db with you choice
Sawaid
SawaidOP16mo ago
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?
aditya
aditya16mo ago
i dont know about this never tried it actually but normal express server will work just fine with next
Sawaid
SawaidOP16mo ago
But that means you have to create new backend. no?
aditya
aditya16mo ago
yeah you have to
Sawaid
SawaidOP16mo ago
Is serverless and edge the same? Got it.
aditya
aditya16mo ago
next gives us the api endpoints so you dont have to create a server
Sawaid
SawaidOP16mo ago
This JS space goes way above my head. xD
aditya
aditya16mo ago
it goes over mine too xD
Sawaid
SawaidOP16mo ago
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#.
aditya
aditya16mo ago
creating stuff is super fast as everything is setup v nicely just have to understand some trpc way of writing apis and prisma schema
Sawaid
SawaidOP16mo ago
And how does prisma performs? Is it fast? I have heard some bad stuff.
aditya
aditya16mo ago
for me prisma is okay for large scale apps idk you can use drizzle
steakfisher
steakfisher16mo ago
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
Sawaid
SawaidOP16mo ago
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?
barry
barry16mo ago
what no you dont
Sawaid
SawaidOP16mo ago
Btw, what is your position with setting up TRPC or any API calls within React Query?
barry
barry16mo ago
wdym
steakfisher
steakfisher16mo ago
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)
barry
barry16mo ago
im sure someone can help you out a lot of people have copy pasta scripts to ssh in and deploy
Sawaid
SawaidOP16mo ago
I mean using React Query for state management. I don't know what approach does t3-app uses.
barry
barry16mo ago
The tRPC client is a react query implementation
Sawaid
SawaidOP16mo ago
I don't get it. Does it use the TanStack React Query?
barry
barry16mo ago
Yes
Sawaid
SawaidOP16mo ago
Will I be able to implement optimistic UI updates with it?
barry
barry16mo ago
api.router.route.useQuery() api.router.otherRoute.useMutation() Just very clear what route you’re hitting Yup
Sawaid
SawaidOP16mo ago
Can you give me a rough example?
barry
barry16mo ago
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
Sawaid
SawaidOP16mo ago
I don't understand a thing but let me do my research. xD
Sawaid
SawaidOP16mo ago
But where is the optimistic UI update code? I don't see it here.
barry
barry16mo ago
It works the same as react query so there’s an example by react query on their docs
0sir1s
0sir1s16mo ago
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
0sir1s
0sir1s16mo ago
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.
0sir1s
0sir1s16mo ago
Or maybe this one
0sir1s
0sir1s16mo ago
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.
0sir1s
0sir1s16mo ago
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)
m$
m$16mo ago
welcome to the real world is all im saying
Sawaid
SawaidOP16mo ago
🥲
barry
barry16mo ago
can also host on simpler solutions? fly.io railway render
scopeguy
scopeguy16mo ago
Caddy will automatically manage TLS certificates with minimal config. Written in Go btw golang
Want results from more Discord servers?
Add your server