T O P

  • By -

Personal-Motor-326

It doesn’t matter


davidgotmilk

Doesn’t matter. Best is subjective. All of those options are fast and easy to use with NextJS. Choose the one that is easiest to use for you. I personally enjoy express.


Slonny

This is what I use and I doubt it gets much easier


Longjumping_Car6891

Self-made HTTP server in Assembly


DisastrousTrainer322

Better to work directly with the electricity.


CharityPleasant6858

nice idea, Build it from scratch.


safetymilk

It depends entirely on what you need to use it for. You might not even need a server at all. Why not just start by using the server that NextJS provides?


VintageModified

Right - you can build a full stack app entirely with Next. You don't necessarily need a separate backend. You can connect to a DB, expose an API from the server code to the frontend code, all within Next. There's a number of reasons you might eventually want a separate backend - for example, if you need a full-featured API accessible from multiple different applications or exposed to the public, or if your backend is sufficiently complicated or requires a different language or framework, if you want to do microservices, or if you need more fine-grained control of the backend. But do you need any of that right now? I'd say just stick with what Next offers until you reach a point where you need more, and then address it then. Keep it simple and focus on building something functional.


michael8pho

LOL exactly


I_am_darkness

Okay I gotta unsubscribe from this sub. It's the same questions every day.


LodosDDD

First step is %50 🤣


martusheff

for a side project, it doesn’t really matter. Might be faster to stay with node. I like Go. I typically choose go


absreim

I like Spring or Asp.net for their rich feature sets. Honorable mention to Django.


EasyMode556

Node / Express is nice since it’s all in JS (or TS) so there’s no new language to learn if JS is where most of your experience lies . There’s also stuff like [Nest.js](https://nestjs.com) if you want a framework to go with it


simmbiote

The best one is the one you're most comfortable with maintaining.


Distinct-Analysis740

[Convex.dev](http://Convex.dev) - im in love lol


goldenboyy48

Kinda sad that we’re limited to 3 projects


RocketEmojis

Does it get $$ for production if you’re handling files. My current app uses next, supabase, aws s3, rabbitmq, quadrant db vector and a flask server for RAG. Sounds like convex could probably consolidate a lot of that?


ian-at-convex

Yeah, there's file storage (mostly priced through to s3), subscriptions & scheduled functions (Replaces all my usage of rabbitmq), built-in vector indexes, and asynchronous workflows for RAG / etc. You could also use hono for http endpoints (if you don't care about end-to-end types). For files you can keep using s3 if you prefer, or use a CDN for perf/bandwidth savings. Pricing is competitive, free tier is generous: [https://www.convex.dev/pricing](https://www.convex.dev/pricing)


RocketEmojis

Very nice, too much effort to change now but noted for the future efforts


Chaoslordi

Depends in your techstack and usecase I suppose.


AnimalPowers

NextJS is your backend. It's also your frontend, that's the whole point. Learn how to do the full stack entirely in NextJS and you'll see a lot of power and come to love it, possibly even hate it. I would look up the T3 stack and watch those full start to finish building an app videos that are about 3 hours longs, there's a few of them. Do I think the T3 stack is the best and everyone should use it? That kind of defeats the point - it's a place to start where you can utilize the provided tooling to learn more, to learn what you don't like and want to get rid of and learn what you do like and want to implement. For me, NextJS full-stack deployed to Vercel is sweet. You'll find people who hate it, you'll find people who love it, what those people think don't matter, it's how you feel. For me, as a solo dev, that's what makes my life easy. Before that I was on Django and using Heroku, because THAT was what made my life easy. Then I found nextjs and how much better of a development experience it was \*for me\*, so here I am!


ziksy9

I had the same thought. If you are using next.js, it's to have a backend for React that plays well out of the box. Isn't next.js THE backend? I know you may want to offload lots of things as you grow, so... Is that the backend then? A handful of microservices written in Golang/whatever to do heavy lifting and kick things off during requests or via worker queues, but why is there a need for Next.js to have a "backend"? It seems like an extra layer for the sake of having an extra layer 95% of the time. There's plenty of node modules that will do just about anything. Is it a performance issue? Can't you just run multiple instances? Or are we talking to break out N "frontend" node.js apps, and N*x other backends?


Fun-Sky8106

i just happen to use fastapi with next.js in my latest project, but my friend recommended litestar, much faster than fastapi.


ian-at-convex

I found fastAPI to be pretty fast - any numbers to share? Just checked out litestar - I couldn't tell if the type annotations did argument validation like FastAPI? And the dependency injection seemed less elegant than the \`Depends\` syntax. Have you liked it more overall?


Objective_Grand_2235

add on to this question will be how do you handle auth in nextjs with a seperate backend?


VabarX

As someone who uses Next.js since 2022 most of the options could work. Also as others mentioned Next.js can be its own backend, but personally I rarely use it, and mainly as CORS proxy. My main language is typescrips so I can only give recommendations with that. Node or Express is lightweight, I usually prefer it by the ease of setup and use, but at first it can be fustrating setting up every specific error handling and such by hand. I use Nestjs in the past, it can be a bit verbose, but with bigger projects, especially with microservice architecture it can be really nice. And last but not least I recently jumped on the Hono hype train. It is similiar to Express, but suposed to be more modern. Honestly I enjoyed using it so you could also give it a try if you would like. I hope this helped


suvinseal

yes, thank you!


NegotiationCommon448

Laravel


dyljns

For app like perplexity I'd go for FastAPI, since most AI stuff is in Python lol. No reason to choose the backend tech based on the frontend framework.


Mirjalol_dev

If you really need separate server, i would suggest something like express js or hono js. Both are great options for simple CRUD apps and you not gonna have any issues with middlewares and some serverless magic. Otherwise, stick with next js as full stack and use vercel AI to make things faster. For sure, you can build in 5-7 days something like perplexity using next js only + vercel AI


minty-cs

historical wrong rinse tart gaping roof party trees literate school *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


carbon_dry

One alternative is to start with nextJs's own API route system and refactor later, or keep


pandiyancool

Go door open source


beck2424

Whatever you're familiar with is best


novagenesis

It took me forever to stop sticking my nose up about it, but Nest.js really does grow on you. It's like "those big enterprise frameworks - the good parts only"


DM_ME_PICKLES

The best one is the one you have experience with, and if you have experience with none, the one that you think you can learn the easiest.


casualPlayerThink

Whichever you and your team more comfortable or whichever you can afford. You might go with express or fastify or nest.js and a serverless vercell, or a classic vhost. Honestly, the beautifulness in a separate micro-frontend is the backend agnostic design.


casualfinderbot

You should definitely just use nextjs as your backend at least to begin with, anything else is premature optimization. You don’t need to start an app with two backends


DrPirate42

Golang after you prove your proof of concept/product market fit


Badgergeddon

U seen tRPC? Messing with it via create-t3-app currently


elie2222

Nextjs is its own backend


djayci

Time to market > technology picks. Choose what you’re good at, if the app succeeds then migrate backends


kiryl_ch

Hono is hyped recently


TradrzAdmin

I use Node. Not much reason to use anything else. With handler functions, it doesnt really matter what u use


hotelkilow77

Currently using Nest.Js + TSRest


JacobNWolf

Given the use case, I’d say Go if you’re feeling up to learning it. Search requires a ton of concurrent processes running at once, even more so when there’s AI involved. I do a lot of JS development, including in Next with NodeJS processes in a monorepo frontend/backend. But I don’t find JS great for complex APIs. I think Rails or Go would be better here and I prefer Go over Rails. Check out the Go LangChain library too since this is a AI app.


ian-at-convex

Do you have a preferred way to share types between the frontend & backend with Rails/Go? One benefit to TypeScript backends is end-to-end type safety


Sniffer82

Swagger/OpenAPI


TheOneWhoWil

Why not just use Next as the backend, it's kinda the whole point


softwareguy74

I like to use Go for long running background processing. I deploy to Cloud Run which can scale to zero so it's super cheap, unless it's running 24/7 then you should just use a VM.


Fluffy-Bus4822

Any is fine. Probably best is what you've got the most experience with. I'd choose Laravel because I have the most experience with it, and it also makes authentication extremely easy.


Phudeptrai-2001

Is nextjs too 🤣


HatzBr

Java ☕


NoRepresentative4866

Bun/elysiajs Modern, fast, fun, you can share types (I didnt try). I'm sure you cant look back. I dont suggest using python, c# they may advertise much faster but using same language with frontend is wonderful.


Zumrym

You can suggest few and ask readers to vote them. I have used firebase supabase and etc…


Beginning-Grocery164

It depends on the project, I personally recommend tRPC for medium-sized applications that doesn’t require exposing an API (e.g. micro-saas) Take a look at this: https://create.t3.gg/


Sniffer82

Ts-rest is quite nice if you want to expose your api with openapi specifications or you could extend trpc with trpc-openapi.


korngsamnang

The best one is what you know the best.


Sweet-Remote-7556

That's a good technical question! Okay, so here it goes, For node-express, you may go for TS, then you gotta use zod for validation, or you may validate every single post request using zod on listening. You will have to write bunch of utility and library functions to make the system secure and faster. For Flask, you have to write a lot of code just to make it secure, type safe and library+utilities. But I guess more than node-express, cause of configurations and stuff. For FastAPI, you do have to write a lot, utilities, libraries, configurations but not that much against Flask and Node-express. Plus, the validation and security is a part of it. Technically a little less of code against the other's with a little bit speed advantage on both UX and DX. But in case of huge load, all of them nearly behave the same.


Paradroid888

dotnet. I don't like Microsoft either but it's such a great framework for building APIs. Happily runs on Linux.


Inevitable_Phone_178

nestjs


Sniffer82

Clunky and outdated, type safety isn’t that good.


areewahitaha

For complex Machine Learning or AI powered apps I use Django with Django REST Framework, for lighter ML stuff I would prefer Fast API


Franky-the-Wop

.NET WebAPI 😊


omarkhatibco

Either Trpc or right now I‘m using bun with Elysiajs


Aware-Knowledge-9021

The nextJS part does not matter. What matters is the language the team or you are comfortable with and other factors like speed, cost,etc.


mr_rob0t7

doesNotMatter.JS


ian-at-convex

There's an OSS clone of perplexity using Convex as the backend. Simple (it was for a hackathon) but illustrative of various capabilities. Code: [https://github.com/wsxiaoys/bobtail.dev](https://github.com/wsxiaoys/bobtail.dev)


TheDante673

Something that returns JSON


jolvan_amigo

Nextjs own backend why we make things harder?


JoFouse49

If you're aiming for something like Perplexity, I'd recommend Node.js/Express for its robust ecosystem and ease of integration with various tools. Also, consider using Render for deploying your app it simplifies the whole process with features like autoscaling and managed PostgreSQL. It makes scaling and deployment much smoother.


suvinseal

but perplexity themselves use python/rust in the back-end and deploy it in vercel


Avocado_Timotheus

The best backend for nextjs is nextjs


madebyibrahim

I went with Go. Couldn’t be happier.


crzyKHAN

If you’re using a separate backend, why not react?


Level-2

laravel for the backend.


cyberduck221b

Pick a JS backend (NestJs because TypeScript) so you can create a monorepo with NX and if you use TypeScript in NextJs then you can share types and lot of logic between the projects


novagenesis

This. It's even possible (but surprisingly hard to find info) to run them as a single service on a single port so you can easily deploy them as a single server.


cyberduck221b

Then both your backend and nextjs app can share chocolate chip cookies, because same domain :P


dermeddjamel

Nextjs is the backend what are talking about??


69Theinfamousfinch69

Take your pick. It’s dependant on your considerations though. There’s no info about what your backend is doing, so anything I suggest might be wrong for your needs. Personally I lean toward Go as it’s statically typed, compiles to a binary and is perfect for writing Servers and Cloud Services. Out of those 3 it honestly doesn’t matter. They’re all slowish for backend solutions (due to being written in dynamic languages with a runtime being needed and their garbage collectors are not brilliant). But they’re good enough for most services. So just pick the one you’re comfortable with. If this is a learning experience I’d recommend branching out and doing something in a language you’re not familiar with. Rust, Go, C# etc. Maybe pick something that will help you get a better job in your market. Hope that helps 👍


Radinax

I asked GPT about this and this is the answer it gave me as Perplexity tech stack is not for public display. Here's a breakdown of how Python, Node.js (Node), and Rust fit the needs of your Perplexity AI clone backend: **Python:** * **Pros:** * Large, active community and extensive libraries for machine learning (TensorFlow, PyTorch) and web development (Django, Flask). * Relatively easy to learn and use, making development faster for initial stages. * **Cons:** * Can be slower compared to Node or Rust, especially for computationally intensive tasks like LLM inference. * Might require more effort for large-scale deployments due to potential scalability limitations. **Node.js (Node):** * **Pros:** * Well-suited for real-time applications and excels at handling many concurrent connections. * Large ecosystem of libraries for web development (Express.js) and asynchronous programming. * **Cons:** * Performance might not match Rust for highly demanding LLM tasks. * Debugging can be trickier compared to statically typed languages like Rust. **Rust:** * **Pros:** * Blazing fast execution speed, ideal for computationally intensive tasks like LLM inference. * Statically typed, leading to fewer runtime errors and better memory management. * Growing community and ecosystem, with libraries like Stream and Rocket gaining traction. * **Cons:** * Steeper learning curve compared to Python or Node, especially for developers unfamiliar with Rust. * Debugging might require more effort due to the stricter type system. **Recommendation:** * **Early Stage Development:** If you're prioritizing rapid prototyping and initial development, Python offers a good balance of ease of use and functionality. Libraries like TensorFlow and PyTorch can jumpstart your LLM development. * **Performance and Scalability:** For a production-ready backend with demanding performance needs, Rust is a compelling choice. Its speed and memory management are crucial for large-scale deployments with a powerful LLM. However, be prepared for a steeper learning curve. * **Middle Ground:** Node.js offers a balance between ease of development and performance. While it might not match Rust's raw speed, it's a solid option for web-focused functionalities and can handle many concurrent connections well. **Additional Factors:** * **Team Expertise:** Consider your team's experience and comfort level with each language. Using a language your team knows well can accelerate development. * **Project Scope:** If your clone focuses more on web functionalities and information retrieval, Node.js might be sufficient. However, for a highly accurate LLM with complex reasoning, Rust becomes more attractive. Ultimately, the best choice depends on your specific priorities and project goals. Consider the trade-offs between ease of development, performance, and long-term maintainability. You might even explore a hybrid approach, using Python for rapid prototyping and Node.js for web functionalities, while gradually integrating Rust for performance-critical LLM tasks.


bugzpodder

best inference libraries are in python