Viact screenshot

Viact

Author Avatar Theme by Mr mostafa
Updated: 15 Aug 2022
40 Stars

Viact is a starter template for React TypeScript that uses Vitejs, which supports RTL for specific styles, proxy fetching API (to fix CORS errors) and a simple mock REST API server. Additionally, Is set up VScode, Storybook, ErrorBoundary, UnoCss (atomic CSS engine), Eslint, Prettier, and more.

Categories

Overview

The Viact theme is a Next.js template that combines various modern tools and libraries to create a powerful frontend development environment. It features React 18, React Router DOM, TypeScript, UnoCSS, EsLint, Prettier, PostCss, Conventional Commit, and more. The theme provides an intuitive folder structure and comes with several scripts for development, building, previewing, analyzing, and cleaning up files. It also includes support for Sass/Scss/Less and offers features like proxying API requests, mocking REST APIs, and minifying images automatically in production.

Features

  • Vite - Next Generation Frontend Tooling
  • React 18 - A JavaScript library for building user interfaces
  • React Router DOM - Routing library for React
  • TypeScript - Type checking for JavaScript
  • UnoCSS - Instant on-demand atomic CSS engine
  • Safety - HTTPS enabled by default in development
  • EsLint - Pluggable JavaScript linter
  • Prettier - Opinionated code formatter
  • PostCss - Supports RTL for specific styles & autoprefixer
  • Conventional Commit - Commit message conventions for Git
  • Absolute Import - Ability to use ~/… for absolute imports
  • Proxying API Requests - Proxying API requests in development
  • Mock REST APIs - Easiest way to mock REST APIs, based on json-server
  • Storybook - Documentation for UI components
  • Minify Images - Automatically minifies images in production
  • Support Sass/Scss/Less - Supports various CSS preprocessors

Installation

To get started with the Viact theme, follow these steps:

  1. Make sure you have Node.js 16 or higher installed.

  2. Install Yarn version 1 or higher.

  3. Clone the template repo from GitHub or create a new repo from this template on GitHub.

  4. Clone the repo to your local machine.

  5. Follow the folder structure provided in the theme.

  6. Use the available scripts for various tasks:

    • yarn run dev - Runs the app in development mode with HTTPS enabled.
    • yarn run dev:http - Runs the app in development mode without HTTPS.
    • yarn run build - Builds the app for production.
    • yarn run preview - Builds the app for production and runs it locally.
    • yarn run analyze - Builds the app for production and activates analyze mode.
    • yarn run reset - Resets and cleans unnecessary files and Git history.
    • yarn run mock:server - Runs the server for the fake REST API.
    • yarn run storybook - Runs the documentation for the UI components.
    • yarn run build-storybook - Builds the documentation for the UI components.

Summary

The Viact theme is a comprehensive Next.js template that combines popular frontend tools like Vite, React 18, and React Router DOM with additional features like TypeScript support, UnoCSS for atomic CSS, and convenient scripts for development, building, and previewing. It also provides options for proxying API requests, mocking REST APIs, and minifying images automatically. The theme supports various CSS preprocessors and follows conventional commit message conventions. With a well-defined folder structure and detailed installation instructions, the Viact theme offers a powerful and streamlined frontend development experience.