Next JS with Elysia JS ( Bun ) + Prisma
Answered
Scaly-naped Pigeon posted this in #help-forum
Scaly-naped PigeonOP
I want to know the steps to make Elysia JS works with prisma & next js instead of normal API node routes , I want to use bun because its faster than node js , I really want to know the best way where to install Elysia should I make a separate backend or install elysia js inside next js , and how can I make typesafety with trpc to make it work as expected.
or is there a stack that uses next js with elysia + prisma ?
Thanks in advance
or is there a stack that uses next js with elysia + prisma ?
Thanks in advance
Answered by @ts-ignore
You can't use Elysia with next. You need to use either a custom server or create a new backend using elysia
If you need typesafety, you can use either trpc or openapi generator
If you need typesafety, you can use either trpc or openapi generator
16 Replies
@Scaly-naped Pigeon I want to know the steps to make Elysia JS works with prisma & next js instead of normal API node routes , I want to use bun because its faster than node js , I really want to know the best way where to install Elysia should I make a separate backend or install elysia js inside next js , and how can I make typesafety with trpc to make it work as expected.
or is there a stack that uses next js with elysia + prisma ?
Thanks in advance
You can't use Elysia with next. You need to use either a custom server or create a new backend using elysia
If you need typesafety, you can use either trpc or openapi generator
If you need typesafety, you can use either trpc or openapi generator
Answer
but for openapi, you first need to add openapi stuff in your api and make your backend generate a json/yaml schema
then you can use this
@@ts-ignore You can't use Elysia with next. You need to use either a custom server or create a new backend using elysia
If you need typesafety, you can use either trpc or openapi generator
Scaly-naped PigeonOP
I saw a way I can add an api folder with a ...slug folder to make it work with elysia but i am not sure if this is the right way or is there a stack that uses elysia as a backend instead of node
@Scaly-naped Pigeon I saw a way I can add an api folder with a ...slug folder to make it work with elysia but i am not sure if this is the right way or is there a stack that uses elysia as a backend instead of node
it will still use nextjs's api router and hence you will face similar limitations and still you can't mismatch runtimes
@@ts-ignore it will still use nextjs's api router and hence you will face similar limitations and still you can't mismatch runtimes
Scaly-naped PigeonOP
its faster than normal api router but not sure if there is more bugs or not because I have alot of issues not sure if its from me or elysia js itself
@Scaly-naped Pigeon its faster than normal api router but not sure if there is more bugs or not because I have alot of issues not sure if its from me or elysia js itself
it would be better to ask this question in elysia's support server(if any)
Scaly-naped PigeonOP
I did but they didn't respond , though someone could try this and help me out 😁
will try to make a post again on their discord
@Scaly-naped Pigeon its faster than normal api router but not sure if there is more bugs or not because I have alot of issues not sure if its from me or elysia js itself
You can’t use elysia in nextjs as yi mentioned, as bun doesn’t support nextjs and elysia only supports bun. You can try hono in nextjs but it won’t help with performance since the perf bottleneck in the nextjs server is still there. Using another backend framework with next will only help with developer experience at best.
You should deploy your elysia/hono backend separately if performance is such a critical issue for you.
Elysia bugs should be reported in Elysia issue tracker on GitHub.
You should deploy your elysia/hono backend separately if performance is such a critical issue for you.
Elysia bugs should be reported in Elysia issue tracker on GitHub.
@joulev You can’t use elysia in nextjs as yi mentioned, as bun doesn’t support nextjs and elysia only supports bun. You can try hono in nextjs but it won’t help with performance since the perf bottleneck in the nextjs server is still there. Using another backend framework with next will only help with developer experience at best.
You should deploy your elysia/hono backend separately if performance is such a critical issue for you.
Elysia bugs should be reported in Elysia issue tracker on GitHub.
Scaly-naped PigeonOP
oh I see , thank you so much for this response but I have another question if I used elysia inside api/[[...slugs]]/router.ts and opened the elysia server from there , its working fine but my question here that next js will still use node js and not speed or help with the performance or I have to use elysia as a separate backend to make the use of it ?
nextjs will still use node for those api routes
Scaly-naped PigeonOP
I see , will work with elysia with a separate backend then , thought it would be best to merge elysia with next to make it as a single full stack app
really appreciate it ♥