Vue Boilerplate with Vite, Tailwind CSS, Pinia, and Axios

saymenghour

Menghour Say

Posted on February 10, 2024

Vue Boilerplate with Vite, Tailwind CSS, Pinia, and Axios

Iā€™d like to share the most recent Vuejs boilerplate with you here. When you clone this repository, the boilerplate of Vue v3, Typescript, Vite, Vue Router, Pinia, Axios, Tailwind CSS, and Vue i18n for buildings efficient, faster, maintainable, and scalable for enterprise applications.

Image description

Github - Vue Boilerplate

šŸ“š Table of Contents

ā“ What's Included?

  • [x] Authentication: Provides a secure login system for users.
  • [x] Authorization: Implements role-based access control to manage user permissions.
  • [x] Multiple Language: Supports localization and enables users to switch between different languages.
  • [x] Theme (Light/Dark/System): Offers a choice of light, dark, or system-based theme for a personalized user experience.
  • [x] Form Validation: Includes form validation functionality to ensure data integrity and improve user experience.
  • [x] Error Handling: Handles and displays error messages in a user-friendly manner.
  • [x] API Integration: Integrates with external APIs to fetch data and provide dynamic content.
  • [ ] Responsive Design: Ensures the application is optimized for various screen sizes and devices.
  • [ ] Testing: Includes a test suite with unit tests and integration tests for reliable code quality.
  • [ ] Documentation: Provides comprehensive documentation to guide developers and users.

šŸ–‡ļø Core Dependencies

ā†‘ Back to top

Library Version Description
Vue Vue A progressive JavaScript framework for building user interfaces.
Vite Vite Next-generation frontend build tooling for fast and efficient development.
Typescript Typescript A superset of JavaScript that enhances the development experience with static typing.
Vue Router Vue Router Official router for Vue.js, used for managing application routes.
Vue i18n Vue i19n Internationalization plugin for Vue.js applications, enabling multi-language support.
Vue Query Vue i19n A data-fetching and state management library for Vue.js, with powerful data-fetching capabilities.
Pinia Pinia An intuitive store for Vue.js applications, providing centralized state management.
Axios Axios Promise-based HTTP client for making API requests.
Tailwind CSS Tailwind CSS A highly customizable CSS framework for rapid web development.

šŸ—‚ļø Project Structure

ā”œā”€ā”€ public/
ā”‚ ā”œā”€ā”€ assets
ā”‚ ā”‚ ā”œā”€ā”€ fonts
| | ā””ā”€ā”€ images
ā”‚ ā””ā”€ā”€ favicon.ico
ā”œā”€ā”€ src
ā”‚ ā”œā”€ā”€ assets
ā”‚ ā”‚ ā”œā”€ā”€ images
ā”‚ ā”‚ ā””ā”€ā”€ styles
ā”‚ ā”œā”€ā”€ components
ā”‚ ā”‚ ā”œā”€ā”€ PrivateOutlet
ā”‚ ā”‚ ā”œā”€ā”€ ui
ā”‚ ā”‚ ā””ā”€ā”€ ...
ā”‚ ā”œā”€ā”€ constants
ā”‚ ā”œā”€ā”€ hooks
ā”‚ ā”œā”€ā”€ http
ā”‚ ā”‚ ā”œā”€ā”€ axios
ā”‚ ā”‚ ā””ā”€ā”€ index.ts
ā”‚ ā”œā”€ā”€ layouts
ā”‚ ā”‚ ā”œā”€ā”€ MainLayout.ts
ā”‚ ā”‚ ā””ā”€ā”€ ...
ā”‚ ā”œā”€ā”€ locales
ā”‚ ā”‚ ā”œā”€ā”€ en
ā”‚ ā”‚ ā””ā”€ā”€ km
ā”‚ ā”œā”€ā”€ modules
ā”‚ ā”‚ ā”œā”€ā”€ authentication
ā”‚ ā”‚ ā”œā”€ā”€ current-user
ā”‚ ā”‚ ā”œā”€ā”€ dashboard
ā”‚ ā”‚ ā””ā”€ā”€ ...
ā”‚ ā”œā”€ā”€ router
ā”‚ ā”‚ ā”œā”€ā”€ privateRoutes.ts
ā”‚ ā”‚ ā”œā”€ā”€ publicRoutes.ts
ā”‚ ā”‚ ā””ā”€ā”€ ...
ā”‚ ā”œā”€ā”€ services
ā”‚ ā”œā”€ā”€ types
ā”‚ ā”œā”€ā”€ utils
ā”‚ ā”‚ ā”œā”€ā”€ common
ā”‚ ā”‚ ā”œā”€ā”€ crypto
ā”‚ ā”‚ ā””ā”€ā”€ ...
ā”‚ ā”œā”€ā”€ App.ts
ā”‚ ā””ā”€ā”€ main.ts
ā”œā”€ā”€ types
ā”œā”€ā”€ package.json
ā””ā”€ā”€ ...
.
Enter fullscreen mode Exit fullscreen mode




šŸš€ Getting Started

Prerequisites

ā†‘ Back to top

  1. Node Js version v20.10.0. The current Long Term Support (LTS) release is an ideal starting point.
  2. Visual Studio Code. Visual Studio Code is the free and open-sourced code editor. It is one of the top most editor used especially for JavaScript application development.

Recommended Plugin for VSCode

Installation

ā†‘ Back to top

  1. Clone this repository to your computer:

    https://github.com/saymenghour/vue3-enterprise-boilerplate.git
    cd vue3-enterprise-boilerplate
    code .
    
  2. Run command below to ignore git case-sensitive filename

    git config --global core.ignorecase false
    
  3. From the project's root directory, install the required packages (dependencies):

    pnpm install
    
  4. Create environment files:

    cp .env.example .env
    
  5. Set up the environment variables.

  6. To run the app on your local machine:

    pnpm dev
    
  7. Build for production

    pnpm build
    

    Happy Coding :)

šŸ’” Scripts

ā†‘ Back to top

The following scripts are available:

Script Action
pnpm install Installs the project dependencies.
pnpm dev Runs the application in development mode.
pnpm build Builds the production-ready optimized bundle.
pnpm preview Starts the preview server using Vite.
pnpm lint Runs ESLint to lint the project files and fix any issues.
pnpm format Formats the source code using Prettier.

šŸ“ License

This project is licensed under the MIT License.

šŸ’– šŸ’Ŗ šŸ™… šŸš©
saymenghour
Menghour Say

Posted on February 10, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related