erp-starter Tailwind Templates

Erp Starter

vite, react, tailwind, shadcn, supabase

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

  • Configure the top-level parserOptions property like this:
   parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json', './tsconfig.node.json'],
    tsconfigRootDir: __dirname,
   },
  • Replace plugin:@typescript-eslint/recommended to plugin:@typescript-eslint/recommended-type-checked or plugin:@typescript-eslint/strict-type-checked
  • Optionally add plugin:@typescript-eslint/stylistic-type-checked
  • Install eslint-plugin-react and add plugin:react/recommended & plugin:react/jsx-runtime to the extends list

Tailwind

  • yarn add -D tailwindcss postcss autoprefixer
  • npx tailwindcss init -p
  • tailwind.config.js
    /** @type {import('tailwindcss').Config} */
    module.exports = {
      content: ["./src/**/*.{html,js}"],
      theme: {
        extend: {}
      },
      plugins: [],
    }
    
  /** index.css */
  @tailwind base;
  @tailwind components;
  @tailwind utilities;

Supabase

  • npm install @supabase/supabase-js

  • save env variables

    //.env
    VITE_SUPABASE_URL=YOUR_SUPABASE_URL
    VITE_SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEY
    
  • create supabaseClient.ts ``` import { createClient } from '@supabase/supabase-js'

    const supabaseUrl = import.meta.env.VITE_SUPABASE_URL const supabaseAnonKey = import.meta.env.VITE_SUPABASE_ANON_KEY

    export const supabase = createClient(supabaseUrl, supabaseAnonKey)

- generate type
  - cli
    - supabase gen types typescript --local > schema.gen.ts
  - github actions
    - create new file .github/workflows/generate-types.yml

Top categories

Loading Svelte Themes