Skip to content

Commit

Permalink
feat: init ui
Browse files Browse the repository at this point in the history
  • Loading branch information
vharny committed Jan 23, 2024
1 parent 1988884 commit 4756af6
Show file tree
Hide file tree
Showing 23 changed files with 2,960 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ui/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions ui/.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?
30 changes: 30 additions & 0 deletions ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
13 changes: 13 additions & 0 deletions ui/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="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
33 changes: 33 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "search-engine",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@heroicons/react": "^2.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.3"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.17",
"eslint": "^8.55.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
"typescript": "^5.2.2",
"vite": "^5.0.8"
}
}
6 changes: 6 additions & 0 deletions ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
166 changes: 166 additions & 0 deletions ui/public/mock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"cost": 2839,
"facets": null,
"hits": [
{
"fields": {
"description": "Fish-like autosuggestions for zsh",
"name_with_owner": "zsh-users/zsh-autosuggestions",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/zsh-users/zsh-autosuggestions"
},
"id": "MDEwOlJlcG9zaXRvcnkxMzg4NjQ3Ng==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "Bart's Imgur uploader bash script",
"name_with_owner": "tremby/imgur.sh",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/tremby/imgur.sh"
},
"id": "MDEwOlJlcG9zaXRvcnk1MzEyMjk1OA==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "An arctic, north-bluish clean and elegant GNOME Terminal color theme.",
"name_with_owner": "nordtheme/gnome-terminal",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/nordtheme/gnome-terminal"
},
"id": "MDEwOlJlcG9zaXRvcnk3NzE3NTcxMA==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "Apps/CLIs/configs I use on macOS/iOS. Fish, Karabiner, Cursor..",
"name_with_owner": "nikitavoloboev/config",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/nikitavoloboev/config"
},
"id": "MDEwOlJlcG9zaXRvcnk1MzEzMzg2MQ==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "",
"name_with_owner": "nullbleed/fancy-motd",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/nullbleed/fancy-motd"
},
"id": "MDEwOlJlcG9zaXRvcnkxMzIzMjQyOTU=",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "A collection of ZSH frameworks, plugins, themes and tutorials.",
"name_with_owner": "unixorn/awesome-zsh-plugins",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/unixorn/awesome-zsh-plugins"
},
"id": "MDEwOlJlcG9zaXRvcnkyNDg3ODg3NQ==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "Desktop notifications for long-running commands in zsh.",
"name_with_owner": "marzocchi/zsh-notify",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/marzocchi/zsh-notify"
},
"id": "MDEwOlJlcG9zaXRvcnk1MzU5NTI1",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "The configuration framework for Zsh",
"name_with_owner": "sorin-ionescu/prezto",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/sorin-ionescu/prezto"
},
"id": "MDEwOlJlcG9zaXRvcnkxMTczNTIy",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "A Spotify Connect client that mostly Just Works™",
"name_with_owner": "dtcooper/raspotify",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/dtcooper/raspotify"
},
"id": "MDEwOlJlcG9zaXRvcnk5MjExMzYxNw==",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
},
{
"fields": {
"description": "🙃 A delightful community-driven (with 2,200+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.",
"name_with_owner": "ohmyzsh/ohmyzsh",
"primary_language.color": "#89e051",
"primary_language.name": "Shell",
"url": "https://github.com/ohmyzsh/ohmyzsh"
},
"id": "MDEwOlJlcG9zaXRvcnkyOTExMzc=",
"index": "data/ghs",
"score": 4.11386798070054,
"sort": ["_score"]
}
],
"max_score": 4.11386798070054,
"request": {
"explain": false,
"facets": null,
"fields": [
"name_with_owner",
"description",
"url",
"primary_language.name",
"primary_language.color"
],
"from": 0,
"highlight": null,
"includeLocations": false,
"query": {
"query": "primary_language.name:Shell"
},
"search_after": null,
"search_before": null,
"size": 10,
"sort": ["-_score"]
},
"status": {
"failed": 0,
"successful": 1,
"total": 1
},
"took": 387334,
"total_hits": 62
}

1 change: 1 addition & 0 deletions ui/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { Routes, Route } from "react-router-dom";
import Home from "./pages/Home";
import Results from "./pages/Results";

const App = () => (
<Routes>
<Route index path="/" element={<Home />} />
<Route path="/search" element={<Results />} />
</Routes>
);

export default App;
1 change: 1 addition & 0 deletions ui/src/assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4756af6

Please sign in to comment.