Run local development server
pnpm install
pnpm dev
We are using prisma as our ORM and zod for schema validation. See prisma/schema.prisma
for all the defined models. After updating the file, run:
pnpm prisma generate --no-engine
The above will update prisma client and generate new zod util schema using zod-prisma-types
. And then run:
pnpm db:push
The above will push the new schema to postgres database. At this point we aren't doing any database migration. We will get to that when our product come to the point of a more stable state.
There are server-side and client-side localization applied in this application. For server-side component, you would import the useTranslation
method from @/app/i18n
and get the translation helper method:
const { t } = await useTranslation(lang)
Dictionary file lives under app/i18n/locales/[lang]/translation.json
for server-side localization.
For client-side component you import the useTranslation
method from react-i18next
instead and get the translation helper method:
const { t } = useTranslation()
Not client-side component you don't need to provide lang
from pathname and use it as client side hook without the async await.
Dictionary file lives under app/i18n/resources/[lang].ts
for client-side localization.