#how to structure fullstack nextjs project

59 messages · Page 1 of 1 (latest)

steady python
#

so im trying to create a discord bot dashboard in nextjs which would have an api controlling discord oauth2 and a nice react app displaying servers user is in etc what i dont understand what folders i should use to achieve that i have seen pages folder or app folder and im kinda lost

modest rapidsBOT
#

🔎 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)

steady python
scenic spade
steady python
#

let me check it out

scenic spade
#

i can't say what the best one is, but this does seem decent

steady python
#

yeah its quite a lot of boilerplate

gentle marten
steady python
gentle marten
#

and where is the bot runing?

scenic spade
#

tbh i would say do it both in js so you can share code...

steady python
#

Nope my bot doesnt have any api its just a python code interacting with discord api

scenic spade
#

so... what will the "discord bot dashboard" do?

steady python
#

Now i want to create a website for it and somehow connect them so they use the same database

steady python
#

Etc

scenic spade
#

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

gentle marten
steady python
#

its other project running in docker

gentle marten
#

and you are able to interact with it from frontend?

steady python
#

I thought about making the dashboard project also a Docker image and then implementing it in bot as dependency

gentle marten
#

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

steady python
#

hm i dont know how to approach it too

scenic spade
#

if you use http interactions, it would work, but i doubt you would use them (as you loose access to all events but interactions)

gentle marten
#

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?

scenic spade
#

they only last 10sec

gentle marten
#

so what is the alternative?

#

make it in javascript and run at the same time as next.js?

steady python
#

i would say use webhook but i know nothin

scenic spade
#

use a vps...

scenic spade
gentle marten
#

aha okay great

#

and the webhook thing? i also know nothing, so is that good or bad?

scenic spade
#

websoket just means that it is a always open connection - discord can sent you updates anytime

steady python
gentle marten
scenic spade
#

i asumed you meant that

steady python
#

just noticed i wrote webhook

steady python
#

and send messages between

scenic spade
#

if doing that, make sure neither is serverless

#

but it is prob a good idea if they are running in a normal server

gentle marten
#

okay nice

gentle marten
scenic spade
steady python
steady python
#

@scenic spade ?