Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed examples/public/quotes/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions examples/public/quotes/web/react-vite-tailwind/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
########### BASE URL ############
####### Paste the API Endpoint URL from freeAPI docs #######
VITE_BASE_URL = ""
########### BASE URL END ############
24 changes: 24 additions & 0 deletions examples/public/quotes/web/react-vite-tailwind/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
55 changes: 55 additions & 0 deletions examples/public/quotes/web/react-vite-tailwind/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Live Website Link

[Random Quote Generator](https://quotegenerator-three-henna.vercel.app)

## 🧠 Dependencies Used

1. React + Vite
2. Tailwind Css
3. tsParticles

## 🚀 Installation and Setup

1. **Fork** the repo to your GitHub account, then **clone** it to your local machine:
```bash
git clone https://github.com/your-username/repo-name.git
```

2. In the root folder, install dependencies:
```bash
npm i
```

3. Follow the Tailwind CSS setup guide for Vite:
👉 [Tailwind Vite Setup](https://tailwindcss.com/docs/installation/using-vite)

4. Install **tsParticles** library for animated background:
```bash
npm i @tsparticles/all
```

5. Go to **FreeAPI's documentation**, and find the "Get Quote by ID" section:
👉 [FreeAPI Docs](https://freeapi.hashnode.space/api-guide/apireference/getQuoteById)

6. Create a `.env` file in the root folder and paste the content from `.env.sample` into it.

7. Copy the API endpoint URL from the FreeAPI docs and modify it:
From:
```
https://api.freeapi.app/api/v1/public/quotes/{quoteId}
```
To:
```
https://api.freeapi.app/api/v1/public/quotes
```
Then paste this into the `BASE_url` key in your `.env` file (within quotes).

8. Save everything, then run the app:
```bash
clear
npm run dev
```

---

🎉 **Enjoy the app!** 🥳🥳
29 changes: 29 additions & 0 deletions examples/public/quotes/web/react-vite-tailwind/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'

export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
},
},
])
13 changes: 13 additions & 0 deletions examples/public/quotes/web/react-vite-tailwind/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quote Generator</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading