<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akash Parmar</title>
    <description>The latest articles on DEV Community by Akash Parmar (@akash_parmar).</description>
    <link>https://dev.to/akash_parmar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2173636%2F0afe519e-68e9-4102-ad0d-c4875ca04042.jpg</url>
      <title>DEV Community: Akash Parmar</title>
      <link>https://dev.to/akash_parmar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akash_parmar"/>
    <language>en</language>
    <item>
      <title>Starting the Roll-Dice Project with Vite</title>
      <dc:creator>Akash Parmar</dc:creator>
      <pubDate>Sun, 13 Oct 2024 09:31:00 +0000</pubDate>
      <link>https://dev.to/akash_parmar/starting-the-roll-dice-project-with-vite-4hkf</link>
      <guid>https://dev.to/akash_parmar/starting-the-roll-dice-project-with-vite-4hkf</guid>
      <description>&lt;p&gt;&lt;strong&gt;Welcome to the Roll-Dice Project!&lt;/strong&gt; This open-source web application, powered by the Tolgee &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://tolgee.io/" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftolgee.io%2Fassets%2Fimages%2Fpost-ai-6d514962f3af26e527cf4e4bfbef2ef6.png" height="400" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://tolgee.io/" rel="noopener noreferrer" class="c-link"&gt;
          Painless localization | Tolgee
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Open-source localization platform developers enjoy working with. Set up in seconds &amp;amp; speed up the translation process. Sign up for free. No credit card required.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftolgee.io%2Fimg%2Ffavicon.svg" width="35" height="35"&gt;
        tolgee.io
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
 platform, is designed to simulate a dice roll and generate spontaneous workout routines. The app supports multiple languages: English, Hindi, German, and French. Let’s get started!
&lt;h2&gt;
  
  
  Step 1: Create the Project Directory
&lt;/h2&gt;

&lt;p&gt;First, navigate to your desired (&amp;gt;demos/) location and create a new directory for your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir roll-dice
cd roll-dice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 2: Set Up the Vite React App
&lt;/h2&gt;

&lt;p&gt;Next, create a new Vite project using the following command:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest roll-dice --template react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This sets up a new Vite project with a React template. Navigate into the newly created directory:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd roll-dice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 3: Install Dependencies
&lt;/h2&gt;

&lt;p&gt;Install the necessary dependencies, including React, Material UI, react-three-fiber, and Tolgee:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @mui/material @emotion/react @emotion/styled @react-three/fiber tolgee

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Step 4: Set Up Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;To add Tailwind CSS, install it along with its peer dependencies:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init -p

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Update your tailwind.config.js file to specify the paths to your template using their documentation. &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://tailwindcss.com/docs/guides/vite" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftailwindcss.com%2Fapi%2Fog%3Fpath%3D%2Fdocs%2Fguides%2Fvite" height="420" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://tailwindcss.com/docs/guides/vite" rel="noopener noreferrer" class="c-link"&gt;
          Install Tailwind CSS with Vite - Tailwind CSS
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Setting up Tailwind CSS in a Vite project.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftailwindcss.com%2Ffavicons%2Ffavicon-32x32.png%3Fv%3D3" width="32" height="32"&gt;
        tailwindcss.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Clean up the default files in the src directory:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete the contents of App.jsx, index.css, and App.css.&lt;/li&gt;
&lt;li&gt;Create a new directory called components:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq62yp3sgrw3gp2olonv2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq62yp3sgrw3gp2olonv2.png" alt="First Screen" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Set Up Tolgee
&lt;/h2&gt;

&lt;p&gt;After installing the dependencies, create an app in Tolgee:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign Up or Log In: Visit the Tolgee website and sign up or log in.&lt;/li&gt;
&lt;li&gt;Create Your App: Once logged in, create a new app named Roll Dice.&lt;/li&gt;
&lt;li&gt;Generate Access Tokens: Create a Personal Access Token and Project API Key. Refer to the Tolgee &lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://tolgee.io/js-sdk/integrations/react/installation" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftolgee.io%2Fimg%2Fog-default.svg" height="396" class="m-0" width="1584"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://tolgee.io/js-sdk/integrations/react/installation" rel="noopener noreferrer" class="c-link"&gt;
          Installation | Tolgee
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Tolgee enables you to implement localization in your React application with ease. You can integrate Tolgee in your React application using Tolgee's SDK for React. To use this SDK, start by installing Tolgee for React.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ftolgee.io%2Fimg%2Ffavicon.svg" width="35" height="35"&gt;
        tolgee.io
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
 for detailed instructions.&lt;/li&gt;
&lt;li&gt;To integrate Tolgee, import the necessary libraries in your main.jsx. Create a Tolgee instance and render your app within a TolgeeProvider, ensuring smooth user experience while fetching translations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngk2bcp85cf4owc3fkxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fngk2bcp85cf4owc3fkxi.png" alt="Main Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set Up Your App:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;App.jsx&lt;/strong&gt;, manage the application's main functionality, toggling between components like Header, GameScreen, and NavBar, and utilizing the useTranslate hook for translations.&lt;br&gt;
Navbar and Language Selector Component&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdid84l6wbweavga0bqvu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdid84l6wbweavga0bqvu.png" alt="App Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**NavBar **component features a logo for refreshing the page and integrates the **LanguageSelector **for switching languages easily.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdevedkhzdllhwrvboyni.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdevedkhzdllhwrvboyni.png" alt="NavBar Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**GameScreen **Component Overview&lt;br&gt;
The GameScreen component is the interactive area, allowing users to roll dice and generate a workout routine. Key features include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dice Rolling Logic: The handleDiceRoll function randomly selects an exercise from a predefined list.&lt;/li&gt;
&lt;li&gt;Exercise Display: Selected exercises are displayed, each with a tutorial link.&lt;/li&gt;
&lt;li&gt;Restart Functionality: A restart button allows users to reset the game.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffia21bmwe0wb1dsus7r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffia21bmwe0wb1dsus7r1.png" alt="Game Screen Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tbza7w1c72t5nwdro3s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5tbza7w1c72t5nwdro3s.png" alt="Game Screen Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;VideoModal Component&lt;/strong&gt;&lt;br&gt;
The VideoModal displays tutorial videos for selected exercises in a responsive pop-up, enhancing the learning experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4s20afr0p0vdrib4nzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi4s20afr0p0vdrib4nzv.png" alt="Video Modal Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RollDice Component Overview&lt;/strong&gt;&lt;br&gt;
The RollDice component provides a 3D dice-rolling simulation using react-three-fiber. It features:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Texture Loading: Uses the useLoader hook to load textures for the dice faces.&lt;/li&gt;
&lt;li&gt;Rolling Logic: Begins to roll when triggered, with dynamic textures updating based on the roll result.&lt;/li&gt;
&lt;li&gt;Animation Handling: Uses useFrame to animate the dice and settle into its final position.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This component provides an engaging and interactive experience, combining 3D rendering with responsive animations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mwttouqo79rss9xya73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7mwttouqo79rss9xya73.png" alt="Roll Dice Component" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the complete source code, visit my GitHub &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://github.com/Akash-cloud001" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F74132002%3Fv%3D4%3Fs%3D400" height="460" class="m-0" width="460"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://github.com/Akash-cloud001" rel="noopener noreferrer" class="c-link"&gt;
          Akash-cloud001 (Akash Parmar) · GitHub
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Passionate Developer. Akash-cloud001 has 19 repositories available. Follow their code on GitHub.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg" width="32" height="32"&gt;
        github.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
, and don't forget to star the repo!

&lt;p&gt;Follow me on X &lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;a href="https://x.com/WebDHub" rel="noopener noreferrer"&gt;
      x.com
    &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>tolgee</category>
      <category>react</category>
      <category>tailwindcss</category>
      <category>reactthreefiber</category>
    </item>
  </channel>
</rss>
