diff --git a/.env.example b/.env.example index f01d9ca6..9f4b06d1 100644 --- a/.env.example +++ b/.env.example @@ -1,221 +1,20 @@ -# || 🔥 [Important note]: Please note that currently, v1.3.0-canary.7 requires specifying Clerk, as its API has changed. -# || We are working on making Clerk optional again. However, all other environment variables are optional. -# || If this statement is incorrect, meaning something is broken somewhere, please let us know. -# || https://github.com/blefnk/relivator-nextjs-template +# PLEASE SET ALL THESE VARIABLES +# https://docs.reliverse.org/env -# ==================================================== -# GENERAL -# ==================================================== - -# || You can try our brand-new linting script: `pnpm lint:env` or `pnpm appts:env`. -# || These commands will check the correctness of your .env and .env.example files. - -# Specify the website domain in production NEXT_PUBLIC_APP_URL="http://localhost:3000" - -# ==================================================== -# DATABASE -# ==================================================== - -# || When the following connection string is set, you can run "pnpm db:push" to create/update the database tables. -# || If you've just created the database, please give your provider a moment for the database to be fully created. - -# Type here any word, e.g. your project name, you want to prepend to your database table names -NEXT_PUBLIC_DATABASE_PREFIX="relivator" - -# Database (https://neon.tech) (it's recommended to check 'Pooled connection' to get the production URL) DATABASE_URL="" -# || DATABASE URL EXAMPLES (pg: try 'postgres://' if 'postgresql://' does not work) -# || --------------------------------------------------------------- -# || - Postgres ➞ Neon (recommended for most users) ➞ postgresql://database_owner:password@hostname/database?sslmode=require -# || - Postgres ➞ Private (not tested yet with latest Relivator version) ➞ postgresql://username:password@127.0.0.1:5432/db -# || - Postgres ➞ Railway (not tested yet with latest Relivator version) ➞ postgresql://root:password@hostname:36906/railway -# || --------------------------------------------------------------- - -# || We are using Drizzle and Neon as default database provider -# || https://orm.drizzle.team/learn/tutorials/drizzle-with-neon - -# || NOTE: NEXT_PUBLIC_DB_PROVIDER was removed in Relivator 1.2.6 -# || To switch the provider from Neon, modify drizzle.config.ts -# || To use MySQL or LibSQL providers, update files inside src/db. -# || Automatic switcher coming in Relivator 1.3.x version. - -# ==================================================== -# AUTHENTICATION -# ==================================================== - -# || Fake session data will be assigned to your users -# || if DATABASE_URL or Clerk api keys are not set. - -# Required for both "authjs" and "clerk" authProviders. -# https://authjs.dev/guides/environment-variables -# Recommended (bash): openssl rand -base64 33 -# Or try this: pnpm dlx randomstring length=44 -AUTH_SECRET="EnsureUseSomethingRandomHere44CharactersLong" - -# Required if you choose "authjs" as your authentication provider. -# Discord: https://discord.com/developers/applications -AUTH_DISCORD_SECRET="" -AUTH_DISCORD_ID="" -# GitHub: https://github.com/settings/developers -AUTH_GITHUB_SECRET="" -AUTH_GITHUB_ID="" -# Google: https://console.cloud.google.com/apis/credentials -AUTH_GOOGLE_SECRET="" -AUTH_GOOGLE_ID="" - -# Required if you choose "clerk" as your authentication provider. -# Obtain keys from: https://dashboard.clerk.com/last-active?path=api-keys -# Ensure the domain is connected in production (for PageSpeed Insights). NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="" CLERK_SECRET_KEY="" -NEXT_PUBLIC_CLERK_SIGN_IN_URL="/signin" -NEXT_PUBLIC_CLERK_SIGN_UP_URL="/signup" -# Additional optional feature, to enable visit: -# Clerk Dashboard > [app] > Organizations Settings -NEXT_PUBLIC_ORGANIZATIONS_ENABLED="false" - -# || NOTE: NEXT_PUBLIC_AUTH_PROVIDER was removed in Relivator 1.2.6. -# || To switch the provider from Neon, modify `reliverse.config.ts`. -# || Automatic switcher coming in the release of Relivator v1.3.0 GA. - -# || Auth.js Guide: https://nextjs.org/learn/dashboard-app/adding-authentication -# || Clerk Guide: https://clerk.com/docs/quickstarts/nextjs +CLERK_ENCRYPTION_KEY="" -# ==================================================== -# PAYMENT SYSTEM -# ==================================================== - -# || Fake store data will be generated if DATABASE_URL -# || and STRIPE_WEBHOOK_SIGNING_SECRET are not set. - -# For API keys: https://dashboard.stripe.com/test/apikeys NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="" -STRIPE_SECRET_KEY="" STRIPE_API_KEY="" - -# Please read the instructions at the end of the file. -STRIPE_WEBHOOK_SIGNING_SECRET="" STRIPE_WEBHOOK_SECRET="" - -# For product setup: https://dashboard.stripe.com/test/products -STRIPE_PROFESSIONAL_SUBSCRIPTION_PRICE_ID="" -STRIPE_ENTERPRISE_SUBSCRIPTION_PRICE_ID="" -# Stripe Product and Price IDs for your created products -# found at https://dashboard.stripe.com/test/products -STRIPE_STD_MONTHLY_PRICE_ID="" STRIPE_PRO_MONTHLY_PRICE_ID="" -# ==================================================== -# RELIVERSE ADDONS -# ==================================================== - -# || Currently, "next dev --turbo" does not read the .env file after launch. -# || So, you need to close the application using Cmd/Ctrl+C and run it again. - -# Set to true if you want to enable addons/scripts/reliverse/relimter/python/index.ts -# Note: addons/scripts/reliverse/relimter/python/index.ts is a more stable version. -PYTHON_INSTALLED="false" - -# Set to true if you want to enable addons/scripts/reliverse/toolbar/index.ts toolbar -# https://vercel.com/docs/workflow-collaboration/vercel-toolbar -ENABLE_VERCEL_TOOLBAR="false" -ENABLE_VT_ON_PRODUCTION="false" - -# ENABLE_VERCEL_TOOLBAR must be enabled to enable the following -# https://vercel.com/docs/workflow-collaboration/feature-flags -ENABLE_FEATURE_FLAGS="false" -# node -e "console.log(crypto.randomBytes(32).toString('base64url'))" -FLAGS_SECRET="" - -# Remotion GitHub Personal Access Token -# Obtain from: https://github.com/settings/personal-access-tokens/new -REMOTION_GITHUB_TOKEN="" - -# ==================================================== -# MEDIA UPLOAD -# ==================================================== - -# || Uploadthing is free, but redirects you to Stripe -# || after signing up, so you can just close the tab. - -# Image Upload Configuration -# https://uploadthing.com (Dashboard > [App] > API Keys) +UPLOADTHING_TOKEN="" UPLOADTHING_SECRET="" -UPLOADTHING_APP_ID="" - -# ==================================================== -# EMAIL SYSTEM -# ==================================================== -# || The email system is already partially integrated into Relivator 1.2.6. It will -# || be fully functional starting from Relivator 1.3.0. Contributions are welcome! - -# Email System Configuration -# Get API keys: https://resend.com -NEXT_PUBLIC_RESEND_API_KEY="" -# Set email: https://resend.com/domains or use Resend's test email -NEXT_PUBLIC_RESEND_EMAIL_FROM="onboarding@resend.dev" -# We need to register a domain with Resend to send emails from -# Register a domain at https://resend.com/domains -# Or we can use this email provided by resend for only testing: "onboarding@resend.dev" +RESEND_API_KEY="" EMAIL_FROM_ADDRESS="onboarding@resend.dev" - -# https://novu.co -NOVU_SECRET_KEY="" -# https://your-live-domain.com/api/novu -NOVU_BRIDGE_URL="" - -# ==================================================== -# ADDITIONAL -# ==================================================== - -# || Never share or commit the .env file. It has been added to .gitignore. -# || When adding new variables, update the schema in the /src/env.js file. - -# upstash -# https://YOUR_UPSTASH_REDIS_REST_URL -UPSTASH_REDIS_REST_URL="" -# ••••••••••••• -UPSTASH_REDIS_REST_TOKEN="" - -# Loglib Analytics (https://loglib.io) -LOGLIB_ID="" - -# Discord Server Notifications Integration -# Open your server settings > Integrations > New Webhook > obtain the URL. -DISCORD_WEBHOOK_URL="" - -# Do not enable it, it's used exclusively by https://relivator.com -DEMO_NOTES_ENABLED="false" - -# ==================================================== -# STRIPE INSTRUCTIONS -# ==================================================== - -# Ensure that you have the required configuration -# set up before following the instructions below: -# - DATABASE_URL -# - STRIPE_SECRET_KEY -# - NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - -# [STRIPE WEBHOOK FOR DEVELOPMENT] -# 1. Install Stripe CLI: https://stripe.com/docs/stripe-cli#install -# 2. Create webhook: https://dashboard.stripe.com/test/webhooks/create?endpoint_location=local -# 3. Open 3 terminals: -# - Terminal 1: "pnpm dev" -# - Terminal 2: "stripe login" -# - Terminal 3: "pnpm dev:stripe" or "pnpm stripe:listen" -# 4. Copy the signing secret from the terminal and paste it into STRIPE_WEBHOOK_SIGNING_SECRET. -# 5. Run "stripe trigger payment_intent.succeeded", wait for it to complete, then click Done. -# Keep "pnpm dev:stripe" or "pnpm stripe:listen" enabled when testing Stripe on localhost. -# Test data: 4242424242424242 | 12/34 | 567 - -# [STRIPE WEBHOOK FOR PRODUCTION] -# 1. Create webhook: https://dashboard.stripe.com/test/webhooks/create?endpoint_location=hosted -# 2. Endpoint: https://use-the-domain-here.com/api/webhooks/stripe -# 3. Select all events and add the endpoint. -# 4. Ensure "Latest API version" is selected. -# 5. Reveal the signing secret. -# Note: You will get the test-mode production signing key. Switch to live-mode for the real key. diff --git a/.github/workflows/NOVU.txt b/.github/workflows/NOVU.txt deleted file mode 100644 index 539fee82..00000000 --- a/.github/workflows/NOVU.txt +++ /dev/null @@ -1,27 +0,0 @@ -name: Novu Sync - -on: - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - # https://github.com/novuhq/actions-novu-sync - - name: Sync State to Novu - uses: novuhq/actions-novu-sync@v2 - with: - # The secret key used to authenticate with Novu Cloud - # To get the secret key, go to https://web.novu.co/api-keys. - # Required. - secret-key: ${{ secrets.NOVU_SECRET_KEY }} - - # The publicly available endpoint hosting the bridge application - # where notification entities (eg. workflows, topics) are defined. - # Required. - bridge-url: ${{ secrets.NOVU_BRIDGE_URL }} - - # The Novu Cloud API URL to sync with. - # Optional. - # Defaults to https://api.novu.co - api-url: https://api.novu.co diff --git a/.github/workflows/RELIVERSE.txt b/.github/workflows/RELIVERSE.txt deleted file mode 100644 index b017d7ae..00000000 --- a/.github/workflows/RELIVERSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -name: Reliverse Standard -on: - push: null -jobs: - build: - runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: - - 20 - steps: - - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: pnpm - - name: Install dependencies - run: pnpm install --no-frozen-lockfile diff --git a/.github/workflows/STARGAZERS.txt b/.github/workflows/STARGAZERS.txt deleted file mode 100644 index c436f380..00000000 --- a/.github/workflows/STARGAZERS.txt +++ /dev/null @@ -1,58 +0,0 @@ -name: Stargazers -on: - workflow_dispatch: - inputs: - repoOrg: - description: Repo Org - required: true - default: blefnk - repoName: - description: Repo Name - required: true - default: relivator-nextjs-template - starCount: - description: Star Count - required: true - default: "900" - duration: - description: Duration (seconds) - required: false - default: "15" -jobs: - render: - name: Stargazers - runs-on: ubuntu-22.04 - strategy: - matrix: - node-version: - - 20 - steps: - - name: Run checkout - uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: pnpm - - name: Install Fallback fonts (fonts) - run: | - sudo apt-get update -yqq - sudo apt-get install -yq --no-install-recommends \ - fonts-noto-core fonts-noto-cjk fonts-noto-color-emoji fonts-noto-mono - - name: Install dependencies from package.json - run: pnpm install --no-frozen-lockfile - - name: Define input props - run: echo $WORKFLOW_INPUT | tee input-props.json | jq -C '.' - env: - WORKFLOW_INPUT: ${{ toJson(github.event.inputs) }} - - name: Stargazers - run: pnpm stargazers:build -- --props="./input-props.json" - env: - REMOTION_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload video - uses: actions/upload-artifact@v3 - with: - name: stargazers.mp4 - path: public/internal/stargazers.mp4 diff --git a/.gitignore b/.gitignore index e80a8be5..aa290d86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,104 +1,13 @@ -node_modules/ -jspm_packages/ -bower_components/ -web_modules/ -.pnp -.pnp.js -build/ -dist/ -out/ -.next/ -next-env.d.ts -.nuxt/ -.gatsby/ -target/ -logs/ -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* -pids/ -*.pid -*.seed -*.pid.lock -lib-cov/ -coverage/ -*.lcov -.nyc_output/ -.grunt/ -.lock-wscript -build/Release/ -*.tsbuildinfo -*.d.ts.map -.npm/ -.npm/_locks -.stylelintcache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ -.node_repl_history -*.tgz -.yarn/ -.yarn/cache/ -.yarn/unplugged/ -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* -.yarn-integrity -.env -.env.local -__.env -.__.env -.cache/ -.parcel-cache/ -.expo/ -dist/ -expo-env.d.ts -apps/expo/.gitignore -.docusaurus/ -.serverless/ -.fusebox/ -.dynamodb/ -.tern-port/ -.turbo/ -.vercel/ -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json -.idea/ +# https://help.github.com/articles/ignoring-files + +/node_modules +/.next/ +/.venv/ .DS_Store -*.exe -*.dll -*.so -*.dylib -*.bin -*.tmp -*.temp -*.bak -*.old -*.orig -*.swp -*.pem -*.swc -__pycache__/ -*.py[oc] -*.egg-info/ -.now/ -.venv/ -.ruff_cache/ -.wheels/ -*.sublime-project -*.sublime-workspace -*.idea/ -.eslintcache -.vscode-test/ -addons/.output/ -addons/premium/ -yarn-error.log/ -path_mapping.txt -coverage/ -.million/ +*.log* +.env* .vercel -.env*.local -.unlighthouse +*.tsbuildinfo +next-env.d.ts +.eslintcache +.idea diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 65d46c9a..649b36b9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,23 +1,10 @@ { "recommendations": [ - "aaron-bond.better-comments", - "astro-build.houston", - "biomejs.biome", "bradlc.vscode-tailwindcss", - "charliermarsh.ruff", - "chunsen.bracket-select", - "davidanson.vscode-markdownlint", + "biomejs.biome", + "usernamehw.errorlens", "dbaeumer.vscode-eslint", - "fabiospampinato.vscode-open-multiple-files", - "github.github-vscode-theme", "lokalise.i18n-ally", - "mikekscholz.pop-icon-theme", - "ms-python.python", - "neptunedesign.vs-sequential-number", - "streetsidesoftware.code-spell-checker", - "unifiedjs.vscode-mdx", - "usernamehw.errorlens", - "usernamehw.remove-empty-lines", - "yzhang.markdown-all-in-one" + "fabiospampinato.vscode-open-multiple-files" ] } diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 6acd8335..00000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "compounds": [ - { - "configurations": ["Launch Next.js"], - "name": "Launch Next.js" - }, - { - "configurations": ["Launch Next.js", "Launch Next.js in Chrome"], - "name": "Launch Next.js and Chrome" - } - ], - "configurations": [ - { - "name": "Attach by Process ID", - "processId": "${command:PickProcess}", - "request": "attach", - "restart": true, - "type": "node" - }, - { - "console": "internalConsole", - "env": { - "NODE_OPTIONS": "--inspect" - }, - "name": "Launch Next.js", - "program": "${workspaceFolder}/node_modules/next/dist/bin/next", - "request": "launch", - "sourceMaps": true, - "trace": true, - "type": "node" - }, - { - "name": "Launch Next.js in Chrome", - "request": "launch", - "type": "chrome", - "url": "http://localhost:3000", - "webRoot": "${workspaceFolder}" - }, - { - "args": ["--runInBand"], - "envFile": "${workspaceFolder}/.env", - "name": "Launch All Jest Tests", - "program": "${workspaceFolder}/node_modules/jest/bin/jest", - "request": "launch", - "type": "node" - }, - { - "args": ["${relativeFile}"], - "console": "internalConsole", - "internalConsoleOptions": "openOnSessionStart", - "name": "Launch Current Jest Test", - "program": "${workspaceFolder}/node_modules/jest/bin/jest", - "request": "launch", - "type": "node" - }, - { - "console": "integratedTerminal", - "env": { - "NODE_OPTIONS": "--loader=tsx" - }, - "name": "Launch Ava Test (experimental)", - "outputCapture": "std", - "program": "${workspaceFolder}/node_modules/ava/entrypoints/cli.js", - "request": "launch", - "runtimeArgs": ["${file}", "--break", "debug"], - "runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava", - "runtimeVersion": "20.10.0", - "skipFiles": ["/**/*.js"], - "type": "node" - } - ], - "type": "commonjs", - "version": "0.2.0" -} diff --git a/.vscode/settings.json b/.vscode/settings.json index acce712f..14eae4b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,454 +1,28 @@ { - "[appts.reliverse]": { - "vscodePreset": "default" - }, - "[css]": { - "editor.defaultFormatter": "vscode.css-language-features" - }, - "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[javascript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[javascriptreact]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[json]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[json5]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[jsonc]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[markdown]": { - "editor.defaultFormatter": "DavidAnson.vscode-markdownlint" - }, - "[mdx]": { - "editor.wordWrap": "on" - }, - "[python]": { - "editor.codeActionsOnSave": { - "source.fixAll": "explicit", - "source.organizeImports": "explicit" - }, - "editor.defaultFormatter": "charliermarsh.ruff", - "editor.formatOnSave": true - }, - "[typescript]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[typescriptreact]": { - "editor.defaultFormatter": "biomejs.biome" - }, - "[yaml]": { - "editor.defaultFormatter": "redhat.vscode-yaml" - }, - "biome.enabled": true, - "breadcrumbs.enabled": true, - "cSpell.enabled": true, - "cSpell.userWords": [ - "Menlo", - "Monaspace", - "astro", - "biomejs", - "dotjs", - "mjml", - "pwsh", - "quickfix", - "rgba", - "tson" - ], - "cSpell.words": ["callout", "combobox", "reliverse", "utapi"], - "css.lint.important": "ignore", - "css.lint.unknownAtRules": "ignore", - "debug.toolBarLocation": "docked", - "diffEditor.experimental.showMoves": true, - "diffEditor.hideUnchangedRegions.enabled": true, - "editor.acceptSuggestionOnCommitCharacter": true, - "editor.acceptSuggestionOnEnter": "on", - "editor.bracketPairColorization.enabled": true, - "editor.bracketPairColorization.independentColorPoolPerBracketType": true, + "workbench.activityBar.orientation": "vertical", + "editor.formatOnSave": true, "editor.codeActionsOnSave": { "quickfix.biome": "explicit", "source.addMissingImports": "never", - "source.fixAll": "never", "source.fixAll.eslint": "explicit", "source.organizeImports": "never", - "source.organizeImports.biome": "never", "source.removeUnused": "never" }, - "editor.colorDecorators": true, - "editor.cursorBlinking": "phase", - "editor.cursorSmoothCaretAnimation": "on", - "editor.cursorStyle": "line", - "editor.defaultFormatter": "biomejs.biome", - "editor.detectIndentation": false, - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "editor.formatOnSaveMode": "file", - "editor.formatOnType": false, - "editor.guides.bracketPairs": true, - "editor.guides.indentation": false, - "editor.hideCursorInOverviewRuler": false, - "editor.inlayHints.enabled": "offUnlessPressed", - "editor.inlineSuggest.enabled": true, - "editor.inlineSuggest.showToolbar": "always", - "editor.insertSpaces": true, - "editor.linkedEditing": true, - "editor.minimap.autohide": false, - "editor.minimap.enabled": true, - "editor.minimap.renderCharacters": false, - "editor.multiCursorModifier": "alt", - "editor.parameterHints.enabled": true, - "editor.quickSuggestions": { - "comments": true, - "other": true, - "strings": true - }, - "editor.quickSuggestionsDelay": 10, - "editor.rulers": [54, 74, 119], - "editor.smoothScrolling": true, - "editor.snippets.codeActions.enabled": true, - "editor.stickyScroll.enabled": true, - "editor.suggest.insertMode": "insert", - "editor.suggest.localityBonus": true, - "editor.suggestOnTriggerCharacters": true, - "editor.suggestSelection": "first", - "editor.tabCompletion": "off", - "editor.tabSize": 2, - "editor.tokenColorCustomizations": { - "comments": "#746f68" - }, - "editor.unicodeHighlight.allowedCharacters": { - "a": true, - "І": true, - "А": true, - "В": true, - "Е": true, - "З": true, - "Н": true, - "О": true, - "Р": true, - "С": true, - "Т": true, - "У": true, - "а": true, - "б": true, - "г": true, - "е": true, - "з": true, - "н": true, - "о": true, - "р": true, - "с": true, - "у": true, - "і": true, - "ا": true, - "ه": true, - "–": true - }, - "editor.unicodeHighlight.allowedLocales": { - "tr": true - }, - "editor.wordBasedSuggestions": "currentDocument", - "eslint.codeActionsOnSave.mode": "problems", - "eslint.enable": true, - "eslint.format.enable": true, - "eslint.ignoreUntitled": true, - "eslint.lintTask.enable": true, - "eslint.lintTask.options": ".", - "eslint.probe": [ - "MDX", - "astro", - "github-actions-workflow", - "html", - "javascript", - "javascriptreact", - "json", - "json5", - "jsonc", - "markdown", - "toml", - "typescript", - "typescriptreact", - "yaml" - ], "eslint.rules.customizations": [ { - "rule": "@stylistic/*", - "severity": "off" - }, - { - "rule": "perfectionist/*", - "severity": "off" - }, - { - "rule": "@typescript-eslint/consistent-type-imports", - "severity": "info" - }, - { - "rule": "import-x/newline-after-import", - "severity": "info" - }, - { - "rule": "readable-tailwind/*", - "severity": "info" - }, - { - "rule": "curly", - "severity": "info" - }, - { - "rule": "no-lonely-if", - "severity": "info" - }, - { - "rule": "@stylistic/linebreak-style", - "severity": "info" - }, - { - "rule": "jsonc/indent", - "severity": "info" - }, - { - "rule": "RULES-BELOW-ARE-NOT-AUTOFIXABLE", + "rule": "perfectionist/sort-imports", "severity": "warn" - }, - { - "rule": "@typescript-eslint/no-unused-vars", - "severity": "warn" - }, - { - "rule": "@stylistic/no-tabs", - "severity": "error" - }, - { - "rule": "@stylistic/no-mixed-spaces-and-tabs", - "severity": "error" - }, - { - "rule": "@stylistic/no-mixed-operators", - "severity": "error" - }, - { - "rule": "@stylistic/max-statements-per-line", - "severity": "error" - }, - { - "rule": "@stylistic/max-len", - "severity": "error" - }, - { - "rule": "@stylistic/line-comment-position", - "severity": "error" - }, - { - "rule": "@stylistic/jsx-pascal-case", - "severity": "error" - }, - { - "rule": "@stylistic/jsx-child-element-spacing", - "severity": "error" } ], - "eslint.timeBudget.onFixes": { - "error": 25000, - "warn": 25000 - }, - "eslint.timeBudget.onValidation": { - "error": 25000, - "warn": 25000 - }, - "eslint.validate": [ - "MDX", - "astro", - "github-actions-workflow", - "html", - "javascript", - "javascriptreact", - "json", - "json5", - "jsonc", - "markdown", - "toml", - "typescript", - "typescriptreact", - "yaml" - ], - "extensions.ignoreRecommendations": false, - "files.associations": { - "*.json": "json", - "*.mdx": "mdx", - "*.toml": "properties", - "*.txt": "plaintext", - ".env.example": "properties" - }, - "files.eol": "\n", - "files.insertFinalNewline": true, - "files.trimTrailingWhitespace": true, - "git.autofetch": true, - "git.confirmSync": false, - "git.enableSmartCommit": true, - "git.openRepositoryInParentFolders": "never", - "html.format.indentInnerHtml": true, - "i18n-ally.displayLanguage": "en-US", - "i18n-ally.enabledFrameworks": ["general", "next-intl", "react"], - "i18n-ally.keysInUse": [ - "Manifest.name", - "faq.1.details", - "faq.1.summary", - "faq.2.details", - "faq.2.summary", - "faq.3.details", - "faq.3.summary", - "name" - ], - "i18n-ally.keystyle": "nested", - "i18n-ally.localesPaths": ["messages"], - "i18n-ally.sourceLanguage": "en-US", - "javascript.format.semicolons": "insert", - "javascript.inlayHints.enumMemberValues.enabled": true, - "javascript.inlayHints.functionLikeReturnTypes.enabled": true, - "javascript.inlayHints.parameterNames.enabled": "all", - "javascript.inlayHints.parameterTypes.enabled": true, - "javascript.preferences.importModuleSpecifier": "non-relative", - "javascript.updateImportsOnFileMove.enabled": "always", - "json.validate.enable": false, - "markdown.extension.preview.autoShowPreviewToSide": false, - "markdown.preview.scrollEditorWithPreview": true, - "markdown.preview.scrollPreviewWithEditor": true, + "openMultipleFiles.limit": 700, "markdownlint.config": { - "MD033": false, - "MD041": false - }, - "mdx.server.enable": true, - "openMultipleFiles.exclude": [ - "**/*.gif", - "**/*.jpeg", - "**/*.png", - "**/*.svg", - "**/*.txt", - "**/.git", - "**/.idea", - "**/.million", - "**/.next", - "**/.nyc_output", - "**/.pnp.*", - "**/.turbo", - "**/.venv", - "**/.yarn", - "**/build", - "**/cluster/deprecated", - "**/coverage", - "**/dist", - "**/dist-dev", - "**/fixture", - "**/node_modules", - "**/package-lock.json", - "**/public", - "**/target", - "**/yarn.lock", - "**/yarn-error.log", - "addons/.output" - ], - "openMultipleFiles.ignore": [".gitignore"], - "openMultipleFiles.limit": 1000, - "outline.problems.badges": false, - "prettify-ts.viewNestedTypes": true, - "problems.defaultViewMode": "table", - "problems.showCurrentInStatus": true, - "problems.sortOrder": "position", - "ruff.lineLength": 88, - "ruff.nativeServer": true, - "search.exclude": { - "**/*.lock": true, - "**/.eslintcache": true, - "**/.idea": true, - "**/.next": true, - "**/.pnp.*": true, - "**/.venv": true, - "**/.yarn": true, - "**/build": true, - "**/dist": true, - "**/next-env.d.ts": true, - "**/package-lock.json": true, - "**/pnpm-lock.yaml": true, - "**/reset.d.ts": true, - "**/tsconfig.tsbuildinfo": true, - "**/yarn-error.log": true + "MD033": false }, - "search.useIgnoreFiles": false, - "tailwindCSS.classAttributes": ["class", "className", "classNames"], - "tailwindCSS.experimental.classRegex": [ - ["(?:'|\"|`)([^']*)(?:'|\"|`)", "cx\\(([^)]*)\\)"], - ["[\"'`]([^\"'`]*).*?[\"'`]", "cva\\(([^)]*)\\)"] - ], - "terminal.integrated.allowedLinkSchemes": [ - "C", - "file", - "http", - "https", - "mailto", - "vscode", - "vscode-insiders" - ], - "terminal.integrated.smoothScrolling": true, - "totalTypeScript.hideAllTips": true, - "totalTypeScript.hideBasicTips": true, - "tsEssentialPlugins.arrayMethodsSnippets.enable": true, - "tsEssentialPlugins.fixSuggestionsSorting": true, - "tsEssentialPlugins.globalLibCompletions.action": "mark", - "tsEssentialPlugins.jsxEmmet.modernize": true, - "tsEssentialPlugins.outline.arraysTuplesNumberedItems": true, - "tsEssentialPlugins.patchOutline": true, - "tsEssentialPlugins.renameImportNameOfFileRename": true, - "tsEssentialPlugins.signatureHelp.excludeBlockScope": true, - "tsEssentialPlugins.skipNodeModulesReferences": true, - "tsEssentialPlugins.suggestions.localityBonus": true, - "tsEssentialPlugins.tupleHelpSignature": true, - "typescript.enablePromptUseWorkspaceTsdk": true, - "typescript.format.semicolons": "insert", - "typescript.inlayHints.enumMemberValues.enabled": true, - "typescript.inlayHints.parameterNames.enabled": "all", - "typescript.preferences.autoImportFileExcludePatterns": [ - "next/dist/client/router.d.ts", - "next/router.d.ts" - ], - "typescript.preferences.importModuleSpecifier": "non-relative", - "typescript.preferences.includePackageJsonAutoImports": "on", - "typescript.referencesCodeLens.enabled": true, - "typescript.reportStyleChecksAsWarnings": true, - "typescript.tsdk": "node_modules/typescript/lib", - "typescript.updateImportsOnFileMove.enabled": "always", - "typescript.validate.enable": true, - "window.autoDetectColorScheme": true, - "window.commandCenter": true, - "window.title": "${dirty}${folderName}${separator}${activeEditorMedium}", - "workbench.colorCustomizations": { - "terminal.ansiBlack": "#21222c", - "terminal.ansiBlue": "#bd93f9", - "terminal.ansiBrightBlack": "#8d92ff", - "terminal.ansiBrightBlue": "#bd93f9", - "terminal.ansiBrightCyan": "#2cccff", - "terminal.ansiBrightGreen": "#20E3B2", - "terminal.ansiBrightMagenta": "#ff6bcb", - "terminal.ansiBrightRed": "#ff7979", - "terminal.ansiBrightWhite": "#ffffff", - "terminal.ansiBrightYellow": "#EAC394", - "terminal.ansiCyan": "#8be9fd", - "terminal.ansiGreen": "#20e3b2", - "terminal.ansiMagenta": "#ff6bcb", - "terminal.ansiRed": "#ff5555", - "terminal.ansiWhite": "#f8f8f2", - "terminal.ansiYellow": "#fde181", - "terminalCursor.background": "#868690", - "terminalCursor.foreground": "#43444D" - }, - "workbench.editor.enablePreview": false, - "workbench.layoutControl.enabled": true, - "workbench.panel.defaultLocation": "bottom", - "workbench.statusBar.visible": true + "typescript.tsdk": "node_modules\\typescript\\lib", + "eslint.ignoreUntitled": true, + "i18n-ally.localesPaths": ["messages"], + "i18n-ally.enabledFrameworks": ["react"], + "i18n-ally.sourceLanguage": "en", + "i18n-ally.autoDetection": true, + "i18n-ally.keystyle": "nested" } diff --git a/README.md b/README.md index d13d2c9b..fb72de9d 100644 --- a/README.md +++ b/README.md @@ -1,1144 +1,44 @@ -# Relivator 1.3.0-canary.7: Next.js 15 eCommerce Template +# Relivator Next.js Template -We are currently migrating the documentation from the existing Relivator README.md to the official, newly launched [Relivator & Reliverse Docs website (https://reliverse.org)](https://reliverse.org). The content will be organized into appropriate sections on the new site. During the migration, some elements might not function properly. The current README.md will contain only minimal information. Please let us know if you encounter any issues. +Please consider following this project's author, [Nazar Kornienko](https://github.com/blefnk), and consider starring the project to show your ❤️ and support. ---- +- **🚀 Live Demo**: [relivator.com](https://relivator.com/en) +- **💙 Discord**: [discord.gg/Pb8uKbwpsJ](https://discord.gg/Pb8uKbwpsJ) +- **📚 Docs**: [docs.reliverse.org](https://docs.reliverse.org/relivator) - +![cover image](./public/screenshot-dark.png) -
+## How to Run or Build the Project? -[🌐 Demo](https://relivator.com) | [👋 Introduction](#introduction) | [🏗️ Installation](#installation) | [🩷 Sponsors](#sponsors) +Make sure you have [Git](https://git-scm.com/downloads), [Node.js](https://nodejs.org/en), and [Bun](https://bun.sh) installed. Then: -[⚙️ Scripts](#scripts) | [🤔 FAQ](#faq) | [🔍 Details](#details) | [✅ Roadmap](#roadmap) | [📖 Changelog](#changelog) +1. `git clone https://github.com/blefnk/relivator.git` +2. `cd relivator` +3. `bun i` +4. `cp .env.example .env` → Fill in the .env file +5. `bun db:push` +6. `bun dev` / `bun run build` -
+## What is Relivator? - +The Relivator template serves as the foundation for your eCommerce platform, helping you create efficient, engaging, and profitable online stores. Relivator enhances any eCommerce with the power of modern Next.js, React, TypeScript, Tailwind, and more. For detailed information about the Relivator template and its bootstrapper, [Reliverse](https://github.com/reliverse/cli), you can visit the [documentation website](https://docs.reliverse.org/relivator). - +## Stack of technologies -Stop jumping from one starter to the next. With [Relivator](https://github.com/blefnk/relivator-nextjs-template#readme), your possibilities are endless! You can create anything you want; all the tools are ready and waiting for you. +- **Core**: Next.js 15.1, React 19, TypeScript 5.7 +- **Internationalization**: next-intl +- **Styling**: Tailwind & Shadcn/UI +- **Auth**: Clerk +- **Payments**: Stripe +- **Database**: Drizzle ORM & Neon Postgres +- **File Storage**: Uploadthing +- **Tools**: ESLint 9, Biome, Knip -The entire Relivator project was developed by one person, [Nazar Kornienko (blefnk)](https://github.com/blefnk)! Some people have already contributed, and you’re welcome to do the same—any contributions at all are appreciated! Your contributions will not be forgotten; [our awesome community](https://discord.gg/Pb8uKbwpsJ) value them highly, and you might even receive financial gratitude from the project's creator in the future. Let's come together to create the most coolest Next.js template in the world! This will be a joint effort and a shared victory, a true win-win. Thank you all for your contributions and [financial support](#sponsors)! +## What if I want to have another stack? -Please take a moment to read through the information below. You'll find helpful details about how everything works in the project, as well as an extensive list of features. - -
- -

- - - - - - Shows the landing page of Relivator Next.js template, with its logo and the phrase 'Relivator Empowers Your eCommerce with the Power of Next.js'. - - - - - - - - - Dark-themed image displaying various technologies and tools used in the Relivator project. The heading highlights Next.js 15, React 19, shadcn, and Tailwind Template. The image is divided into multiple sections listing technologies like shadcn, tailwind, next 15, react 19, clerk, authjs, drizzle, neon, ts 5.6, python, eslint 9, ts-eslint 8, knip, biome, unjs, and reliverse. The background features a grid layout with a minimalistic design, inspired by the Figma and Loading UI style. - - - -

- -[![Discord chat][badge-discord]][link-discord] -[![npm version][badge-npm]][link-npm] -[![MIT License](https://img.shields.io/github/license/blefnk/relivator-nextjs-template.svg?color=blue)](LICENSE) - -[𝕏](https://x.com/blefnk) | [GitHub](https://github.com/blefnk) | [Slack](https://join.slack.com/t/reliverse/shared_invite/zt-2mq703yro-hKnLmsgbIQul0wX~gLxRPA) | [LinkedIn](https://linkedin.com/in/blefnk) | [Facebook](https://facebook.com/blefnk) | [Discord](https://discord.gg/Pb8uKbwpsJ) | [Fiverr](https://fiverr.com/blefnk) - -
- -> *«I couldn't find the ~~sports car~~ Next.js starter of my dreams, so I built it myself.»* © ~~Ferdinand Porsche~~ [@blefnk](https://github.com/blefnk) - -Our goal is to create the world's most feature-rich and globally accessible Next.js starter. It offers more than just code—it's an experience. Scroll down to see the impressive list of project features, including the ability to switch between Clerk/Auth.js (next-auth@beta/NextAuth.js) and Drizzle's MySQL/PostgreSQL on the fly. Welcome to the Relivator starter and the Reliverse community! - - - -## Introduction - -[**👉 Read the Detailed Blog Post About 1.2.6 & 1.3.0@canary Update 👈**](https://reliverse.org/relivator/v126) - -**✅ Relivator 1.2.6 uses the following dependencies (only some are listed)**: Next.js 15, React 19, TypeScript 5.5/5.6, Tailwind 3/4, tRPC 11, Clerk 5, Auth.js 5, ESLint 9 (with multiple plugins like typescript-eslint 8, react, unicorn, sonarjs, perfectionist, tailwindcss, readable-tailwind, import-x, jsx-a11y, security, markdown, mdx, json), Biome, Stripe, Million, Reliverse, next-intl, shadcn/ui, radix-ui, react-query, pnpm, zod, cn, turbo, Drizzle (Postgres, MySQL, SQLite, Neon, Railway, PlanetScale, Turso), GSAP, SWR, Resend, react-email, next-themes, Putout, Flowbite, Udecode, Slate, uploadthing, Radash, CSpell, TypeStat, Lucide & Radix Icons, Vercel & Loglib Analytics, Axios, Day.js, Embla Carousel, Execa, Math.js, UnJS libs (consola, fs-extra, pathe, etc), and much more - -**[upd. 18.08.2024]** You can now try out the first published Reliverse Addon – [@reliverse/fs](https://github.com/reliverse/fs#readme), which is already available and used in Relivator! **🎉 The upcoming Relivator 1.3.0 will have as few dependencies as possible.** Everything will work thanks to @reliverse/addons. Everything will be separated into its own libraries and will be published on npmjs and/or jsr. You will be able to install exactly what you need, including functionality and UI. You will have two options. One is to install the addons the classic way using 'package.json'. The other option is that all these addons can also be installed in a style inspired by shadcn/ui, where you keep all the content directly in your project (as it is currently in test mode in Relivator 1.2.6 (please check `addons` folder or run `pnpm addons`)), although the first option will be recommended for the most use cases. 'addons' folder already contains many cool things, especially related to codemods. It also includes the @reliverse/academy game, where you can check how good you know JavaScript/TypeScript, React/Next.js, Relivator/Reliverse, and even ESLint, ecosystems (you will even find there table of records and will can contest with other players if you share data/players.json and data/progress.json save files to them; the game has also achievement system). - -**🙏 Please help us reach 1,000 stars on GitHub**: Once this project reaches this goal, I, @blefnk, the author of this project, will start my video course on the basics of web development (HTML, CSS, JS), React, Next.js, TypeScript, related libraries, and many other topics. This milestone will also affirm that Relivator and [Reliverse](https://github.com/blefnk/reliverse-website-builder) truly make sense to exist, leading to more frequent updates and further dedication to these projects. - -**⭐ Bookmark this page in your browser**: This project will only get better in the future. You can also click the star at the top of the page and add the repo to your collection to keep it easily accessible. - -## The Huge Relivator 1.2.6 & 1.3.0@canary are Already Available - -[**👉 Read the Detailed Blog Post About 1.2.6 & 1.3.0@canary Update 👈**](https://reliverse.org/relivator/v126) - -Relivator 1.2.6 was released on August 4, 2024! We are now actively working on the next major update, Relivator 1.3.0, with the goal of making the project production-ready, clean, and high-quality. We invite you to join us in actively searching for issues, contributing freely, and earning cool rewards. A canary branch was launched a few days ago (and is available to everyone in the main repo), and the dev branch is also now available (the dev branch is available for a limited time to all sponsors at any paid pledge level). - -**🔥 Important Note:** Relivator currently requires specifying Clerk environment variable keys, as its API has changed. We are working on making Clerk optional again. However, all other environment variables are optional. If this statement is incorrect and something is broken, please let us know. - -## What About the Future? Any News on 1.3.0? - -**🎉 The upcoming Relivator 1.3.0 will have as few dependencies as possible! Finally!** - -I'm ([blefnk](https://github.com/blefnk)) working to automate the Relivator's developer experience as much as possible, including the installation process. The upcoming version 1.3.0 will feature significant automated installation. If you wish to try the initial alpha version of one of my many automation scripts, use the `pnpm deps:install` (or `pnpm deps:install-all`) command. This script already allows you to install and remove project packages, and it also works as a linter. You can check the comprehensive number of predefined commands configured inside the 'scripts' section of the 'package.json' file. However, before running this script, you should manually install the essentials: - -- `npx npm add typescript tsx npm @mnrendra/read-package @clack/prompts` -- `npx npm add fs-extra pathe fast-npm-meta semver @types/semver redrun axios` -- `bun|yarn|pnpm dlx jsr add @reliverse/core` (or: `npx jsr add @reliverse/core`) - -Thanks to @reliverse/addons, everything now works smoothly with fewer dependencies. In the future, each feature and component will be split into its own library and published on [npmjs](https://npmjs.com) and/or [jsr](https://jsr.io), so you can install only what you need. With the future Relivator 1.3.0 version, you won't have to deal with unnecessary components in web templates anymore. You get the core package and can add features and UI components as you need them. - -The 'addons' folder is divided into two parts: terminal context and browser context (it's everything, excluding the 'addons/scripts' folder). The 'addons/scripts' folder contains functions used by the CLI (command line interface), while the 'src' and 'addons/*' folders (excluding 'addons/scripts') are for the browser, since the browser doesn't support certain JS features. So, while 'addons/scripts' has everything needed for the whole app, not everything can import from 'addons/scripts'. - -You’ll have two installation options: the classic method using 'package.json' or a new approach inspired by shadcn/ui, where you keep all the content directly in your project (currently in test mode in Relivator 1.2.6—check the `addons` folder or run `pnpm addons`). While the classic method is recommended for most cases, feel free to explore the new approach! - -The 'addons' folder is already packed with many exciting features, especially related to codemods, and includes the **@reliverse/academy game**. This game allows you to test your knowledge of JavaScript/TypeScript, React/Next.js, Relivator/Reliverse (make food/tea/coffee before trying this test—it has a lot of questions!), and even ESLint v9 ecosystems. It features a leaderboard, enabling you to compete with others by sharing `data/players.json` and `data/progress.json` save files. Plus, an achievement system keeps you motivated! - -I can’t wait for you to experience the new and improved Relivator 1.3.0! By the way, the items in the [✅ Roadmap](#roadmap) section will finally be checked off! But to make 1.3.0 truly stable, production-ready, and just great, let's first work together on Relivator v1.3.0-canary.0, which is coming soon! If you want to get it even faster, there is now a 'dev' branch. We recently opened the project pages on financial support platforms, and currently, any contribution grants you access to the 'dev' branch. Thank you for your attention! - -## Sponsors - -**[We're Growing Fast! A Huge Thanks to All Our Supporters!](https://github.com/blefnk/relivator-nextjs-template/stargazers)** - -Developing something as ambitious as Relivator takes a lot of time, especially since the project is primarily developed by just one person. The development could be significantly accelerated by hiring additional developers. Therefore, @blefnk (Nazar Kornienko), the author of this project, would be immensely grateful to anyone who can donate to the project in any amount. A big thank you to everyone in advance! - -**[Visit the "Donate to Relivator" page to learn more.](https://relivator.com/donate)** - -*Relivator is currently sponsored by the following awesome people/organizations:* - -### 💚 [GitHub Sponsors](https://github.com/sponsors/blefnk) 🩵 [PayPal](https://paypal.me/blefony) 🧡 [Patreon](https://patreon.com/blefnk) 💛 [Buy Me a Coffee](https://buymeacoffee.com/blefnk) 🩷 [Ko-fi](https://ko-fi.com/blefnk) - -*Love using this project? If you find this project useful, I'd appreciate a cup of coffee. You'll get Reliverse Pro, access to some private repositories, pre-release downloads, and the ability to influence my project planning. Please click on the donation platforms above to learn more. Thank you, everyone, for any kind of support!* - -*I retrieve your data from donation and related platforms. If you do not wish for certain information about you to be included here, please contact me.* - -- [@devmarauda](https://github.com/devmarauda) *(Discord: kongkong86 | Name: Daniel Humphreys)* -- [@svict4](https://github.com/svict4) *(Discord: svict4 | Name: Simon Victory)* -- [@mfpiano](https://youtube.com/@mfpiano) *(Discord: mfpiano | Name: Petro Melnyk)* - -### 💜 [Discord Server Boost](https://discord.gg/C4Z46fHKQ8) - -- [@Saif-V](https://github.com/Saif-V) *(Discord: Gh0st | Name: Saif Al-Hashar)* -- [@demiroo](https://github.com/demiroo) *(Discord: demiroezkan | Name: Özkan Demir)* - -## 🖥️ Hire Me - -Hello, I'm [Nazar Kornienko](https://github.com/blefnk), a flexible web developer specializing in JavaScript/TypeScript and React/Next.js front-end development. If you’re looking for someone with my skill set, please contact me at or via [Discord](https://discordapp.com/users/611578864958832641). - -Please explore the current repository to learn more about my experience with the JavaScript/TypeScript and React/Next.js ecosystems. I'm available for both remote work and full-time positions. While my primary focus is frontend and CLI development, if you need help with code automation tools, small tasks related to Python or backend, or even designs in Figma, graphic design, or copywriting/marketing, feel free to reach out to me as well—I’d love to see how I can assist. - -## 🤝 Partnerships - -Starting with version 1.2.6, Relivator is now truly production-ready. However, there's still much to be accomplished, and you might be surprised when you check the [✅ Roadmap](#roadmap) section! To reach our goals, we are seeking partners to collaborate and support each other's projects' growth. If you're interested and would like to learn more, please feel free to email me at . - -### Our Partners - - - - - - Gallery of all partners' logos - -

Railway

-
- -## 🙏 Dear Audience, I Need Your Help - -Currently, I’m in a challenging financial situation, so I would greatly appreciate any recommendations or mentions of my work and Relivator as part of my portfolio, such as on the pages of your own repositories. Your support would mean a lot to me! As a token of my appreciation, I’d be happy to send some interesting gifts to you. Thank you for your time and consideration! - -## Installation - - - -**How to Install and Get Started:** You have two options for installation. You can either immediately deploy to Vercel using the button below and start working on the generated repository right away (but still read the information below), or you can follow the short or detailed manual installation instructions provided. - -**By The Way:** *Sometimes, we gift `Reliverse Pro`, which gives you early access to the Reliverse projects ecosystem, including Relivator, as well as upcoming plugins, to randomly selected individuals. We also give away other interesting things. Simply `star this repository` and [let us know how to reach you](https://forms.gle/NXZ6QHpwrxh52VA36). To join the discussion, hop into [the project's Discord](https://discord.gg/Pb8uKbwpsJ).* - -### One-click Installation Method (**find recommended method below**) - -**🔥 Important Note:** Relivator currently requires specifying Clerk environment variable keys, as its API has changed. We are working on making Clerk optional again. However, all other environment variables are optional. If this statement is incorrect and something is broken, please let us know. - -By using this method, you will get only the front-end, with all the functionality disabled (learn how to enable it by reading the manual instructions below): - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fblefnk%2Frelivator-nextjs-template&project-name=relivator&repository-name=my-new-repository-name) - -**Please note:** As of version 1.2.6 and 1.3.0 (dev and canary), it is recommended to use Clerk as the authProvider (specified in the `reliverse.config.ts` file) since this version has been more thoroughly tested with Clerk. We are working on fixing and improving the stability of Auth.js (next-auth@beta/NextAuth.js) as an authentication provider. - -### Manual Installation: Short Method (**find recommended method below**) - -**🔥 Important Note:** Relivator currently requires specifying Clerk environment variable keys, as its API has changed. We are working on making Clerk optional again. However, all other environment variables are optional. If this statement is incorrect and something is broken, please let us know. - -1. **Node.js LTS**: **(A)** classical method - [Windows/macOS](https://nodejs.org) | [Linux](https://youtu.be/NS3aTgKztis); **(B)** nvm - [Windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file#install-nvm-windows) | [macOS/Linux](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating); **(C)** [fnm](https://github.com/Schniz/fnm#readme). -2. **Tools**: `corepack enable pnpm` ➞ [*VSCode*](https://code.visualstudio.com) ➞ [*Git*](https://learn.microsoft.com/en-us/devops/develop/git/install-and-set-up-git) ➞ *GitHub Desktop* ([Windows/macOS](https://desktop.github.com) | [Linux](https://dev.to/rahedmir/is-github-desktop-available-for-gnu-linux-4a69)) ➞ [Stripe CLI](https://docs.stripe.com/stripe-cli). Windows only: [PowerShell 7.4+](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package). -3. **[Fork the repo](https://github.com/blefnk/relivator-nextjs-template/fork)**: Download your fork using GitHub Desktop. -4. **Setup**: `pnpm install && install:global && pnpm reli:setup` ➞ `pnpm reli:vscode` ➞ `cp .env.example .env` ➞ fill in the values inside of `.env` ➞ `pnpm db:push` ➞ `reliverse.config.ts`. -5. **Run, Build, Deploy**: Use `pnpm dev` to run the app. Stop with `Ctrl+C`. Build with `pnpm build`. Run `pnpm appts` to check the code. Upload to GitHub with GitHub Desktop. Deploy on [Vercel](https://vercel.com/new). - -### Manual Installation: Detailed Method (recommended) - -**🔥 Important Note:** Relivator currently requires specifying Clerk environment variable keys, as its API has changed. We are working on making Clerk optional again. However, all other environment variables are optional. If this statement is incorrect and something is broken, please let us know. - -▲ Hotline: [Email](mailto:blefnk@gmail.com) | [Discord](https://discord.gg/Pb8uKbwpsJ) | [Slack](https://join.slack.com/t/reliverse/shared_invite/zt-2mq703yro-hKnLmsgbIQul0wX~gLxRPA) | [Cal.com](https://cal.com/blefnk/reliverse) - -> I'm ([blefnk](https://github.com/blefnk)) working to automate the Relivator's installation process as much as possible. The upcoming version 1.3.0 will feature a significant automated installation. If you wish to try the alpha version of one of my many automation scripts, use the `pnpm deps:install` (or `pnpm deps:install-all`) command. However, before running this script, you should manually install the essentials (edit 'pnpm dlx jsr' if needed): `npx nypm add typescript tsx @clack/prompts @mnrendra/read-package nypm ora fs-extra pathe fast-npm-meta semver @types/semver redrun && pnpm dlx jsr add @reliverse/core`. - -**Please note**: As of version 1.2.6 and 1.3.0 (dev and canary), it is recommended to use Clerk as the authProvider (specified in the `reliverse.config.ts` file) since this version has been more thoroughly tested with Clerk. We are working on fixing and improving the stability of Auth.js (next-auth@beta/NextAuth.js) as an authentication provider. - -1. **Node.js LTS**: Ensure you have *Node.js LTS* installed using: **(a)** classical method - [Windows/macOS](https://nodejs.org) | [Linux](https://youtu.be/NS3aTgKztis); **(b)** nvm - [Windows](https://github.com/coreybutler/nvm-windows?tab=readme-ov-file#install-nvm-windows) | [macOS/Linux](https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating); **(c)** [fnm](https://github.com/Schniz/fnm#readme). -2. **Essential Tools**: Then, run `corepack enable pnpm` to install [*pnpm*](https://pnpm.io/installation). Also, install [*VSCode*](https://code.visualstudio.com), [Git](https://learn.microsoft.com/en-us/devops/develop/git/install-and-set-up-git), *GitHub Desktop* ([Windows/macOS](https://desktop.github.com) | [Linux](https://dev.to/rahedmir/is-github-desktop-available-for-gnu-linux-4a69)), and [Stripe CLI](https://docs.stripe.com/stripe-cli). If you're a Windows user: install [PowerShell 7.4+](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package) as well. -3. **Project Cloning**: [*Fork the repository*](https://github.com/blefnk/relivator-nextjs-template/fork) or click on the `Use this template` button. Use GitHub Desktop to download it to your device. The project size is about 12MB, but ensure you have at least 7GB of disk space for comfortable work, as the `node_modules` and `.next` folders require it. -4. **Configuration**: Open the project folder in VSCode. Install the recommended extensions from [.vscode/extensions.json](.vscode/extensions.json) and/or install the advanced VSCode configurations by using `pnpm reli:vscode` (choose the `default` preset for the best experience or the `ultimate` preset for the best experience). You can also refer to the [⚙️ Scripts](#scripts) and [🤔 FAQ](#faq) *RQ19* below to learn more about this script and its configurations. You can press `Cmd/Ctrl+F` and search for "`Q19`/`Q20`" if you want to install more extensions and settings (remember, more extensions mean slower VSCode). Then click `File > Exit` (VSCode will save all your open windows). Open VSCode again. Press `Ctrl+Shift+P` (or just `F1`) and search for `>Create New Terminal`, or just press **Cmd/Ctrl+Shift+~** *(on Windows make sure that it uses PowerShell 7.4+, click the arrow next to + ➞ Select Default Profile ➞ PowerShell)*. If VSCode prompts you to allow the usage of the project's TypeScript version, allow it if you're a Windows user. On other operating systems, you may or may not encounter path issues. -5. **Environment**: Run `pnpm install` (or `npx nypm install`) and/or, optionally, `install:global` to install the required packages. It is also recommended to configure `reliverse.config.ts` file. Then, optionally, you can use `pnpm deps:install-all`—especially `pnpm deps:install-all` (*this is currently an alpha script*)—to unlock some additional features, like the `eslint.config.ultimate.ts` preset (which will have a `.txt` extension by default starting with Relivator v1.3.0). (NOTE: As of Relivator v1.2.6, the `ultimate` preset is configured by default, so no action is required). Next, configure Relivator to meet your needs using the `pnpm reli:setup` and/or `pnpm reli:vscode` commands, and relaunch VSCode. You have two options: deploy with zero values in the `.env` file (resulting in just the frontend without features related to auth, database, pricing, etc.), or copy the `.env.example` file to a new `.env` file and fill in the values you want (everything is optional starting with Relivator v1.2.6). It is highly recommended to fill in the `DATABASE_URL` field. Then, set the database provider in `drizzle.config.ts` and make changes in related files if needed. Finally, send the database schema to the database using `pnpm db:push`. You can learn more about databases below in the current `README.md` file. -6. **Run, Stop, Build**: Run the app with `pnpm dev` or `pnpm turbo:dev` (interactive but unstable). Visit to check it out. Stop it by focusing on the console and pressing `Ctrl+C`. After making changes, build the app using `pnpm build` or `pnpm turbo:build`. *Don't worry if you see warnings related to Clerk, React Compiler, Babel, next-auth, etc. when running the build; these are known issues not related to Relivator.* Note that when using the pnpm [turbo:build](https://turbo.build) command, the VSCode terminal may not exit automatically. If this happens, press Cmd/Ctrl+C to close the process manually. -7. **Check, Commit, Deploy**: To check if the current codebase meets [@reliverse/standard](https://github.com/reliverse/standard), run `pnpm appts` (or `pnpm appts:noputout`, or `pnpm turbo:appts`, or `pnpm appts:nobuild`). Learn more about project scripts in the next section. If everything is fine, upload the project to your GitHub profile using GitHub Desktop. Finally, deploy it by importing the project into [Vercel](https://vercel.com/new), making the website publicly accessible on the internet. Alternatively, you can use `pnpm deploy` or just `vercel` to preview and inspect the local deployment without committing to GitHub every time. - -**It is recommended:** From time to time, run `pnpm reli:prepare`. This script executes `pnpm install`, which checks for issues or installs/removes manually added/removed dependencies in your `package.json` file. It also executes `pnpm latest`, which installs the latest versions of project dependencies. Finally, it runs `pnpm appts`, which will do its best to improve your code and check for any errors. **Note:** Since `pnpm latest` updates all packages to their latest versions, be aware that something in the code might break, especially if considerable time has passed since the last version of Relivator was released. Therefore, you can use, for example, the VSCode extension `Open Multiple Files` to easily find and fix broken code, or reach out to the [Relivator Discord server](https://discord.gg/Pb8uKbwpsJ) for assistance, or create a [GitHub Issue](https://github.com/blefnk/relivator-nextjs-template/issues). You can learn more about those scripts and the mentioned extension below in the current `README.md` file. - -**If you'd like** to share your work, get/provide feedback, or ask for help, feel free to do so either [in our Discord server](https://discord.gg/Pb8uKbwpsJ) or [via GitHub discussions](https://github.com/blefnk/relivator-nextjs-template/discussions). **Note:** Currently, the instructions above may be outdated. Please contact us if something goes wrong; everything will be updated in Relivator 1.3.0. - -## 🎶 Recommendation - -> Coding becomes a whole new experience with the right music, doesn't it? Enhance your workflow with Relivator and enjoy the soothing melodies from the [MF Piano YouTube channel](https://youtube.com/@mfpiano). This channel, run by my brother, offers beautiful piano covers that are perfect for background music. Your subscriptions, views, likes, and comments would mean the world to us and help his channel grow. Thank you for your support! - -## Scripts - -The project includes various scripts designed to enhance your developer experience. You can run any script using your terminal. Please note that some CLI scripts may require you to adjust the height of your terminal window to avoid UI anomalies. The Relivator allows you to use the following: - -1. **💪 Native Scripts**: These are commands configured in [package.json](package.json) and run by the package manager like [pnpm](https://pnpm.io), [bun](https://bun.sh), [yarn](https://yarnpkg.com), or [npm](https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager). You can run these "native" scripts using commands like `pnpm [dev|build]` and `pnpm db:[push|studio]`. -2. **⚙️ Custom-Built Scripts**: These scripts are written in TypeScript and Python by Reliverse and the community and are mostly located in the `addons` folder. 🔥 *Please be cautious when using transformation scripts, as they are all in their initial versions. Ensure you commit your changes to your [version control provider](https://about.gitlab.com/topics/version-control) (such as [GitHub](https://github.com)) before using any of them.* They can be executed via the command line using `[appts|addons|reli|lint|fix]:*` or manually via `pnpm tsx path/to/file` or `py path/to/file` (e.g., `py addons/scripts/reliverse/relimter/python/tasks/math-to-mathjs.py`). -3. **🐍 Python Script Manager**: Can be executed using `reli:manager` or `py addons/scripts/reliverse/relimter/python/index.py`. Before running it, please read the [🐍 Python](#python) section below to learn how to prepare your workspace to run this manager. - -### package.json - -Below are some scripts configured in the `scripts` section of the `package.json` file (*the following text may be outdated in some places, please let us know if you find any inaccuracies*): - -- **`pnpm appts` / `pnpm appts:putout` / `pnpm appts:verbose` / `pnpm appts:nobuild`**: These commands perform a comprehensive codebase check. They sequentially run `pnpm knip` for various codebase checks, `pnpm format` to format code with Biome (or Prettier, coming soon), and `pnpm lint` for linting with Biome and ESLint (`pnpm lint:eslint`). **Linting may take some time, so please be patient.** The `pnpm appts:putout` command also runs `pnpm lint:putout`. Using `pnpm appts:verbose` displays detailed ESLint progress, useful if you suspect ESLint is stuck (it may be slow, not stuck). You can manually resolve issues by pressing `Ctrl+S` multiple times in VSCode until there are no issues in the "Problems" tab. Usually, issues are resolved by the second or third run. If some specific issues persist, it may mean they are not automatically fixed. Please try to fix them manually, contact us, or disable the rule. Many rules in `eslint.config.js` are disabled by default; enable only what you need. You may also want to run `pnpm reli:setup` to choose the RulesDisabled preset if you want to disable all "error" and "warning" rules at once. `pnpm appts` then runs `pnpm typecheck` for remaining TypeScript errors and `pnpm build`, but you may try `pnpm turbo:appts`, which runs `pnpm turbo:build` to speed up builds using Turborepo v2. Note that **`pnpm turbo:appts`** is a faster, interactive version of `appts` but may not work well with the VSCode terminal. Alternatively, you can use `pnpm appts:nobuild`, which performs only checking, linting, formatting, and fixing, without building. -- **`pnpm fix:putout-unstable`**: [Putout](https://github.com/coderaiser/putout) is a linter and formatter. While the formatter fixes issues reported by the linter, the `fix:putout-unstable` command also makes changes not flagged by the linter. Ensure you commit your code before running this command, as it might cause unexpected changes. After running it, review and adjust the changes in your codebase using VSCode Source Control (Cmd/Ctrl+Shift+G) or GitHub Desktop. -- **`pnpm db:[push|studio|generate|migrate]`**: `push` converts the TypeScript Drizzle schema to SQL and sends it to the DATABASE_URL; `studio` runs Drizzle Studio on ; `migrate` applies migrations generated by the `generate` command (you may not need this command anymore), based on the `drizzle.config.ts` file. -- **`pnpm stripe:listen`**: Runs the Stripe webhook listener and helps set up Stripe environment variables. The [Stripe CLI](https://docs.stripe.com/stripe-cli) must be installed for this command to work. -- **`pnpm addons`**: This command allows you to headlessly run some of the scripts located in the `addons` folder. Many scripts are still not added there, so please check the `addons` folder and run them manually using `pnpm tsx path/to/file` or `py path/to/file`. This also includes the game @reliverse/academy. In the future, it will have many different interesting features. Currently, it is a quiz with a leaderboard and achievements where you can test your knowledge of Relivator, JavaScript, TypeScript, React, and even ESLint. -- **`reli:manager`**: Learn more in the [🐍 Python](#python) section below. This is the alias for the `py addons/scripts/reliverse/relimter/python/index.py` command. -- **`pnpm latest`**: Updates all project packages to their latest stable versions, including some specific packages to their latest versions on rc/beta/alpha/next/canary branches. -- **`pnpm reli:vscode [nothing|minimal|default|ultimate]`**: Enhances VSCode settings with presets by Reliverse. This script adjusts your `settings.json`, `extensions.json`, and `launch.json` files. It will prompt for confirmation before overriding current files. Use `RQ20` to learn more about `.vscode` presets and font installation for the `ultimate` preset, or use the `default` preset (which doesn't contain custom fonts and themes). Choose `default`, `minimal`, or `nothing` if your PC or virtual machine is very slow. -- **`pnpm reli:help`**: Displays useful information about Relivator and Reliverse. -- **`pnpm lint:compiler`**: Runs the React Compiler health check. Note that React Compiler is disabled by default; see the FAQ section for more details. -- **`pnpm tw:[v4|v3]`**: Switches between [Tailwind CSS](https://tailwindcss.com/) v3 and the alpha v4 version. **Important**: After using this command, adjust comments in `postcss.config.cjs`. **Also**: When using Tailwind CSS v4, remove or comment out `tailwindPlugin` from `eslint.config.js` as it doesn't support v4. Some additional changes in the codebase may be required. -- **`pnpm reli:prepare`**: Learn more about this script in the previous section (Cmd/Ctrl+F "It is recommended"). - -```bash -# pnpm tsx reliverse.config.ts --details -ℹ ▲ Framework: Relivator v1.2.6 ▲ Engine: Reliverse v0.4.0 ▲ Hotline: https://discord.gg/Pb8uKbwpsJ -ℹ Relivator v1.2.6 Release Blog Post 👉 https://reliverse.org/relivator/v126 -ℹ Help Relivator become even better! Please star the repo – https://github.com/blefnk/relivator -ℹ For experienced users: run 'pnpm reli:prepare' to update all dependencies to the latest versions and check if the code requires any adjustments. -ℹ Meet quality standards: run 'pnpm appts' and 'pnpm fix:putout-unstable' to get linting, formatting, and more. -ℹ Unstable: try 'pnpm turbo:dev' and faster build with 'pnpm turbo:build': https://turbo.build/repo -ℹ The reactCompiler is enabled in next.config.js - it uses webpack now, so builds take longer. -ℹ Clerk: make sure to connect the domain in the Clerk dashboard so services like PageSpeed will work. -ℹ Please find Q21 in the FAQ of README.md. Copy the adapted bun scripts and replace the current ones in package.json - scripts for other package managers coming soon. -``` - -### Python - -👋 Hello, dear friend! Nice to see you here! I (@blefnk Nazar Kornienko) have a dream of making the open-source world better and of higher quality. I aspire to leave my mark in history by ensuring people genuinely enjoy programming and create quality products. I'm particularly passionate about clean code. The book "Clean Code" by Robert Martin is a must-have! - -That's why I've developed numerous tools in Relivator. Over the past few months leading up to Relivator 1.2.6, I've learned a lot. To avoid manually rewriting code, I've developed a unified script manager. The current version of the manager is still very unstable. You can visit the `addons/scripts/reliverse/relimter/python/index.py` file to learn more about how this script manager works. - -If you want to use this `Python Script Manager` (refer to [⚙️ Script](#scripts) to read the introduction), then please ensure your workspace is properly prepared for it. Please note that most scripts are largely untested. Commit your code before running any script. Increase your VSCode terminal window size to avoid UI glitches. Need help? Visit our [Discord](https://discord.gg/Pb8uKbwpsJ). Follow the steps below to get started (scroll down to learn even more Python commands): - -✅ After following the instructions above, you can safely run the script manager. - -1. Install [Python](https://python.org/downloads) and [Ruff](https://docs.astral.sh/ruff/installation). Install the following VSCode extensions: [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and [Ruff](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff). -2. Create a new `.venv` folder by pressing `Cmd/Ctrl+Shift+P` and running `>Python: Create Environment...` (VSCode will prompt you to choose the Python interpreter; choose the one installed in step 1). Then, choose `requirements.txt` as the package dependencies file. -3. Please note, VSCode's terminal automatically activates the environment after each launch. You can verify this by hovering over a [pwsh|bash|cmd] button in VSCode's terminal and looking for something like "`Python`: Activated environment for `.\.venv\Scripts\python.exe`". However, if you are using another IDE or an external terminal, you may need to activate the virtual environment manually: [Windows] `.venv/Scripts/activate`; [macOS/Linux] `source .venv/bin/activate`. -4. Ensure all requirement are installed correctly, just run `pip install -r requirements.txt`. - -🐍 Everything ready? Nice! Congratulations! Try running the `Python Script Manager` now by executing: `reli:manager` or `py addons/scripts/reliverse/relimter/python/index.py` - -### Useful Python Commands - -*We are still working on this section. The following description may currently be slightly incorrect.* - -```bash -# - Install the required dependencies: -pip install -r requirements.txt - -# - Make sure you have `pip-tools` installed to use `pip-compile` and `pip-sync`: -pip install pip-tools - -# - You can create/update a `requirements.txt` file: -pip freeze > requirements.txt - -# - Sync the dependencies: -pip-sync requirements.txt - -# - Remove a specific package (e.g., torch): -pip uninstall torch -pip freeze > requirements.txt -``` - -*Please note: If you have [UV](https://github.com/astral-sh/uv) installed and you've used a command like `uv pip install InquirerPy` and it shows an error like "The wheel is invalid", the easiest solution is to just use regular pip commands like `pip install InquirerPy`.* - -## FAQ - -**This is not only a Reliverse-specific FAQ but also a developers' FAQ for Next.js and the React ecosystem in general.** - -- **RQ1:** How do I enable the brand new React 19's React Compiler? **RA1:** Please visit the `next.config.js` file, and inside the `experimental` section, find `reactCompiler` and set it to `true`. Additionally, it's recommended to install `pnpm -D babel-plugin-react-compiler`. There are great ESLint rules, but they are uninstalled by default because they enable Babel/Webpack, which may slow down the build. If you just installed this plugin, then open `eslint.config.js`, find, and uncomment things related to it (use `Cmd/Ctrl+F` and search for `compiler`). - -- **RQ2:** How do I ensure my code is fully auto-fixed? **RA2:** Please note that you may need to press Cmd/Ctrl+S a few times to have the code fully fixed by various tools. - -- **RQ3:** How can I check the project's health? **RA3:** Run `pnpm appts` or `pnpm turbo:appts` (unstable but interactive and faster) to check the project's health. - -- **RQ4:** How can I update all packages to the latest version? **RA4:** For experienced developers, run `pnpm latest` to update all packages to the latest version. Alternatively, use 'pnpm reli:prepare' to update all dependencies and check if the code requires any adjustments. - -- **RQ5:** Why do I sometimes see the notification `Invalid JSON. JSON5: invalid character '#'`? **RA5:** No worries, looks like you've `thinker.sort-json` VSCode extension installed, and it seems to be an incorrect error thrown by this extension. But it's not recommended to use external sort-json-like extensions, because we've configured `eslint-plugin-jsonc`, which already does sorting in the more predicted way. If you still need `thinker.sort-json`, looks like it can't sort JSON files in rare random cases, but it works fine on the next file save (if your file doesn't have issues, of course). If this error is causing significant problems, such as preventing you from adding a word to CSpell, you can set `source.fixAll.sort-json` to `never` in `editor.codeActionsOnSave` of `.vscode/settings.json`. - -- **RQ6:** What should I do if I notice outdated information or other issues in the README.md or other files? **RA6:** In an effort to be as helpful as possible, this README contains a wealth of information. Some text may be outdated and will be updated as we grow. Please let us know on the [discussion page](https://github.com/blefnk/relivator-nextjs-template/discussions/6) if you notice any small issues like outdated info, broken links, or grammatical/spelling errors in README.md or other files. - -- **RQ6:** What versions of React and Next.js does the project currently use? **RA6:** The project currently uses `react@canary`, `react-dom@canary`, and `next@canary`. If React 19 and/or Next.js 15 have already been fully released, please remove them from the `latest` script and run, for example, `npx nypm add react@latest react-dom@latest next@latest` in the terminal. You can do the same with any other rc-alpha-beta-next-canary-dev-experimental-etc dependencies, on your choice, if their stable version has already been released. - -- **RQ7:** Where should I store project-specific files, and how do I handle ESLint issues? **RA7:** You can use the `src/cluster` folder to store project-specific files. This makes it easy to update Relivator to new versions. Learn more by visiting the Dashboard's main page on the development environment. After doing this, be prepared to see many issues pointed out by the ESLint config. Run `pnpm lint` to apply auto-fixes; **linting can take some time, so please be patient**. You may need to run `lint` or `lint:eslint` again if some issues are not fixed automatically. You can also open those files manually and press `Ctrl+S` multiple times until there are no issues in the VSCode "Problems" tab. Typically, by using the CLI, the issues will be resolved by the second or third run. Next, install the `Open Multiple Files` extension in VSCode; right-click on the `src/cluster` folder, select `Open Multiple Files`, and press Enter. Fix all issues. If you are proceeding incrementally, you can suppress certain ESLint/Biome rules (`// eslint-disable-next-line ...`, `// biome-ignore ...`, or completely disable the rule in the relevant config) or TypeScript errors (`@ts-expect-error`), though this is not recommended. - -- **RQ8:** Weird things happening when formatting code? The code looks one way, and then the next second, it looks different? For example, you see the number of code lines increasing and then decreasing at the same time upon file saving? Without changing the code, does Biome notify you e.g. "Fixed 6 files" instead of "No fixes needed" when you rerun `pnpm appts`? **RA8:** Congrats! You've encountered a conflict between linters or formatters. First, we recommend opening the `.vscode/settings.json` file, finding the `eslint.rules.customizations` section, and changing the `severity` from `"off"` to `"info"` (if `"off"` is present). Setting it to `"info"` will help you realize that one of the conflicting parties is potentially a rule in that `eslint.rules.customizations`. Next, you can try to correct files like `eslint.config.js` (e.g., disable that conflicting rule), `biome.json`, `.vscode/settings.json`, etc. You can also try to disable Biome or ESLint formatters completely, by setting `biome.enabled` or `eslint.enable` (or `eslint.format.enable`) to "false" in the `.vscode/settings.json` file. What about that "Fixed 6 files" example? It means Biome changed code in some files in the way which is different from ESLint. - -- **RQ9:** What should I do if I get a Babel warning about code generator deoptimization? **RA9:** This is a known issue and can be ignored. One of the reason occurs because the React Compiler is not yet fully natively supported by Next.js, it temporarily enables Babel to make the Compiler work. Also, don't worry if you see warnings thrown by Clerk, next-auth, or others when running `pnpm build` (mainly on Windows and Node.js); it's okay, this is a known issue not related to Relivator. It is also okay if pnpm tells you `Issues with peer dependencies found`; you can hide this warning by editing `pnpm.overrides` in the `package.json` file. **P.S.** Ignore the `Unexpected value or character.` error from Biome if you see it in the `globals.css` file. This is a false error, which you can hide by filtering `!globals.css` or just `!**.css` in the VSCode's Problems tab (use `!**.css, !**/node_modules/**` there if VSCode's Biome extension parses node_modules for some unknown reason). - -- **RQ10:** Can I open multiple files in my VSCode? **RA10:** We recommend the `Open Multiple Files` extension. Just right-click on the desired folder, e.g., `src`, and choose "Open Multiple Files". - -- **RQ11:** I have a strange `Each child in a list should have a unique "key" prop`. Any tips? **RA11:** If you see something like `at meta / at head` below this error, or `, but the module factory is not available. It might have been deleted in an HMR update.`, first try disabling `experimental.instrumentationHook`, if you have it, in `next.config.js`. You can also try deleting the `.next` folder. Please contact us if the problem persists. - -- **RQ12:** Million Lint reports `Attempted import error: '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' is not exported from 'react' (imported as 'L').` during the A12#12 What should I do? **RA12:** The easiest solution is to copy the path to the component file that appears under this error and add it to `filter.exclude` in the `next.config.js` file. Generally, the key word is `use`. Click on the component path below this error. It seems Million has not listed every possible external `useSomething`. Many `useSomething` hooks work fine, but some may cause issues. This error is also triggered if you use `"use client";` but no client-specific features are utilized. In this case, remove this directive. Additionally, Million.js sometimes doesn't recognize the `import * as React from "react";` statement – so you need to remove it and explicitly import each React hook, type, etc. This line was removed from over 80 files in Relivator v1.2.6 for this reason. - -- **RQ13:** Why do I see a warning in the terminal containing the message `terminating connection due to immediate shutdown command`? **RA13:** This warning occurs because providers like Neon disconnect users from `localhost` if they are inactive for about 5 minutes. Simply refresh the page to restore the connection. - -- **RQ14:** How do I remove unused keys from JSON files? **RA14:** Install the `i18n Ally` VSCode extension, open its tab, click on refresh in the `usage report`, right-click on the found unused keys, and select remove. - -- **RQ15:** How can I grant admin rights to myself or another user? **RA15:** Run `pnpm db:studio`, navigate to the `${databasePrefix}_user` table, and set `role: admin` for the desired user. In the future, if you have admin rights, you will be able to change user privileges directly from the frontend admin page. - -- **RQ16:** What does the `DEMO_NOTES_ENABLED` environment variable mean? **RA16:** Do not use it. It is only used on the official [Relivator demo website](https://relivator.com) to showcase certain features that are not needed in real-world applications. - -- **RQ17:** I'm using PlanetScale as my database provider. After taking a break from the project, I'm now encountering an "unable to connect to branch" error. How can I fix this? **RA17:** Go to the PlanetScale dashboard and click on the `wake up` button. Please contact us if the database is not asleep and the problem persists. - -- **RQ18:** I have build/runtime errors indicating that Node.js utilities like `net`, `tls`, `perf_hooks`, and `fs` are not found. What should I do? **RA18:** Do not install these utilities; it won't fix the issue. Remember, never keep code in the `utils` folder that *can only run on the server*. Otherwise, you will encounter anomalies during the project build. For example, an error like `node:` and `file:` not found, or the package `fs`, `crypto`, etc. not found. Want to see the error for yourself? Move the file `src/server/react.ts` to `src/utils`, import it in this file, run `pnpm build`, get scared, remove the import, and move the file back to its place. You may find on the web the solutions suggesting to add configurations like `"node": { "net": "empty", "tls": "empty", "perf_hooks": "empty", "fs": "empty" }` or `"browser": { "net": false, "tls": false, "perf_hooks": false, "fs": false }` into `package.json` or to the webpack config, but these may not help you. **The main issue likely lies in the following:** You've triggered client-side code. For example, you might have a hook file in the `utils` folder with a corresponding `useEffect` React hook. To debug, try using the global search functionality in the IDE. Note that commenting out the lines may not be the quickest solution in this case, unlike in other debugging scenarios. - -- **RQ19:** I love all kinds of interesting things! Can you recommend any cool VSCode extensions? **RA19:** Of course! Just replace the current code in `.vscode/extensions.json` with the one from `addons/scripts/reliverse/presets/vscode/[default|minimal|ultimate]/extensions.json`. Remember, performance issues are possible, so you can just install what you want. Alternatively, you can just run the `pnpm reli:vscode` command to switch easily, and use `Cmd/Ctrl+Shift+P` ➞ `>Extensions: Show Recommended Extensions`. - - The best way to install this opinionated list of extensions, which are in the `ultimate` preset (although `default` is recommended by us), is to open the project folder in VSCode. Then, install them by using `Ctrl+Shift+P` (or just `F1`) and typing `>Extensions: Show Recommended Extensions`. Click on the cloud icon (`Install Workspace Recommended Extensions`). Wait for the completion. Click `File > Exit` (this will save all your open windows). Open VSCode again, and you are ready to go. The configuration for these extensions is already prepared for you. You can learn more about these extensions, which the `ultimate` preset contains, on the corresponding pages. - - *And, remember! If you have something broken, you always can find the default files content of `.vscode` folder in the `.vscode/presets/default` folder.* - -
- [Reveal the spoiler] - - This list may be outdated, and will be updated in Relivator v1.3.x. - - 1. [aaron-bond.better-comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) - 2. [adpyke.codesnap](https://marketplace.visualstudio.com/items?itemName=adpyke.codesnap) - 3. [astro-build.houston](https://marketplace.visualstudio.com/items?itemName=astro-build.houston) - 4. [biomejs.biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) - 5. [bradlc.vscode-tailwindcss](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) // tw v3 == release version | tw v4 == pre-release version - 6. [chunsen.bracket-select](https://marketplace.visualstudio.com/items?itemName=chunsen.bracket-select) - 7. [davidanson.vscode-markdownlint](https://marketplace.visualstudio.com/items?itemName=davidanson.vscode-markdownlint) - 8. [dbaeumer.vscode-eslint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - 9. [evondev.indent-rainbow-palettes](https://marketplace.visualstudio.com/items?itemName=evondev.indent-rainbow-palettes) - 10. [fabiospampinato.vscode-open-multiple-files](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-open-multiple-files) - 11. [github.copilot-chat](https://marketplace.visualstudio.com/items?itemName=github.copilot-chat) - 12. [github.github-vscode-theme](https://marketplace.visualstudio.com/items?itemName=github.github-vscode-theme) - 13. [lokalise.i18n-ally](https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally) - 14. [mattpocock.ts-error-translator](https://marketplace.visualstudio.com/items?itemName=mattpocock.ts-error-translator) - 15. [mikekscholz.pop-icon-theme](https://marketplace.visualstudio.com/items?itemName=mikekscholz.pop-icon-theme) - 16. [mylesmurphy.prettify-ts](https://marketplace.visualstudio.com/items?itemName=mylesmurphy.prettify-ts) - 17. [neptunedesign.vs-sequential-number](https://marketplace.visualstudio.com/items?itemName=neptunedesign.vs-sequential-number) - 18. [oderwat.indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow) - 19. [streetsidesoftware.code-spell-checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) - 20. [unifiedjs.vscode-mdx](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) - 21. [usernamehw.errorlens](https://marketplace.visualstudio.com/items?itemName=usernamehw.errorlens) - 22. [usernamehw.remove-empty-lines](https://marketplace.visualstudio.com/items?itemName=usernamehw.remove-empty-lines) - 23. [yoavbls.pretty-ts-errors](https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors) - 24. [yzhang.markdown-all-in-one](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one) - 25. [zardoy.ts-essential-plugins](https://marketplace.visualstudio.com/items?itemName=zardoy.ts-essential-plugins) - - **"TypeScript Essential Plugins" Extension Notes**: You can configure extension settings by opening VSCode Settings UI and searching for `@ext:zardoy.ts-essential-plugins` there. The quote from [VSCode Extension Repository](https://github.com/zardoy/typescript-vscode-plugins#readme): «Feature-complete TypeScript plugin that improves every single builtin feature such as completions, definitions, references and so on, and also adds even new TypeScript killer features, so you can work with large codebases faster! We make completions more informative. Definitions, references (and sometimes even completions) less noisy. And finally our main goal is to provide most customizable TypeScript experience for IDE features.» - -
- -- **RQ20:** *[Related to the previous question]* How can I improve my visual experience with VSCode? **RA20:** The project already has a well-configured `.vscode/settings.json`, but we recommend using our very opinionated configs presets. You have choice to install `default` or `ultimate` (`default` is recommended). **To activate the preset run `pnpm reli:vscode`.** For `ultimate` preset don't forget to install the required stuff: the static, means not variable, versions of [JetBrains Mono](https://jetbrains.com/lp/mono) (recommended) and/or [Geist Mono](https://vercel.com/font) and/or [Monaspace](https://monaspace.githubnext.com) (small manual configuration not or may be needed if you don't want to use `JetBrains Mono` on `ultimate` preset). Next, for `ultimate`, install the recommended `pop-icon-theme` VSCode icons pack extension. Finally, make sure to install the extensions from `Q19`, especially, install the recommended by us `GitHub Light` and `Houston` (by Astro developers) themes. Please note that after installing the Houston theme, you will find a new corresponding tab on the sidebar (🧑‍🚀 there is your new friend, which reacts while you've code issues!), you can of course remove this tab by right-clicking, but we recommend simply dragging this panel to the bottom of the Folders tab. - - - TODO: Fix 'Geist Mono' and 'Monaspace Argon Var', which looks like use Medium/Bold variation instead of Regular (`"editor.fontWeight": "normal"` doesn't help here). 'JetBrains Mono' works fine.* - - TODO: Do we really need to duplicate fonts for every single thing?* 🤔 - - - - - -- **RQ21:** How do I switch the package manager from `pnpm` to bun, yarn, or npm? **RA21:** Here's a variant of `scripts` for `bun`, but it not tested too much by us. Scripts presets for other package managers coming with Relivator 1.3.0. Just replace it in `package.json` (and make sure it don't miss anything). - -
- [Reveal the spoiler] - - Just find and remove `packageManager` key, if present, and then replace only these specific lines by bun's alternatives: - - ```json - { - "scripts": { - "check:compiler": "bunx react-compiler-healthcheck@latest", - "fix:codemod-next-community": "bunx @next/codemod --dry --print", - "fix:codemod-react": "bunx codemod react/19/replace-use-form-state --target src", - "install:global": "bun add -g vercel@latest codemod@latest eslint_d@latest", - "latest:all": "bun update --latest", - "putout:dont-run-manually": "bun lint:putout . --fix", - "reli:prepare": "bun install && bun latest && bun appts", - "rm:other": "bun fse remove .million && bun fse remove .eslintcache && bun fse remove tsconfig.tsbuildinfo" - } - } - ``` - -
- - After you have replaced the scripts, open the project folder and close VSCode. Delete `node_modules` and `pnpm-lock.yaml`. Open the project in a terminal and run `npx nypm install`. After that, you can reopen VSCode. You're done! - -- **RQ22:** I applied the `default`/`ultimate` preset settings in VSCode, and now my IDE is slow when I save a file. **RA22:** Go to the keybindings in VSCode, set `Save without Formatting` to `Ctrl+S` (`Cmd+S`), and `File: Save` to `Ctrl+Shift+S` (`Cmd+Shift+S`). Don't worry if the code might be messy when saving without formatting. Just run pnpm appts and everything will be improved and formatted. You're welcome! P.S. You can also read the VSCode's [Performance Issues](https://github.com/microsoft/vscode/wiki/Performance-Issues) article. - -
- [Reveal the spoiler] - - **keybindings.json** (`F1`->`>Preferences: Open Keyboard Shortcuts (JSON)`): - - ```json - [{ - "command": "workbench.action.files.save", - "key": "ctrl+shift+s" - }, { - "command": "workbench.action.files.saveWithoutFormatting", - "key": "ctrl+s" - }, { - "command": "workbench.action.nextEditor", - "key": "ctrl+tab" - }, { - "command": "workbench.action.previousEditor", - "key": "ctrl+shift+tab" - }] - ``` - -
- -- **RQ23:** What does index.ts do in the server and utils folders? **RA23:** These are called barrel files. You can make imports more convenient in your project by using the barrel approach. To do this, use index.ts files to re-export items from other files. Please note: keep code that can only run on the server in the server folder. Code that can run on both the server and client sides should be kept in the utils folder. Relivator 1.2.6 currently violates this description, so we should fix it in v1.3.0. Typically, server functions look like getDoSomething. Additionally, do not import code from the server folder into .tsx files that use React Hooks (useHookName), except when the component has useTransition or similar, which allows you to perform a server action from within the client component. - -- **RQ24:** Why do I see console.[log|info|warn|error|...] only in the browser console and not in the terminal from which the application was launched? **RA24:** If I (@blefnk) researched correctly, it is because you are calling console() in a client-side component (which has the "use client" directive at the top of the file or uses React Hooks). It looks like the terminal works as a server environment. Try calling console() in a file that does not have that directive and hooks. Or just use toasts which works nice with both on the client and the server side. - -- **RQ25:** I'm getting strange VSCode extension errors, what should I do? **RA25:** Don't worry, these are just editor anomalies. **Just restart your VSCode, and you're done.** Sometimes, due to insufficient RAM, internal extension failures, or other reasons, a particular extension might crash. Especially anomalous is the notification from TypeScript ESLint stating that it can have no more than 8 entry files (we will try to fix this in 1.3.0). Or Biome might start linting `node_modules` for some reason, which is also strange to us; our attempts to fix this so far have been unsuccessful, but we will try again in 13.0. Besides this, an extension crash might also happen if you just used `pnpm reli:setup` and didn't restart the editor. Or if you manually edited a configuration file and since autosave was enabled, the editor managed to send the configuration with syntax errors to the extension, causing everything to crash. So, restart VSCode, and everything will be fixed! If that doesn't help, check if your configuration files have any issues. - -- **RQ26:** How do I change VSCode's panel position? **RA26:** Just right-click on the panel, select `Panel Position`, and choose the desired position, e.g., `Bottom`. - -- **RQ27:** I have the correct data (key-value) specified in the `.env` file, but a certain library, for example, Clerk, does not see this data or sees outdated data. What can I do? **RA27:** The simplest solution is to just rename your project folder, run `pnpm install`, and check if the issue is resolved. Otherwise, contact the technical support and community of the respective library. - -- **RQ28:** How can I configure `pnpm` or `bun` (as package manager) for my needs? **RA28:** You can visit [this `pnpm` page](https://pnpm.io/package_json) or [this `bun` page](https://bun.sh/docs/runtime/bunfig#package-manager) in the official docs to learn more. - -**RQ29:** Should I modify the components by [shadcn/ui](https://ui.shadcn.com) (as of Relivator 1.2.6, they are located in the `"addons/components/ui"` folder)? **RA29:** You may lose your changes if @shadcn or [Reliverse](https://github.com/orgs/reliverse/repositories) updates any of these components in the release of Relivator 1.3.x+. Therefore, the best option currently is to use, for example, the `"addons/cluster/reliverse/shadcn/ui"` folder, where you can have files that you can safely overwrite the original files with, ensuring you do not lose your changes. As an example, this folder already contains a `cluster-readme.tsx` file, which only re-exports the original `button.tsx` file. So, you can create a `button.tsx` file here and copy and paste that line into your newly created file. Alternatively, you can duplicate the code from the original file and make any modifications you want. Use `Cmd/Ctrl+Shift+H` and simply replace `addons/components/ui` with `addons/cluster/reliverse/shadcn/ui` (the difference is only in the words `"browser"` and `"cluster"`). `addons/cluster` is your house; feel free to do anything you want here, mess it up or tidy it up as you wish. This is your own house, and no one has the right to take it away from you. - -- **RQ30:** Which command allows me to easily manage the installation of dependencies in a project? **RA30:** `pnpm deps:install`. However, before running this script, you should manually install the essentials: - - - npx nypm add typescript tsx nypm @mnrendra/read-package @clack/prompts - - npx nypm add fs-extra pathe fast-npm-meta semver @types/semver redrun axios - - bun|yarn|pnpm dlx jsr add @reliverse/core (or: npx jsr add @reliverse/core) - -- **RQ31:** I noticed a [Turborepo](https://turbo.build) file named `turbo.disabled.json`. How can I reactivate `turbo`? **RA31:** Simply remove the `.disabled` from the filename. You can also add the `"scripts"` from the `turbo.scripts.json` file to the `package.json` file (if they are not already there). - -- **RQ32:** Where can I find out more details about the Relivator and Reliverse? **RA32:** Read the current README.md file to learn more about each specific aspect of the project. You can also find more information on the project's [Discord](https://discord.gg/Pb8uKbwpsJ) server and on the [GitHub Issues](https://github.com/blefnk/relivator-nextjs-template/issues) page. - -## Details - -🌐 - -Screenshot showing the main page of the Relivator project - -We've laid the groundwork—now it's time to dive in and accelerate development. And yeah, have fun! Think of Relivator and Reliverse as a sandbox! It's like Minecraft; with Relivator, you can build anything, as creativity knows no bounds! Explore all the new features of Next.js 13-15 and many other web technologies right here, right now—with Relivator. - -> ~~Minecraft~~ Reliverse is to a large degree about having unique experiences that nobody else has had. The ~~levels~~ website templates are ~~randomly~~ elegantly ~~generated~~ bootstrapped, and you can build anything you want to build yourself. © ~~Markus Persson~~ [@blefnk](https://github.com/blefnk) - -For real, if you've been exploring which Next.js starter to select for your next project–the search can end here. **If you want a POWERHOUSE**—Relivator is suitable for every scenario—then **Relivator is definitely the starter you need**. Fork it right now! Relivator incorporates numerous features found in other templates and strives to push the limits of Next.js and React capabilities. With Relivator, the opportunities are boundless! - -You can even think of Relivator as a Next.js framework! So grab it and enjoy! And don't forget: feedback and stars mean the world to us. Hit that star button! Fork it! Your involvement propels the project to new heights! If you have coding skills, contributions are always welcome! - -If you run into issues, join our repository discussions, open an issue, or DM us on: [Discord](https://discord.gg/Pb8uKbwpsJ), [Twitter/X](https://x.com/blefnk), [Fiverr](https://fiverr.com/blefnk), [LinkedIn](https://linkedin.com/in/blefnk), or [Facebook](https://facebook.com/blefnk). - -This project has big plans, and we appreciate all the help we can get! If you're eager to contribute, check out the Project Roadmap above to see potential improvements for the project. Also, use `Cmd/Ctrl+Shift+F` in VSCode and search for `TODO:` to find areas that need attention. Please visit the **[Issues](https://github.com/blefnk/relivator-nextjs-template/issues)** tab for more opportunities to help out. - -## Project Structure - -**Only a few of the files are listed here.** This section will be updated in the future versions. - -- [.vscode](https://code.visualstudio.com) - - presets - - [extensions.json](https://code.visualstudio.com/docs/editor/extension-marketplace) - - [launch.json](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_launch-configuration-attributes) - - [settings.json](https://code.visualstudio.com/docs/getstarted/settings) -- src - - [env.js](https://create.t3.gg/en/usage/env-variables) - - [middleware.ts](https://nextjs.org/docs/app/building-your-application/routing/middleware) - - ... -- [biome.json](https://biomejs.dev/reference/configuration) -- [cspell.json](https://cspell.org/configuration) -- [eslint.config.js](https://eslint.org/docs/latest/use/configure/configuration-files) -- [knip.json](https://knip.dev/reference/configuration) -- [next.config.js](https://nextjs.org/docs/app/api-reference/next-config-js) -- [package.json](https://docs.npmjs.com/cli/v10/configuring-npm/package-json) -- [README.md](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) -- [reliverse.config.ts](https://github.com/blefnk/reliverse) -- [reset.d.ts](https://totaltypescript.com/ts-reset) -- [tsconfig.json](https://typescriptlang.org/docs/handbook/tsconfig-json.html) -- [typestat.json](https://github.com/JoshuaKGoldberg/TypeStat#readme) -- ... - -## Configuration - -**First thing first, refer to the [`.env.example`](.env.example) file as the guide. Simply copy data from it to a new `.env` file.** - -*The instructions below may be outdated, so please double-check them! We will fully update this README.md with the Relivator 1.3.0 release.* - -🎉 Everything is optional in `.env` file starting from Relivator 1.2.6! You can deploy Relivator without a .env file! But ensure you verify what's necessary. Though the application will run without certain variables, missing ones may deactivate specific features. - -Ensure that default values are defined for essential environment variables. Never store secrets in the `.env.example` file. For newcomers or repo cloners, use `.env.example` as a template to create the `.env` file, ensuring it's never committed. Update the schema in `/src/env.js` when adding new variables. - -Further [information about environment variables is available here](https://nextjs.org/docs/app/building-the-application/configuring/environment-variables). - -*A cleaner and improved version of this section is coming soon. Stay tuned!* - -In the 1.1.0 Relivator release, the `.env.example` file was greatly simplified and will be streamlined even further in upcoming versions. We aim to ensure that unspecified values will simply deactivate related functionality without halting app compilation. - -## Payments - -Refer to the [`.env.example`](.env.example) file as the guide for where and how to get all the important environment variable keys for Stripe, including webhooks for both localhost and deployment. - -Locally, install the [Stripe CLI](https://stripe.com/docs/stripe-cli) and run the command `pnpm stripe:listen` to initiate the Stripe webhook listener. This action connects Stripe to the account and generates a webhook key, which you can then set as an environment variable in Stripe's settings. - -When testing Stripe, you can use its test data: `4242424242424242` | `12/34` | `567` | `Random Name` | `Random Country`. - -Please refer to the [src/app/api/webhooks/stripe/route.ts](src/app/api/webhooks/stripe/route.ts) file for more details on how Stripe works in the app. You can also visit the [official Stripe repository](https://github.com/stripe/stripe-node#readme), where you'll find a lot of useful information. - -## Database - -Relivator uses [Drizzle ORM](https://orm.drizzle.team) for database management. By default, the project uses [Neon](https://neon.tech) (Serverless) with [PostgreSQL](https://neon.tech/docs/postgresql/introduction) as the database provider. The project has already followed [Drizzle's guide](https://orm.drizzle.team/learn/tutorials/drizzle-with-neon) on how to set up Drizzle with Neon Postgres. - -**August 4, 2024: Hot Update**: - -If you use `neon` as your database provider, you no longer need `pnpm db:studio`; simply use Drizzle Studio on [Neon's website](https://neon.tech) 🎉 - -For development databases without important data, you can use `pnpm db:push`. For production databases containing important data, it is recommended to use `pnpm db:generate` followed by `pnpm db:migrate`. - -> Drizzle Kit lets you alter you database schema and rapidly move forward with a [pnpm db:push](https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push) command. That’s very handy when you have remote databases like Neon, Planetscale or Turso. The 'push' command is ideal for quickly testing new schema designs or changes in a local development environment, allowing fast iterations without the overhead of managing migration files. © [Drizzle Team](https://orm.drizzle.team/learn/tutorials/drizzle-with-neon) - -**Drizzle Team**: If you want to iterate quickly during local development or if your project doesn’t require migration files, Drizzle offers a useful command called drizzle-kit push. **When do you need to use the ‘push’ command?** **1.** During the prototyping and experimentation phase of your schema on a local environment. **2.** When you are utilizing an external provider that manages migrations and schema changes for you (e.g., PlanetScale). **3.** If you are comfortable modifying the database schema before your code changes can be deployed. - -**Note**: NEXT_PUBLIC_DB_PROVIDER was removed in Relivator v1.2.6. To switch the provider from Neon, modify `drizzle.config.ts`. To use MySQL or LibSQL providers, update the files inside `src/db`. An automatic switcher is coming in Relivator version 1.3.x. - -*The instructions below may be outdated, so please double-check them! We will fully update this README.md with the Relivator 1.3.0 release.* - -Relivator is designed to effortlessly support both MySQL and PostgreSQL databases. While PostgreSQL and [Neon](https://neon.tech) are the default configurations, switching to MySQL provided by [Railway](https://railway.app?referralCode=sATgpf) or [PlanetScale](https://planetscale.com), or to PostgreSQL provided by [Railway](https://railway.app?referralCode=sATgpf) or [Vercel](https://vercel.com/storage/postgres) is straightforward. Adjust the database configuration inside [drizzle.config.ts](./drizzle.config.ts) and the `src/db/*` files accordingly. Although Relivator is optimized for these providers, other providers compatible with Drizzle and Auth.js (next-auth@beta/NextAuth.js) might also work with some additional setup. Full SQLite support is coming soon. - -To set up the `DATABASE_URL` in the `.env` file, refer to `.env.example`. Initiate a new database or propagate schema changes by executing the `pnpm db:push` command. This ensures that all changes made to the schema files in `src/db/*` are mirrored in the selected database provider. - -For database migrations, use the `pnpm db:generate` command, review the `drizzle` folder to ensure everything is correct, and run the `pnpm db:migrate` command when ready. If necessary, use `pnpm db:drop` to manage reversals in a controlled way. - -If you used Relivator before v1.2.6, you may remove the `drizzle` folder inside the root directory. **Possible outdated information:** Do not manually delete files from the `drizzle` directory. Instead, use the [`pnpm db:drop` command](https://orm.drizzle.team/kit-docs/commands#drop-migration) if a migration needs to be reversed. - -We ensure consistent database configuration by using the setup inside `drizzle.config.ts` and exporting configurations in `src/db/index.ts` and `src/db/schema/index.ts`. When selecting a database provider, comment out or remove unneeded providers in the `switch-case` of these files and remove related schema files as necessary. Additional adjustments in other files may also be required. An automatic switcher is coming soon in the Relivator v1.3.0 release. - -**Historical context**: In Relivator v1.1.0, we aimed to provide simultaneous support for both MySQL and PostgreSQL for Drizzle ORM. In future releases, we plan to integrate Prisma ORM, making the project even more inclusive. - -## Product Categories and Subcategories - -To edit product categories, please refer to the `MySQL`, `PostgreSQL`, or `LibSQL` corresponding schema file in the `src/db/schema` folder. - -After editing these files, don't forget to run `pnpm db:push` to apply the changes. Or run `pnpm generate` to create a sharable SQL, which another developers may apply with `pnpm migrate` to edit theirs database tables easily. - -Then, simply update the category names and subcategories in the [products file](src/constants/products.ts) accordingly. - -## Additional Notes About Stripe - -*The instructions below may be outdated, so please double-check them! We will fully update this README.md with the Relivator 1.3.0 release.* - -The Stripe webhook API route does not need to be invoked explicitly within the application, such as after a user selects a subscription plan or makes a purchase. Webhooks operate independently of user actions on the frontend and serve as a means for Stripe to relay events directly to the server. - -When an event occurs on Stripe's end, such as a successful payment, Stripe generates an event object. This object is then automatically sent to the endpoint you've specified, either in the Stripe Dashboard or, for testing purposes, in the `package.json` via the Stripe CLI. Finally, the server's API route receives the event and processes it accordingly. - -For example, when a user selects a subscription plan, you would typically first use Stripe's API to create either a `Payment Intent` or `Setup Intent` object. This action can be executed either on the client-side or the server-side. The frontend then confirms the payment using Stripe.js, thereby completing the payment or subscription setup process. - -The webhook is automatically triggered based on these events. There's no need to manually "call" the webhook route; Stripe manages this for you according to the settings in the Stripe Dashboard or in the `package.json` for local testing. - -After deploying the app, don't forget to specify the webhook URL in the Stripe Dashboard. Navigate to the Webhooks section and enter the following URL: `https://thedomain.com/api/webhooks/stripe`. - -In summary, there's no need to specify the path to the Stripe API route where the user selects a subscription plan. The webhook mechanism operates independently and is triggered automatically by Stripe. - -## Internationalization - -*Stay tuned for further expansions to this section in the future.* - -*The instructions below may be outdated, so please double-check them! We will fully update this README.md with the Relivator 1.3.0 release.* - -Multilingualism at Bleverse Reliverse vision is revered. We adore discussing it and plan to delve into the topic of Next.js 15 App Router internationalization in future writings. - -Presently, all languages are machine-translated. Future revisions by native speakers are planned. - -useTranslations works both on the server and client; we only need the getTranslations on async components. - -*Currently not available.* Use `pnpm lint:i18n` to verify the i18n files. The tool attempts to rectify issues when possible, offering features like ascending sort. No output means everything is in order. - -We are using *next-intl* for internationalization. Sometime we can use beta/rc versions as needed. Find more information about it [here](https://next-intl-docs.vercel.app/blog/next-intl-3-0) and [here](https://github.com/amannn/next-intl/pull/149). - -### How to add a new language - -*The process described below will be simplified and automated in the future. Please let us know if you have any further questions regarding the current process for adding languages.* - -1. We will need an [i18n code](https://saimana.com/list-of-country-locale-code/) (in the format `language-country`; the language code alone is sufficient, but it's not optimal for SEO). For example, let's take Chinese, for which I know the codes *zh-cn/zh-tw/zh-hk* are used. -2. Open the `messages` folder and create a `zh-cn.json` file with the example content: `{ "metadata": { "description": "建立更高效、更吸引人且更有利可图的在线商店:使用 Relivator" } }`. -3. Now open `src/i18n.ts` and add `"zh-cn": zh_cn` with the appropriate `import` at the top. -4. In the file `src/navigation.ts`, add the corresponding values to `locales` and `labels`. -5. Run `pnpm dev` and review the landing page header. If it appears correctly, you're ready to go. -6. Optionally, I recommend using the VSCode extension [i18n Ally](https://marketplace.visualstudio.com/items?itemName=Lokalise.i18n-ally), which makes machine translation easy. -7. Also optionally, install [specific CSpell language](https://github.com/streetsidesoftware/cspell-dicts#language-dictionaries) for full support of this language in VSCode (when using the "[Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)" extension). If the language is not available, try to find a word dictionary file on the web or make a new one (see CSpell docs). - -By the way, **if the country flag is not displayed**: open `src/localization-main.tsx`, go to *LocaleFlagIcon* and add the `else if`. Please visit the [flag-icons library website](https://flagicons.lipis.dev/) to see the code for the missing icon. The example for *zh-cn* will be: `} else if (baseLocale === "zh") { return