#how to structure fullstack nextjs project
59 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
for reference i started this project quite a while ago but i made it in react frontend + nestjs backend https://github.com/DownDev/DiscordBotDashboard
now i wanted to come back to it but rewrite it to next
there are tools like: https://github.com/t3-oss/create-t3-app that can make a good template (but it can be overwhelming because of all things it creates)
let me check it out
i can't say what the best one is, but this does seem decent
yeah its quite a lot of boilerplate
hey i want to do similar thing but dont exactly know how. you run discord bot with python or how does it work?
Yeah my bot is written in python
so you have frontend i nreact and then make api calls to discord bot? is that right?
and where is the bot runing?
tbh i would say do it both in js so you can share code...
Nope my bot doesnt have any api its just a python code interacting with discord api
so... what will the "discord bot dashboard" do?
Now i want to create a website for it and somehow connect them so they use the same database
You will be able to set some configurations for your guild
Etc
yeah, and if you use TS, you can share types and such
if JS, you can still have helper functions for both
but imo doing the same language I would say, provides better dx
but the python code is runing where? in server, docker or on the same thing as frontend?
its other project running in docker
and you are able to interact with it from frontend?
I thought about making the dashboard project also a Docker image and then implementing it in bot as dependency
?
sorry
i want to explain what i want to do and how it might be similar to your project
i would like to have next app dashboard like you, and run some long runing script or bot, same as you
i would like to have python bot runing and checking some data from db, but i want to be able to start and stop and perhaps edit from my next.js frontend
i am not sure if that is possible to do in serverles, like vercel
bc now i can run python in docker no problem
hm i dont know how to approach it too
if you are doing normal bot, it uses websocketss, so that won't work
if you use http interactions, it would work, but i doubt you would use them (as you loose access to all events but interactions)
and you cant even run python on vercel via child-process right?
lets say i write a simple python script that runs forever printing "hello world" to terminal and run it in docker
how can i access that "hello world" text in my next.js dashboard?
they only last 10sec
so what is the alternative?
make it in javascript and run at the same time as next.js?
i would say use webhook but i know nothin
use a vps...
if you don't use serverless this works i believe
aha okay great
and the webhook thing? i also know nothing, so is that good or bad?
websoket just means that it is a always open connection - discord can sent you updates anytime
i meant websocket 💀
how would i do that?
i asumed you meant that
just noticed i wrote webhook
you would set up a websocket connection between those 2
and send messages between
if doing that, make sure neither is serverless
but it is prob a good idea if they are running in a normal server
okay nice
what do you mean? will it work on serverless?
no...
can you help me in process of rewriting this to next?
@scenic spade ?