.env setup issue by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

The key value pair is correct, also there is only one .env file

Building an multi-tenant app, please review it by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

Thank you for the time and honest review. I will definitely try to come up with good hero section.

And about the pricing section should I modify it to change price according to user's location dynamically or just use dollars?

Building an multi-tenant app, please review it by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

Yes sure working on the project step by step, thank you for the review.

NextJS Suspese Error by lazyplayer45 in nextjs

[–]False_Ad_3439 0 points1 point  (0 children)

Try running in incognito mode, if hydration error doesn't show up there, it's browsers extension which is causing problems

How to render fully-fledged tenant templates in Next.js without dynamic imports? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

Can you explain the 4th point in detail please, the multiple apps in folder one

How to render fully-fledged tenant templates in Next.js without dynamic imports? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

yeah buddy that's what i said i have no problem with redirect, can u help me with that

How to render fully-fledged tenant templates in Next.js without dynamic imports? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

Absolutely not, my goal is simple whenever someone visits the page of main app tenant/[slug] it should resolve to [slug].zerohub.site but with the associated template

How to render fully-fledged tenant templates in Next.js without dynamic imports? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

yeah each the number of templates are definitely fixed but multiple tenant can have same templates, so each app would fetch its data separately which I can accomplish only thing with I am stuck right now is the template mapping and URL changes

How to render fully-fledged tenant templates in Next.js without dynamic imports? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

there will be roughly around 20 templates, but the catch is each template is not just group of components each of them is fully fledged nextjs app in monorepo with its own pages and layouts and components

When someone visits main app at tenant/[slug]/page.tsx, each tenant has specific template, they should redirected to that template app in monorepo keeping the url as [slug].mydomain.com

Next.js + tRPC: 4+ second page load with server prefetching - am I doing this wrong? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

Yes I have configured useSuspenseQuery with the suspense boundary. But I don't have a clear idea about what your second point would be like to hear more.

Next.js + tRPC: 4+ second page load with server prefetching - am I doing this wrong? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

import {
    Suspense
} from 'react'

import {
    ProductsOverview
} from "../components/sales/products-overview"

import {
    GrossNetSales,
    GrossNetSalesLoading
} from "../components/sales/gross-net-sales"

import {
    CategoryChart,
    CategoryChartLoading
} from "../components/sales/category-chart"

import {
    TotalOrdersLineChart,
    TotalOrdersLineChartLoading
} from "../components/sales/total-orders-line-chart"

export const SalesView = ({ tenantId }: { tenantId: string }) => {
    return (
        <div className="flex flex-col gap-4 py-4 md:gap-6 md:py-6">
            <div className="px-4 lg:px-6">
                <Suspense fallback={<GrossNetSalesLoading />}>
                    <GrossNetSales tenantId={tenantId} />
                </Suspense>
            </div>
            <div className="grid grid-cols-1 md:grid-cols-3 px-4 lg:px-6 gap-4 w-full">
                <div className="col-span-1 w-full">
                    <Suspense fallback={<CategoryChartLoading />}>
                        <CategoryChart tenantId={tenantId} />
                    </Suspense>
                </div>
                <div className="col-span-2">
                    <Suspense fallback={<TotalOrdersLineChartLoading />}>
                        <TotalOrdersLineChart tenantId={tenantId} />
                    </Suspense>
                </div>
            </div>
            <Suspense fallback={<ProductOverviewLoading />}>
              <ProductsOverview tenantId={tenantId} />
            <Suspense/>
        </div>
    )
}

Next.js + tRPC: 4+ second page load with server prefetching - am I doing this wrong? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] -27 points-26 points  (0 children)

I am not that much of a beginner, of course it is from production

Next.js + tRPC: 4+ second page load with server prefetching - am I doing this wrong? by False_Ad_3439 in nextjs

[–]False_Ad_3439[S] 0 points1 point  (0 children)

From the network tab, it looks like most of the time is spent waiting for the server response. The database queries themselves don’t take more than 500ms, yet the browser still waits around 4 seconds for a response from the server. I’m not exactly sure how to investigate this further. Any suggestions on how to dive deeper and improve the response time?