Skip to content

Commit

Permalink
Merge branch 'master' into fixes/ui-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Akshaygore1 committed Oct 17, 2024
2 parents 543a882 + 022d113 commit 58c0c2e
Show file tree
Hide file tree
Showing 31 changed files with 2,975 additions and 1,641 deletions.
9 changes: 9 additions & 0 deletions apps/console-electron/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"root": true,
"extends": ["@dicedb/eslint-config/next.js", "next/typescript"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true
},
"ignorePatterns": ["out"]
}
36 changes: 36 additions & 0 deletions apps/console-electron/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
12 changes: 12 additions & 0 deletions apps/console-electron/app/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Link from 'next/link';

export default function Another() {
return (
<div
className={`grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]`}
>
<Link href="/">Go back</Link>
<p>Dashboard Page</p>
</div>
);
}
Binary file added apps/console-electron/app/favicon.ico
Binary file not shown.
Binary file added apps/console-electron/app/fonts/GeistMonoVF.woff
Binary file not shown.
Binary file added apps/console-electron/app/fonts/GeistVF.woff
Binary file not shown.
27 changes: 27 additions & 0 deletions apps/console-electron/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
--background: #ffffff;
--foreground: #171717;
}

@media (prefers-color-scheme: dark) {
:root {
--background: #0a0a0a;
--foreground: #ededed;
}
}

body {
color: var(--foreground);
background: var(--background);
font-family: Arial, Helvetica, sans-serif;
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
35 changes: 35 additions & 0 deletions apps/console-electron/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import type { Metadata } from 'next';
import localFont from 'next/font/local';
import './globals.css';

const geistSans = localFont({
src: './fonts/GeistVF.woff',
variable: '--font-geist-sans',
weight: '100 900',
});
const geistMono = localFont({
src: './fonts/GeistMonoVF.woff',
variable: '--font-geist-mono',
weight: '100 900',
});

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
</html>
);
}
20 changes: 20 additions & 0 deletions apps/console-electron/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Link from 'next/link';

export default function Home() {
return (
<div
className={`grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]`}
>
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<h1 className="lg">DiceDB</h1>
<img

Check warning on line 10 in apps/console-electron/app/page.tsx

View workflow job for this annotation

GitHub Actions / Build and Test

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
width={48}
height={48}
src="https://avatars.githubusercontent.com/u/112580013?s=48&v=4"
alt="logo"
/>
<Link href="/dashboard">Home</Link>
</main>
</div>
);
}
25 changes: 25 additions & 0 deletions apps/console-electron/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { app, BrowserWindow } from 'electron';

function createWindow() {
const win = new BrowserWindow({
show: false,
useContentSize: true,
backgroundColor: '#0a0a0a',
});

win.once('ready-to-show', () => {
win.show();
});

if (app.isPackaged === false) {
win.loadURL('http://localhost:4000');
win.webContents.on('did-fail-load', (e, code, desc) => {
console.error(e, code, desc);
win.webContents.reloadIgnoringCache();
});
}
}

app.whenReady().then(() => {
createWindow();
});
6 changes: 6 additions & 0 deletions apps/console-electron/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

export default nextConfig;
33 changes: 33 additions & 0 deletions apps/console-electron/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@dicedb/console-electron",
"version": "0.1.0",
"private": true,
"main": "main.js",
"type": "module",
"scripts": {
"dev": "concurrently --kill-others \"next dev -p ${PORT-4000}\" \"electron .\"",
"dev:next": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint ."
},
"dependencies": {
"next": "14.2.15",
"react": "^18",
"react-dom": "^18"
},
"devDependencies": {
"@dicedb/eslint-config": "workspace:*",
"@dicedb/typescript-config": "workspace:*",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"concurrently": "^9.0.1",
"electron": "^32.2.0",
"eslint": "^8",
"eslint-config-next": "14.2.15",
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
}
}
8 changes: 8 additions & 0 deletions apps/console-electron/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('postcss-load-config').Config} */
const config = {
plugins: {
tailwindcss: {},
},
};

export default config;
19 changes: 19 additions & 0 deletions apps/console-electron/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { Config } from 'tailwindcss';

const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
],
theme: {
extend: {
colors: {
background: 'var(--background)',
foreground: 'var(--foreground)',
},
},
},
plugins: [],
};
export default config;
18 changes: 18 additions & 0 deletions apps/console-electron/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "@dicedb/typescript-config/nextjs.json",
"include": [
"next.config.mjs",
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx",
"**/*.mjs",
"**/*.js"
],
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules"]
}
31 changes: 27 additions & 4 deletions apps/playground-web/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,40 @@ import Link from 'next/link';

export default function Footer() {
return (
<footer className="bg-white border-t border-gray-100 py-12">
<footer
className="bg-white border-t border-gray-100 py-12"
data-testid="footer"
>
<div className="container mx-auto px-4">
<div className="grid grid-cols-1 md:grid-cols-4 gap-8">
<div>
<h3 className="text-gray-500 font-semibold mb-4 text-center">
<h3
className="text-gray-500 font-semibold mb-4 text-center"
data-testid="footer-heading"
>
DiceDB
</h3>
<Link
href="https://dicedb.io/get-started/installation/"
target="_blank"
data-testid="get-started-link"
>
<Button className="w-full !bg-red-600 hover:!bg-red-700 !text-white">
<Button
className="w-full !bg-red-600 hover:!bg-red-700 !text-white"
data-testid="get-started-button"
>
Get Started →
</Button>
</Link>
<Link href="https://github.com/dicedb/dice" target="_blank">
<Link
href="https://github.com/dicedb/dice"
target="_blank"
data-testid="github-link"
>
<Button
variant="outline"
className="!w-full mt-2 !border-1 !border-gray-700 bg-blue-50 hover:text-blue text-black hover:text-blue-600"
data-testid="github-button"
>
<GitHub className="mr-2 h-4 w-4" /> GitHub (4k+)
</Button>
Expand All @@ -40,6 +55,7 @@ export default function Footer() {
href="https://dicedb.io/get-started/installation"
target="_blank"
className="text-gray-600 hover:text-gray-900"
data-testid="quickstart-link"
>
Quickstart
</Link>
Expand All @@ -49,6 +65,7 @@ export default function Footer() {
href="https://dicedb.io/commands/get"
target="_blank"
className="text-gray-600 hover:text-gray-900"
data-testid="commands-link"
>
Commands
</Link>
Expand All @@ -58,6 +75,7 @@ export default function Footer() {
href="https://github.com/DiceDB/dice/tree/master/examples/leaderboard-go"
target="_blank"
className="text-gray-600 hover:text-gray-900"
data-testid="examples-link"
>
Examples
</Link>
Expand All @@ -73,6 +91,7 @@ export default function Footer() {
href="https://github.com/DiceDB/dice/tree/master/examples/leaderboard-go"
target="_blank"
className="text-gray-600 hover:text-gray-900"
data-testid="leaderboard-link"
>
Real-time Leaderboard
</Link>
Expand All @@ -88,6 +107,7 @@ export default function Footer() {
href="mailto:[email protected]"
target="_blank"
className="text-gray-600 hover:text-gray-900"
data-testid="contact-link"
>
Contact Us
</Link>
Expand All @@ -99,6 +119,7 @@ export default function Footer() {
target="_blank"
className="text-gray-400 hover:text-gray-600"
aria-label="People"
data-testid="people-icon-link"
>
<People className="h-6 w-6" />
</Link>
Expand All @@ -107,6 +128,7 @@ export default function Footer() {
target="_blank"
className="text-gray-400 hover:text-gray-600"
aria-label="Twitter"
data-testid="twitter-icon-link"
>
<Twitter className="h-6 w-6" />
</Link>
Expand All @@ -115,6 +137,7 @@ export default function Footer() {
target="_blank"
className="text-gray-400 hover:text-gray-600"
aria-label="GitHub"
data-testid="github-icon-link"
>
<GitHub className="h-6 w-6" />
</Link>
Expand Down
Loading

0 comments on commit 58c0c2e

Please sign in to comment.