• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    TypeScript
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Starter using Vite + React + TypeScript + Tailwind CSS. And already set up Firebase(v9), Prettier and ESLint.

⚡ vite-react-ts-tailwind-starter

Starter using Vite + React + TypeScript + Tailwind with Firebase.

Motivation

Improve building your faster prototyping by using Vite, TypeScript, React, TailwindCSS, Firebase.

This starter uses following libraries:

  • Vite
  • React
    • React Router
  • TypeScript
  • Tailwind CSS
    • daisyUI
  • Firebase(v9, modular)
  • ESLint
  • Prettier

Set up

mv .env.local.example .env.local
yarn
yarn dev

Firebase

If you DO NOT use Firebase, you should do:

  • Delete the Firebase-related code: you check Main.tsx, SignInButton.tsx, SignOutButton.tsx.
  • And then delete src/lib/firebase.ts
  • Run yarn remove firebase
  • Remove VITE_FIREBASE_* env values from .env.local

If you want to use Firebase, you should do:

Vite

Vite is a fast frontend build tool. According to the README, it consists of two major parts:

  • A dev server that serves your source files over native ES modules, with rich built-in features and astonishingly fast Hot Module Replacement (HMR).
  • A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production.

React

React is a JavaScript library for building user interfaces.

Due to its awesome renderer system, there are many React Renderor. So React can be not used only Web, for example, used by React Native.

Let's dive into React and Vite can use with React.

TypeScript

TypeScript is a superset of JavaScript. It is just one of NPM library, but it provides an original compiler.

When you use TypeScript with React, you can write JSX with TypeScript, called TSX. Then you can develop views written by Type-Safe template.

Tailwind CSS

Tailwind CSS is modern utility-first CSS framework. It provides many CSS rules, but these are purged when production builds. So developers do not worry about CSS asset size for performance optimization.

In VSCode, I recommend to use intellisense extension.

Frequently, React developers are worried about how to write CSS in TSX(JSX) template. You must choose from CSS Modules, styled-components, linaria, and so on. Additionally, CSS architecture is difficult about scoping, e.g. BEM, FLOCSS.

When you decide to use Tailwind, you only write utility-first CSS classes, you don't have to worry about them!

daisyUI

daisyUI is Tailwind CSS Components library.

It prepares components CSS classes such as 'btn'. If you provide 'btn' class to <button> element, then there should be placed completely designed button.

If you don't want to use it, just remove the package and remove config in tailwind.config.js.

Firebase

Firebase is a PaaS that makes us create hi-quality apps so easy and so fast.

This library is not suitable for everyone, but I think it is one of the best libraries for prototyping. Therefore, I have added it to this repository.

The Firebase js SDK has become very useful in version 9, with optimizations that greatly reduce bundle size.

How to Use

Please look at firebase.ts.

There you will find a set of utility functions to manipulate Firebase for the environment in which the Emulator is used.

Formatter and Linter

Already set up ESLint and Prettier. You can customize the rules.

NOTICE: The template does not use eslint-plugin-prettier and prettier-eslint. So I recommend that running commands individually. e.g. prettier && eslint.

Please read: https://prettier.io/docs/en/integrating-with-linters.html.

ToDo


Support me!

Buy Me A Coffee

More Repositories

1

anyway-merge-app

毎日誰かのプルリクを脳死でマージするアドベントカレンダー(2021/12/01〜)
TypeScript
41
star
2

suffering-and-remembering-promise

苦しんで覚えるPromise
TypeScript
21
star
3

use-aspida-caller

TypeScript
14
star
4

nextjs-microcms-tsx-jamstack-aspida-boilerplate

This is a Next.js^9.5 project bootstrapped with microCMS, aspida. And this is using TSX, Incremental Static Regeneration.
TypeScript
14
star
5

LaravelBookmark_FatController

Techpit教材用に作成したLaravelリポジトリ。あえてFatControllerになるように開発。
PHP
8
star
6

ui-npm-package-template

ReactベースでUIライブラリをnpmで公開するときのためのテンプレート
TypeScript
5
star
7

nextjs-firebase-v9-starter

Next.jsをベースに、Firebase JS SDKとChakra UIをセットアップしたリポジトリです。
TypeScript
4
star
8

mocksi

TypeScript
2
star
9

MogiMeijin

The software which can easily create a trial examination
C++
1
star
10

laravel-frankenphp

PHP
1
star
11

vite-react-playground

My experimental repository using Vite and React and TypeScript and so on.
TypeScript
1
star
12

nextjs-supabase-test

JavaScript
1
star
13

NotionToRaindrop

Exported Notion'page(html) will be converted HTML that can be imported in Raindrop(https://raindrop.io/)
JavaScript
1
star
14

Laravel_Search_Implements_Patterns

LaravelでDDDやクリーンアーキテクチャの手法を導入しつつ、検索系の処理を組み込むパターン集
PHP
1
star
15

indiv-recommend

個人開発がおすすめな理由
CSS
1
star
16

go-react-cssModules

GoをバックエンドにReact.jsをCSSModulesと一緒に動かしてみます。https://github.com/wadahiro/gin-react-boilerplateから作り変えています。
JavaScript
1
star