Next.js Discord

Discord Forum

Regarding Code structure

Answered
Gharial posted this in #help-forum
Open in Discord
GharialOP
Hey guys, I have a dashboard website that starts with a login page. After logging in, it shows 5-6 menu items.

I’ve also made a marketing website for this product, which includes a Homepage, Demo page, and Technology page.

I want both the dashboard and marketing site to be under the same domain.
How would you organize the code?
Answered by B33fb0n3
create a pages folder and inside it, create two other folders (for each project). Then the pages itself are orginized and the "webssites "as well
View full answer

39 Replies

GharialOP
ohh
my bad
i posted this question i nnextjs channel
i am using simple react
😅
Arboreal ant
you could just create seprate websites and point each one to a new subdomain
GharialOP
although, how would u guys organize it?
@Arboreal ant you could just create seprate websites and point each one to a new subdomain
GharialOP
i just dont want to use a subdomain
@Gharial i am using simple react
oh you can do the same, but just inside your src/ dir
Arboreal ant
^
GharialOP
so..i was thining to have to folders:
- marketing
- dashboard
and inside both of them, i will have:
components folder
pages folder
is this ok?
@Gharial so..i was thining to have to folders: - marketing - dashboard
create a pages folder and inside it, create two other folders (for each project). Then the pages itself are orginized and the "webssites "as well
Answer
yea
GharialOP
i am facing issue while using it
my pages dont load sometimes
is your initial issue solved?
@B33fb0n3 is your initial issue solved?
GharialOP
yes sir
make sure to create another thread, as this thread is already resolved 👍
GharialOP
coool
happy to help
@Gharial oh and make sure you tell somewhere in your thread, that it's react only
@B33fb0n3 <@892052908428902441> oh and make sure you tell somewhere in your thread, that it's react only
GharialOP
so i can ask react doubts in this channel?
no need the doubts should be related to nextjs only?
@Gharial so i can ask react doubts in this channel?
yea, you can ask everything inside #help-forum
@B33fb0n3 yea, you can ask everything inside <#1007476603422527558>
GharialOP
Hello, I am facing a lot of issue in organizing my routing 😦
Can i share it here? as its related to the original question.
Or should I start a new forum?
@Gharial this thread is already solved. You want to open another thread and if needed you can share a link in the new thread to a specific message here. Make sure to also describe your new issue in your new thread
@Gharial yes, i have made a new thread: https://discord.com/channels/752553802359505017/1334266471446085662
I won't read through that book. Others might not do that either. You should be much shorter
I tired to explain the exact problem
@Gharial how can i explain it in short 😦
idk, I havent read through it, as it was waaay to long
@B33fb0n3 idk, I havent read through it, as it was waaay to long
GharialOP
How is it now?
I hope now it makes more sense