Giter VIP home page Giter VIP logo

starter-fullstack's Introduction

starter-fullstack

This is a starter template to kick-start your Nuxt full-stack project

Note: the app comes with a localcert SSL at packages/common/dev for local development, generated with mkcert, you can install mkcert and generate your own certificate and replace it or install the localcert.crt to your trusted CA to remove the untrusted SSL warning

What's inside?

⏩ This template is powered by Turborepo.

😊 Out-of-the-box, this repo is configured for an SSG frontend Nuxt app, and a backend Hono app that will be the main API, to optimize on cost and simplicity.

  • The starter kit is still configured for 100% SSR support,
    Simply change the apps/frontend's build script to nuxt build to enable SSR building

🌩️ Utilizing SST Ion for Infrastructure-as-Code, with powerful Live development.

  • SST is 100% opt-in, by using sst CLI commands yourself, like sst dev,
    simply remove sst dependency and sst.config.ts if you want to use another solution.
  • currently only backend app is configured, which will deploy a Lambda with Function URL enabled

🔐 Comes with starter-kit for Kinde typescript-sdk, see: /apps/backend/api/auth

  • Add your env variables, activate the auth routes, profit$
  • Please note that by default backend comes with a cookies-based session manager, which have great DX, security and does not require an external database (which also means great performance), but as the backend is decoupled with the Nuxt's SSR server, it will not work well with SSR (the session/auth state is not shared).
    So if you use SSR, you could use the official Nuxt Kinde module or implement your own way to manage the session at apps/backend/src/middlewares/session.ts.
    • If you have a good session manager implementation, a PR is greatly appreciated!

Apps and Packages

(Click the hyperlink of each app to see its README detail)

  • frontend: a Nuxt app, configured same as starter-nuxt.
    • By default, /api/* routes is proxied to the backendUrl.
    • The rpcApi plugin will call the /api/* proxy if they're on the same domain (e.g: 127.0.0.1)
      • this mimics a production environment where the static frontend and the backend lives on the same domain at /api, which is the most efficient configuration for Cloudfront + Lambda Function Url

      • If the frontend and backend are on different domains then the backend will be called directly without proxy.
      • This could be configured in frontend's app.config.ts
  • backend: a Hono🔥 app.
  • @local/locales: a shared locales/i18n library powered by unplugin-sheet-i18n.
  • @local/common: a shared library that can contain constants, functions, types.
  • @local/common-vue: a shared library that can contain components, constants, functions, types for vue-based apps.
  • tsconfig: tsconfig.jsons used throughout the monorepo.

Each package/app is 100% TypeScript.

Utilities

This Turborepo has some additional tools already setup for you:

Build

To build all apps and packages, run the following command:
pnpm run build

Develop

To develop all apps and packages, run the following command:
pnpm run dev

It is recommended to do your local .env setup to .env.local of each app and use git update-index --skip-worktree to ignore the changes from being committed to the repo.

Remote Caching

Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.

By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:

npx turbo login

This will authenticate the Turborepo CLI with your Vercel account.

Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:

npx turbo link

Useful Links

Learn more about the power of Turborepo:

starter-fullstack's People

Contributors

namesmt avatar renovate[bot] avatar turbobot-temp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kusmin

starter-fullstack's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
.devcontainer/Dockerfile
github-actions
.github/workflows/frontend-to-pages.yml
  • actions/checkout v4
  • actions/cache v4
  • actions/setup-node v4
  • actions/configure-pages v5
  • actions/upload-pages-artifact v3
  • actions/deploy-pages v4
npm
apps/backend/package.json
  • @hono/node-server ^1.12.0
  • @kinde-oss/kinde-typescript-sdk ^2.9.1
  • @namesmt/hono-adapter-aws-lambda ^0.2.3
  • @vitest/coverage-v8 ^1.6.0
  • consola ^3.2.3
  • hono ^4.4.13
  • hono-sessions ^0.5.8
  • std-env ^3.7.0
  • tsx ^4.16.2
  • unbuild ^2.0.0
  • vitest ^1.6.0
apps/frontend/package.json
  • @kinde-oss/kinde-typescript-sdk ^2.9.1
  • @namesmt/vue-query-nuxt ^0.3.3
  • @nuxt/eslint ^0.3.13
  • @nuxt/image ^1.7.0
  • @nuxtjs/color-mode ^3.4.2
  • @nuxtjs/i18n ^8.3.1
  • @nuxtjs/seo 2.0.0-rc.10
  • @tanstack/query-persist-client-core ^5.51.1
  • @tanstack/vue-query ^5.51.1
  • @unocss/nuxt ^0.61.0
  • @vueuse/core ^10.11.0
  • @vueuse/nuxt ^10.11.0
  • class-variance-authority ^0.7.0
  • clsx ^2.1.1
  • dayjs ^1.11.11
  • destr ^2.0.3
  • embla-carousel ^8.1.6
  • embla-carousel-vue ^8.1.6
  • h3-proxy ^1.13.0
  • hono ^4.4.13
  • idb-keyval ^6.2.1
  • lucide-vue-next ^0.408.0
  • nuxt ^3.12.2
  • nuxt-primevue ^3.0.0
  • ohash ^1.1.3
  • primeicons ^7.0.0
  • radix-vue ^1.9.1
  • sass ^1.77.8
  • shadcn-nuxt ^0.10.4
  • tailwind-merge ^2.4.0
  • ufo ^1.5.3
  • unocss ^0.61.0
  • unocss-preset-animations ^1.1.0
  • unocss-preset-shadcn ^0.3.1
  • vue ^3.4.31
  • vue-router ^4.4.0
package.json
  • @antfu/eslint-config ^2.22.0
  • @dotenvx/dotenvx ^1.6.2
  • @types/aws-lambda 8.10.138
  • @unocss/eslint-plugin ^0.61.0
  • eslint ^9.7.0
  • lint-staged ^15.2.7
  • pathe ^1.1.2
  • simple-git-hooks ^2.11.1
  • std-env ^3.7.0
  • turbo ^2.0.6
  • typescript ^5.5.3
  • unocss ^0.61.0
  • node >=20.13.1
  • pnpm 9.5.0
packages/common-vue/package.json
  • vue ^3.4.31
packages/common/package.json
  • pathe ^1.1.2
packages/locales/package.json
  • unplugin-sheet-i18n ^0.4.9
packages/tsconfig/package.json
  • @vue/tsconfig ^0.5.1

  • Check this box to trigger a request for Renovate to run again on this repository

Add a non-cookie session manager for different domains usecase.

Currently our session manager & authentication flow uses an automatic user detection based on session cookies with hono-sessions, this allows a super great DX working with APIs from the backend.

But chrome is phasing out 3rd-party cookies, we need to add another session manager to support usecases where we use different domains for the frontend and backend, maybe a Bearer JWT that contains the session id? Where would we store the session data?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.