luochuanyuewu/nextus

Database boilerplate and errors on first run

Malaga82 opened this issue ยท 7 comments

Hello,
can you provide a pre-filled basic database like agencyos did?
I imported your schema to sqlite db without issue, followed your basic hints for creating home, main and footer, but there are not detailed infos about what to fill in Globals.

Is that ok to have only "en" language or i need to insert also "zh"?

I just filled the * fields in Globals but i have these errors on home:

image

image

and a console log with:

โš  metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
Warning: Each child in a list should have a unique "key" prop.

Check the top-level render call using <div>. See https://reactjs.org/link/warning-keys for more information.
    at HeroBlock (webpack-internal:///(rsc)/./components/blocks/HeroBlock.tsx:20:22)

Maybe i miss something.
Thanks

The main issue you encountered is that in the backend (Directus), many fields are optional and can be left blank. However, the frontend is built with TypeScript, and when rendering, it throws a null error for those empty fields. Since i haven't implemented much error handling on the frontend, the suggested solution is "if you need to fill in content, try to fill in all the relevant fields." In future development, i plan to make many fields in the backend mandatory during creation.

By the way, only en language is ok. just make sure NEXT_PUBLIC_LOCALE_DEFAULT is 'en'.
Also, Be aware of this project is currently under heavy development(see other branch). things may break a lot.

pre-filled basic database is on plan.

Thanks for the answer, i'll try to replicate as i can your model, BTW i ask you what are the goals to have project_setting and blog_setting in Globals, what are the scopes of having that?

BTW sometimes i have this error

โš  metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
Check the top-level render call using

. See https://reactjs.org/link/warning-keys for more information.
at HeroBlock (webpack-internal:///(rsc)/./components/blocks/HeroBlock.tsx:20:22)

Is it related to missing values on Globals or social empty?

pre-filled basic database is on plan.

maybe you can also provide something like "create in vercel" or "deploy on netlify" buttons.

Thanks for the answer, i'll try to replicate as i can your model, BTW i ask you what are the goals to have project_setting and blog_setting in Globals, what are the scopes of having that?

BTW sometimes i have this error

โš  metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
Check the top-level render call using . See https://reactjs.org/link/warning-keys for more information.
at HeroBlock (webpack-internal:///(rsc)/./components/blocks/HeroBlock.tsx:20:22)

Is it related to missing values on Globals or social empty?

The warning you can ignore for now.
Then, you can go to https://directusapi.com/admin/login to see my content setup.
account: guest@yuewu.dev
pass: yuewu.dev

project_setting controls the heading content of "Projects page",like this page
blog_setting allows you set featured post, posts per page setting and some other texts in the front-end, like this page

Thanks for the answer, i'll try to replicate as i can your model, BTW i ask you what are the goals to have project_setting and blog_setting in Globals, what are the scopes of having that?
BTW sometimes i have this error

โš  metadata.metadataBase is not set for resolving social open graph or twitter images, using "http://localhost:3000". See https://nextjs.org/docs/app/api-reference/functions/generate-metadata#metadatabase
Check the top-level render call using . See https://reactjs.org/link/warning-keys for more information.
at HeroBlock (webpack-internal:///(rsc)/./components/blocks/HeroBlock.tsx:20:22)

Is it related to missing values on Globals or social empty?

The warning you can ignore for now. Then, you can go to https://directusapi.com/admin/login to see my content setup. account: guest@yuewu.dev pass: yuewu.dev

project_setting controls the heading content of "Projects page",like this page blog_setting allows you set featured post, posts per page setting and some other texts in the front-end, like this page

Thanks, i'll compare your backend with mine on self-hosted setup.
Appreciate your effort.