This commit is contained in:
Jasen Qin 2024-08-31 14:18:34 +10:00
parent fb45ff54e3
commit ce36845fb0
44 changed files with 0 additions and 25081 deletions

View File

@ -1,5 +0,0 @@
{
"extends": [
"next"
]
}

View File

@ -1,40 +0,0 @@
# 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
mydb
certificates

View File

@ -1 +0,0 @@
public-hoist-pattern[]=*@nextui-org/*

View File

@ -1,34 +0,0 @@
import '@testing-library/jest-dom'
import pl from 'nodejs-polars'
import { create_csv_database, add_row, print_head, delete_row_by_key, save_db } from '../app/database'
import { create_models } from '../app/model'
describe('DATABASE', () => {
it('DATA', () => {
const fooSeries = pl.Series("foo", [1, 2, 3])
let res = fooSeries.sum()
console.log(res)
let df = pl.readCSV("data/iris.csv")
})
it('create csv', () => {
let res = create_csv_database('csv_db/x.csv', { "a_key": ['initial'], "a_value": [''] })
print_head(res)
delete_row_by_key(res, "initial", "a_key")
add_row(res, { "a_key": ["x"], "a_value": ["y"] })
print_head(res)
save_db(res)
delete_row_by_key(res, "x", "a_key")
print_head(res)
})
it('creates pos model', () => {
create_models()
})
})

View File

@ -1,13 +0,0 @@
import '@testing-library/jest-dom'
import { render, screen } from '@testing-library/react'
import Page from '../app/page'
describe('Page', () => {
it('renders a heading', () => {
render(<Page />)
const heading = screen.getByRole('heading', { level: 1 })
expect(heading).toBeInTheDocument()
})
})

View File

@ -1,23 +0,0 @@
const level = require('level-rocksdb')
describe('Database', () => {
it('DB WORKS', () => {
// 1) Create our database, supply location and options.
// This will create or open the underlying RocksDB store.
const db = level('./mydb')
// 2) Put a key & value
// isnt this synchronous?
db.put('name', 'Level', function (err) {
if (err) return console.log('Ooops!', err) // some kind of I/O error
// 3) Fetch by key
db.get('name', function (err, value) {
if (err) return console.log('Ooops!', err) // likely the key was not found
// Ta da!
console.log('name=' + value)
})
})
})
})

View File

@ -1,14 +0,0 @@
import { Container, Row, Col, Button } from 'react-bootstrap'
export default function MyPage() {
return (
<Container>
<Row>
<Col>
<h1>Welcome to My Page</h1>
<Button variant="primary">Click Me</Button>
</Col>
</Row>
</Container>
)
}

View File

@ -1,46 +0,0 @@
import React from "react"
import { Button, Nav, Stack } from "react-bootstrap"
import 'bootstrap/dist/css/bootstrap.min.css'
import Link from "next/link"
const NavLink = (props: any) =>
<li className="nav-item">
<a className="nav-link" href={props.href}>
{props.children}
</a>
</li>
const Text = (props: any) =>
<p>{props.children}</p>
export default function Page() {
return (
<Stack direction="horizontal" gap={1} style={{ padding: '1rem' }}>
<Stack gap={1} style={{ padding: '1rem' }}>
<Text>Point of Sale</Text>
<Nav className="flex-column">
<NavLink href="/stocks">
Stocks
</NavLink>
<NavLink href="/quantities">
Quantities
</NavLink>
<NavLink href="/inventory">
Inventory
</NavLink>
<NavLink href="/logs">
Logs
</NavLink>
<NavLink href="/receipts">
Receipts
</NavLink>
</Nav>
</Stack>
<Stack gap={1} style={{ padding: '1rem', width: '100%', justifyContent: 'center', alignItems: 'center' }}>
<Text>Stuff</Text>
<Button style={{ maxWidth: 'fit-content' }}>Submit THIS</Button>
</Stack>
</Stack>
)
}

View File

@ -1,43 +0,0 @@
import pl, { DataFrame, Series } from 'nodejs-polars'
import fs from 'fs'
export interface CSVDatabase {
df: DataFrame
filepath: string
}
export function create_csv_database(filepath: string, initialData: any): CSVDatabase {
let df = DataFrame(initialData)
df.writeCSV(filepath)
return { df, filepath }
}
export function save_db(db: CSVDatabase) {
db.df.writeCSV(db.filepath)
}
export function add_row(db: CSVDatabase, row: any) {
let d = DataFrame(row)
db.df = db.df.vstack(d)
}
export function print_head(db: CSVDatabase) {
console.log(db.df.head())
}
export function delete_row_by_key(db: CSVDatabase, key: string, keyColumn: string) {
db.df = db.df.filter(pl.col(keyColumn).neq(pl.lit(key)))
}
export function select_columns(db: CSVDatabase, columns: string[]): DataFrame {
return db.df.select(...columns)
}
export function join_dataframes(db1: CSVDatabase, db2: CSVDatabase, on: string): DataFrame {
return db1.df.join(db2.df, { on, how: "inner" })
}
export function add_simple_index(db: CSVDatabase) {
const indices = Array.from(Array(db.df.height).keys()) // Create 0-N index
db.df = db.df.withColumn(pl.Series("index", indices))
}

View File

@ -1,5 +0,0 @@
html,
body {
max-width: 100%;
overflow-x: hidden;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1,125 +0,0 @@
"use client"
import React, { useState } from 'react'
import { Box, Container, Paper, Table, Button, TextInput, useMantineTheme, Flex, Image, Grid, Space, Divider } from '@mantine/core'
import NextImage from 'next/image'
import Prawn from "../images/aussietigerprawns.jpg"
interface InventoryItem {
id: number
name: string
price: number
quantity: number
}
async function fetchBlob(url: string) {
const response = await fetch(url)
return response.blob()
}
export default function InventoryPage() {
const theme = useMantineTheme()
const [items, setItems] = useState<InventoryItem[]>([])
const [name, setName] = useState('')
const [price, setPrice] = useState('')
const [quantity, setQuantity] = useState('')
const addItem = () => {
setItems([
...items,
{
id: items.length + 1,
name,
price: parseFloat(price),
quantity: parseInt(quantity),
},
])
setName('')
setPrice('')
setQuantity('')
}
const [imageSourceUrl, setImageSourceUrl] = React.useState("")
const downloadImageAndSetSource = async (imageUrl: any) => {
const image = await fetchBlob(imageUrl)
setImageSourceUrl(URL.createObjectURL(image))
}
return (
<Box>
<Container size="md" >
{/* <Paper >
<Table>
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Price</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
{items.map((item) => (
<tr key={item.id}>
<td>{item.id}</td>
<td>{item.name}</td>
<td>{item.price}</td>
<td>{item.quantity}</td>
</tr>
))}
</tbody>
</Table>
</Paper> */}
{/* use a grid */}
<Flex gap="md" style={{ marginTop: theme.spacing.md }}>
<TextInput
label="Item name"
placeholder="Enter item name"
value={name}
onChange={(event) => setName(event.currentTarget.value)}
/>
<TextInput
label="Price"
placeholder="Enter item price"
value={price}
onChange={(event) => setPrice(event.currentTarget.value)}
/>
<TextInput
label="Quantity"
placeholder="Enter item quantity"
value={quantity}
onChange={(event) => setQuantity(event.currentTarget.value)}
/>
<Button onClick={addItem}>Add item</Button>
</Flex>
</Container>
<Grid gutter={{ base: 5, xs: 'md', md: 'xl', xl: 'xl' }}>
<Grid.Col span={{ base: 6, md: 2, lg: 1 }}>
<NextImage width={150} src={Prawn} alt="ITEM" />
</Grid.Col>
<Grid.Col span={{ base: 6, md: 2, lg: 1 }}>
<NextImage width={150} src={Prawn} alt="ITEM" />
</Grid.Col>
<Grid.Col span={{ base: 6, md: 2, lg: 1 }}>
<NextImage width={150} src={Prawn} alt="ITEM" />
</Grid.Col>
<Grid.Col span={{ base: 6, md: 2, lg: 1 }}>
<NextImage width={150} src={Prawn} alt="ITEM" />
</Grid.Col>
</Grid>
{/* <Grid>
<Grid.Col span={{ base: 12, md: 6, lg: 3 }}>1</Grid.Col>
<Grid.Col span={{ base: 12, md: 6, lg: 3 }}>2</Grid.Col>
<Grid.Col span={{ base: 12, md: 6, lg: 3 }}>3</Grid.Col>
<Grid.Col span={{ base: 12, md: 6, lg: 3 }}>4</Grid.Col>
</Grid> */}
{/* why is there a scroll area on the grid */}
</Box>
)
}

View File

@ -1,27 +0,0 @@
import {
useQuery,
} from '@tanstack/react-query'
export default function Example() {
const { isPending, error, data } = useQuery({
queryKey: ['repoData'],
queryFn: () =>
fetch('https://api.github.com/repos/TanStack/query').then((res) =>
res.json(),
),
})
if (isPending) return 'Loading...'
if (error) return 'An error has occurred: ' + error.message
return (
<div>
<h1>{data.name}</h1>
<p>{data.description}</p>
<strong>👀 {data.subscribers_count}</strong>{' '}
<strong> {data.stargazers_count}</strong>{' '}
<strong>🍴 {data.forks_count}</strong>
</div>
)
}

View File

@ -1,36 +0,0 @@
import '@mantine/core/styles.css'
import {
hydrate,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
import { ColorSchemeScript, MantineProvider } from '@mantine/core'
import Providers from './query-provider'
import Search from './search'
export const metadata = {
title: 'My Mantine app',
description: 'I have followed setup instructions carefully',
}
import "./global.css"
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<head>
<ColorSchemeScript />
</head>
<body>
<Providers>
<MantineProvider>{children}</MantineProvider>
</Providers>
</body>
</html>
)
}

View File

@ -1,68 +0,0 @@
// point of sales model core
import { CSVDatabase } from "./database"
import { create_csv_database, print_head } from "./database"
interface Item {
id: string
name: string
price: number
// other properties...
}
interface Sale {
id: string
itemId: string
quantity: number
timestamp: Date
// other properties...
}
interface Inventory {
itemId: string
quantity: number
}
export function create_item_dataframe(items: Item[]): CSVDatabase {
const filepath = 'data/items.csv'
return create_csv_database(filepath, items)
}
export function create_sale_dataframe(sales: Sale[]): CSVDatabase {
const filepath = 'data/sales.csv'
const data = sales.map(sale => ({
...sale,
timestamp: sale.timestamp.toISOString() // Convert Date to string
}))
return create_csv_database(filepath, data)
}
export function create_inventory_dataframe(inventories: Inventory[]): CSVDatabase {
const filepath = 'data/inventory.csv'
return create_csv_database(filepath, inventories)
}
export function create_models() {
const items: Item[] = [
{ id: '1', name: 'Item 1', price: 100 },
{ id: '2', name: 'Item 2', price: 200 }
]
const sales: Sale[] = [
{ id: '1', itemId: '1', quantity: 2, timestamp: new Date() },
{ id: '2', itemId: '2', quantity: 1, timestamp: new Date() }
]
const inventories: Inventory[] = [
{ itemId: '1', quantity: 50 },
{ itemId: '2', quantity: 30 }
]
const itemDB = create_item_dataframe(items)
const saleDB = create_sale_dataframe(sales)
const inventoryDB = create_inventory_dataframe(inventories)
print_head(itemDB)
print_head(saleDB)
print_head(inventoryDB)
}

View File

@ -1,49 +0,0 @@
import { Container } from '@mantine/core'
import { Flex, Button } from '@mantine/core'
import React from "react"
const NavLink = (props: any) =>
<li className="nav-item">
<a className="nav-link" href={props.href}>
{props.children}
</a>
</li>
const Text = (props: any) =>
<p>{props.children}</p>
export default function Page() {
const demoProps = {
bg: 'var(--mantine-color-blue-light)',
h: 50,
mt: 'md',
}
return (
<>
<Container {...demoProps}>Default Container</Container>
<Container size="xs" {...demoProps}>
xs Container
</Container>
<Container px={0} size="30rem" {...demoProps}>
30rem Container without padding
</Container>
<Flex
mih={50}
bg="rgba(0, 0, 0, .3)"
gap="md"
justify="flex-start"
align="flex-start"
direction="row"
wrap="wrap"
>
<Button>Button 1</Button>
<Button>Button 2</Button>
<Button>Button 3</Button>
</Flex>
</>
)
}

View File

@ -1,13 +0,0 @@
// app/providers.jsx
'use client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { useState } from 'react'
export default function Providers({ children }: any) {
const [queryClient] = useState(() => new QueryClient())
return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
}

View File

@ -1,54 +0,0 @@
//@ts-nocheck
"use client"
import React, { useState } from 'react'
import Fuse from 'fuse.js'
const data = [
{ title: 'Document 1', content: 'Content of document 1', url: '/inventory' },
{ title: 'Document 2', content: 'Content of document 2', url: '/about' },
]
const fuse = new Fuse(data, {
keys: ['title', 'content'],
})
const Search = () => {
const [query, setQuery] = useState('')
const [results, setResults] = useState([])
const handleSearch = (event: any) => {
const { value } = event.target
setQuery(value)
if (value.trim()) {
const searchResults = fuse.search(value).map(({ item }) => item)
setResults(searchResults)
} else {
setResults([])
}
}
return (
<div>
<input
type="text"
value={query}
onChange={handleSearch}
placeholder="Search documentation"
/>
<ul>
{results.map((result, index) => (
<li key={index}>
<a href={result.url}>
<h3>{result.title}</h3>
<p>{result.content}</p>
</a>
</li>
))}
</ul>
</div>
)
}
export default Search

View File

@ -1,12 +0,0 @@
import Link from 'next/link'
import Button from 'react-bootstrap/Button'
export default function Page() {
return (
<Link href="/">
<Button>
Hi
</Button>
</Link>
)
}

View File

@ -1,2 +0,0 @@
a_key,a_value
x,y
1 a_key a_value
2 x y

View File

@ -1,3 +0,0 @@
itemId,quantity
1,50.0
2,30.0
1 itemId quantity
2 1 50.0
3 2 30.0

View File

@ -1,151 +0,0 @@
"sepal.length","sepal.width","petal.length","petal.width","variety"
5.1,3.5,1.4,.2,"Setosa"
4.9,3,1.4,.2,"Setosa"
4.7,3.2,1.3,.2,"Setosa"
4.6,3.1,1.5,.2,"Setosa"
5,3.6,1.4,.2,"Setosa"
5.4,3.9,1.7,.4,"Setosa"
4.6,3.4,1.4,.3,"Setosa"
5,3.4,1.5,.2,"Setosa"
4.4,2.9,1.4,.2,"Setosa"
4.9,3.1,1.5,.1,"Setosa"
5.4,3.7,1.5,.2,"Setosa"
4.8,3.4,1.6,.2,"Setosa"
4.8,3,1.4,.1,"Setosa"
4.3,3,1.1,.1,"Setosa"
5.8,4,1.2,.2,"Setosa"
5.7,4.4,1.5,.4,"Setosa"
5.4,3.9,1.3,.4,"Setosa"
5.1,3.5,1.4,.3,"Setosa"
5.7,3.8,1.7,.3,"Setosa"
5.1,3.8,1.5,.3,"Setosa"
5.4,3.4,1.7,.2,"Setosa"
5.1,3.7,1.5,.4,"Setosa"
4.6,3.6,1,.2,"Setosa"
5.1,3.3,1.7,.5,"Setosa"
4.8,3.4,1.9,.2,"Setosa"
5,3,1.6,.2,"Setosa"
5,3.4,1.6,.4,"Setosa"
5.2,3.5,1.5,.2,"Setosa"
5.2,3.4,1.4,.2,"Setosa"
4.7,3.2,1.6,.2,"Setosa"
4.8,3.1,1.6,.2,"Setosa"
5.4,3.4,1.5,.4,"Setosa"
5.2,4.1,1.5,.1,"Setosa"
5.5,4.2,1.4,.2,"Setosa"
4.9,3.1,1.5,.2,"Setosa"
5,3.2,1.2,.2,"Setosa"
5.5,3.5,1.3,.2,"Setosa"
4.9,3.6,1.4,.1,"Setosa"
4.4,3,1.3,.2,"Setosa"
5.1,3.4,1.5,.2,"Setosa"
5,3.5,1.3,.3,"Setosa"
4.5,2.3,1.3,.3,"Setosa"
4.4,3.2,1.3,.2,"Setosa"
5,3.5,1.6,.6,"Setosa"
5.1,3.8,1.9,.4,"Setosa"
4.8,3,1.4,.3,"Setosa"
5.1,3.8,1.6,.2,"Setosa"
4.6,3.2,1.4,.2,"Setosa"
5.3,3.7,1.5,.2,"Setosa"
5,3.3,1.4,.2,"Setosa"
7,3.2,4.7,1.4,"Versicolor"
6.4,3.2,4.5,1.5,"Versicolor"
6.9,3.1,4.9,1.5,"Versicolor"
5.5,2.3,4,1.3,"Versicolor"
6.5,2.8,4.6,1.5,"Versicolor"
5.7,2.8,4.5,1.3,"Versicolor"
6.3,3.3,4.7,1.6,"Versicolor"
4.9,2.4,3.3,1,"Versicolor"
6.6,2.9,4.6,1.3,"Versicolor"
5.2,2.7,3.9,1.4,"Versicolor"
5,2,3.5,1,"Versicolor"
5.9,3,4.2,1.5,"Versicolor"
6,2.2,4,1,"Versicolor"
6.1,2.9,4.7,1.4,"Versicolor"
5.6,2.9,3.6,1.3,"Versicolor"
6.7,3.1,4.4,1.4,"Versicolor"
5.6,3,4.5,1.5,"Versicolor"
5.8,2.7,4.1,1,"Versicolor"
6.2,2.2,4.5,1.5,"Versicolor"
5.6,2.5,3.9,1.1,"Versicolor"
5.9,3.2,4.8,1.8,"Versicolor"
6.1,2.8,4,1.3,"Versicolor"
6.3,2.5,4.9,1.5,"Versicolor"
6.1,2.8,4.7,1.2,"Versicolor"
6.4,2.9,4.3,1.3,"Versicolor"
6.6,3,4.4,1.4,"Versicolor"
6.8,2.8,4.8,1.4,"Versicolor"
6.7,3,5,1.7,"Versicolor"
6,2.9,4.5,1.5,"Versicolor"
5.7,2.6,3.5,1,"Versicolor"
5.5,2.4,3.8,1.1,"Versicolor"
5.5,2.4,3.7,1,"Versicolor"
5.8,2.7,3.9,1.2,"Versicolor"
6,2.7,5.1,1.6,"Versicolor"
5.4,3,4.5,1.5,"Versicolor"
6,3.4,4.5,1.6,"Versicolor"
6.7,3.1,4.7,1.5,"Versicolor"
6.3,2.3,4.4,1.3,"Versicolor"
5.6,3,4.1,1.3,"Versicolor"
5.5,2.5,4,1.3,"Versicolor"
5.5,2.6,4.4,1.2,"Versicolor"
6.1,3,4.6,1.4,"Versicolor"
5.8,2.6,4,1.2,"Versicolor"
5,2.3,3.3,1,"Versicolor"
5.6,2.7,4.2,1.3,"Versicolor"
5.7,3,4.2,1.2,"Versicolor"
5.7,2.9,4.2,1.3,"Versicolor"
6.2,2.9,4.3,1.3,"Versicolor"
5.1,2.5,3,1.1,"Versicolor"
5.7,2.8,4.1,1.3,"Versicolor"
6.3,3.3,6,2.5,"Virginica"
5.8,2.7,5.1,1.9,"Virginica"
7.1,3,5.9,2.1,"Virginica"
6.3,2.9,5.6,1.8,"Virginica"
6.5,3,5.8,2.2,"Virginica"
7.6,3,6.6,2.1,"Virginica"
4.9,2.5,4.5,1.7,"Virginica"
7.3,2.9,6.3,1.8,"Virginica"
6.7,2.5,5.8,1.8,"Virginica"
7.2,3.6,6.1,2.5,"Virginica"
6.5,3.2,5.1,2,"Virginica"
6.4,2.7,5.3,1.9,"Virginica"
6.8,3,5.5,2.1,"Virginica"
5.7,2.5,5,2,"Virginica"
5.8,2.8,5.1,2.4,"Virginica"
6.4,3.2,5.3,2.3,"Virginica"
6.5,3,5.5,1.8,"Virginica"
7.7,3.8,6.7,2.2,"Virginica"
7.7,2.6,6.9,2.3,"Virginica"
6,2.2,5,1.5,"Virginica"
6.9,3.2,5.7,2.3,"Virginica"
5.6,2.8,4.9,2,"Virginica"
7.7,2.8,6.7,2,"Virginica"
6.3,2.7,4.9,1.8,"Virginica"
6.7,3.3,5.7,2.1,"Virginica"
7.2,3.2,6,1.8,"Virginica"
6.2,2.8,4.8,1.8,"Virginica"
6.1,3,4.9,1.8,"Virginica"
6.4,2.8,5.6,2.1,"Virginica"
7.2,3,5.8,1.6,"Virginica"
7.4,2.8,6.1,1.9,"Virginica"
7.9,3.8,6.4,2,"Virginica"
6.4,2.8,5.6,2.2,"Virginica"
6.3,2.8,5.1,1.5,"Virginica"
6.1,2.6,5.6,1.4,"Virginica"
7.7,3,6.1,2.3,"Virginica"
6.3,3.4,5.6,2.4,"Virginica"
6.4,3.1,5.5,1.8,"Virginica"
6,3,4.8,1.8,"Virginica"
6.9,3.1,5.4,2.1,"Virginica"
6.7,3.1,5.6,2.4,"Virginica"
6.9,3.1,5.1,2.3,"Virginica"
5.8,2.7,5.1,1.9,"Virginica"
6.8,3.2,5.9,2.3,"Virginica"
6.7,3.3,5.7,2.5,"Virginica"
6.7,3,5.2,2.3,"Virginica"
6.3,2.5,5,1.9,"Virginica"
6.5,3,5.2,2,"Virginica"
6.2,3.4,5.4,2.3,"Virginica"
5.9,3,5.1,1.8,"Virginica"
1 sepal.length sepal.width petal.length petal.width variety
2 5.1 3.5 1.4 .2 Setosa
3 4.9 3 1.4 .2 Setosa
4 4.7 3.2 1.3 .2 Setosa
5 4.6 3.1 1.5 .2 Setosa
6 5 3.6 1.4 .2 Setosa
7 5.4 3.9 1.7 .4 Setosa
8 4.6 3.4 1.4 .3 Setosa
9 5 3.4 1.5 .2 Setosa
10 4.4 2.9 1.4 .2 Setosa
11 4.9 3.1 1.5 .1 Setosa
12 5.4 3.7 1.5 .2 Setosa
13 4.8 3.4 1.6 .2 Setosa
14 4.8 3 1.4 .1 Setosa
15 4.3 3 1.1 .1 Setosa
16 5.8 4 1.2 .2 Setosa
17 5.7 4.4 1.5 .4 Setosa
18 5.4 3.9 1.3 .4 Setosa
19 5.1 3.5 1.4 .3 Setosa
20 5.7 3.8 1.7 .3 Setosa
21 5.1 3.8 1.5 .3 Setosa
22 5.4 3.4 1.7 .2 Setosa
23 5.1 3.7 1.5 .4 Setosa
24 4.6 3.6 1 .2 Setosa
25 5.1 3.3 1.7 .5 Setosa
26 4.8 3.4 1.9 .2 Setosa
27 5 3 1.6 .2 Setosa
28 5 3.4 1.6 .4 Setosa
29 5.2 3.5 1.5 .2 Setosa
30 5.2 3.4 1.4 .2 Setosa
31 4.7 3.2 1.6 .2 Setosa
32 4.8 3.1 1.6 .2 Setosa
33 5.4 3.4 1.5 .4 Setosa
34 5.2 4.1 1.5 .1 Setosa
35 5.5 4.2 1.4 .2 Setosa
36 4.9 3.1 1.5 .2 Setosa
37 5 3.2 1.2 .2 Setosa
38 5.5 3.5 1.3 .2 Setosa
39 4.9 3.6 1.4 .1 Setosa
40 4.4 3 1.3 .2 Setosa
41 5.1 3.4 1.5 .2 Setosa
42 5 3.5 1.3 .3 Setosa
43 4.5 2.3 1.3 .3 Setosa
44 4.4 3.2 1.3 .2 Setosa
45 5 3.5 1.6 .6 Setosa
46 5.1 3.8 1.9 .4 Setosa
47 4.8 3 1.4 .3 Setosa
48 5.1 3.8 1.6 .2 Setosa
49 4.6 3.2 1.4 .2 Setosa
50 5.3 3.7 1.5 .2 Setosa
51 5 3.3 1.4 .2 Setosa
52 7 3.2 4.7 1.4 Versicolor
53 6.4 3.2 4.5 1.5 Versicolor
54 6.9 3.1 4.9 1.5 Versicolor
55 5.5 2.3 4 1.3 Versicolor
56 6.5 2.8 4.6 1.5 Versicolor
57 5.7 2.8 4.5 1.3 Versicolor
58 6.3 3.3 4.7 1.6 Versicolor
59 4.9 2.4 3.3 1 Versicolor
60 6.6 2.9 4.6 1.3 Versicolor
61 5.2 2.7 3.9 1.4 Versicolor
62 5 2 3.5 1 Versicolor
63 5.9 3 4.2 1.5 Versicolor
64 6 2.2 4 1 Versicolor
65 6.1 2.9 4.7 1.4 Versicolor
66 5.6 2.9 3.6 1.3 Versicolor
67 6.7 3.1 4.4 1.4 Versicolor
68 5.6 3 4.5 1.5 Versicolor
69 5.8 2.7 4.1 1 Versicolor
70 6.2 2.2 4.5 1.5 Versicolor
71 5.6 2.5 3.9 1.1 Versicolor
72 5.9 3.2 4.8 1.8 Versicolor
73 6.1 2.8 4 1.3 Versicolor
74 6.3 2.5 4.9 1.5 Versicolor
75 6.1 2.8 4.7 1.2 Versicolor
76 6.4 2.9 4.3 1.3 Versicolor
77 6.6 3 4.4 1.4 Versicolor
78 6.8 2.8 4.8 1.4 Versicolor
79 6.7 3 5 1.7 Versicolor
80 6 2.9 4.5 1.5 Versicolor
81 5.7 2.6 3.5 1 Versicolor
82 5.5 2.4 3.8 1.1 Versicolor
83 5.5 2.4 3.7 1 Versicolor
84 5.8 2.7 3.9 1.2 Versicolor
85 6 2.7 5.1 1.6 Versicolor
86 5.4 3 4.5 1.5 Versicolor
87 6 3.4 4.5 1.6 Versicolor
88 6.7 3.1 4.7 1.5 Versicolor
89 6.3 2.3 4.4 1.3 Versicolor
90 5.6 3 4.1 1.3 Versicolor
91 5.5 2.5 4 1.3 Versicolor
92 5.5 2.6 4.4 1.2 Versicolor
93 6.1 3 4.6 1.4 Versicolor
94 5.8 2.6 4 1.2 Versicolor
95 5 2.3 3.3 1 Versicolor
96 5.6 2.7 4.2 1.3 Versicolor
97 5.7 3 4.2 1.2 Versicolor
98 5.7 2.9 4.2 1.3 Versicolor
99 6.2 2.9 4.3 1.3 Versicolor
100 5.1 2.5 3 1.1 Versicolor
101 5.7 2.8 4.1 1.3 Versicolor
102 6.3 3.3 6 2.5 Virginica
103 5.8 2.7 5.1 1.9 Virginica
104 7.1 3 5.9 2.1 Virginica
105 6.3 2.9 5.6 1.8 Virginica
106 6.5 3 5.8 2.2 Virginica
107 7.6 3 6.6 2.1 Virginica
108 4.9 2.5 4.5 1.7 Virginica
109 7.3 2.9 6.3 1.8 Virginica
110 6.7 2.5 5.8 1.8 Virginica
111 7.2 3.6 6.1 2.5 Virginica
112 6.5 3.2 5.1 2 Virginica
113 6.4 2.7 5.3 1.9 Virginica
114 6.8 3 5.5 2.1 Virginica
115 5.7 2.5 5 2 Virginica
116 5.8 2.8 5.1 2.4 Virginica
117 6.4 3.2 5.3 2.3 Virginica
118 6.5 3 5.5 1.8 Virginica
119 7.7 3.8 6.7 2.2 Virginica
120 7.7 2.6 6.9 2.3 Virginica
121 6 2.2 5 1.5 Virginica
122 6.9 3.2 5.7 2.3 Virginica
123 5.6 2.8 4.9 2 Virginica
124 7.7 2.8 6.7 2 Virginica
125 6.3 2.7 4.9 1.8 Virginica
126 6.7 3.3 5.7 2.1 Virginica
127 7.2 3.2 6 1.8 Virginica
128 6.2 2.8 4.8 1.8 Virginica
129 6.1 3 4.9 1.8 Virginica
130 6.4 2.8 5.6 2.1 Virginica
131 7.2 3 5.8 1.6 Virginica
132 7.4 2.8 6.1 1.9 Virginica
133 7.9 3.8 6.4 2 Virginica
134 6.4 2.8 5.6 2.2 Virginica
135 6.3 2.8 5.1 1.5 Virginica
136 6.1 2.6 5.6 1.4 Virginica
137 7.7 3 6.1 2.3 Virginica
138 6.3 3.4 5.6 2.4 Virginica
139 6.4 3.1 5.5 1.8 Virginica
140 6 3 4.8 1.8 Virginica
141 6.9 3.1 5.4 2.1 Virginica
142 6.7 3.1 5.6 2.4 Virginica
143 6.9 3.1 5.1 2.3 Virginica
144 5.8 2.7 5.1 1.9 Virginica
145 6.8 3.2 5.9 2.3 Virginica
146 6.7 3.3 5.7 2.5 Virginica
147 6.7 3 5.2 2.3 Virginica
148 6.3 2.5 5 1.9 Virginica
149 6.5 3 5.2 2 Virginica
150 6.2 3.4 5.4 2.3 Virginica
151 5.9 3 5.1 1.8 Virginica

View File

@ -1,3 +0,0 @@
id,name,price
1,Item 1,100.0
2,Item 2,200.0
1 id name price
2 1 Item 1 100.0
3 2 Item 2 200.0

View File

@ -1,3 +0,0 @@
id,itemId,quantity,timestamp
1,1,2.0,2024-05-20T04:18:40.595Z
2,2,1.0,2024-05-20T04:18:40.595Z
1 id itemId quantity timestamp
2 1 1 2.0 2024-05-20T04:18:40.595Z
3 2 2 1.0 2024-05-20T04:18:40.595Z

View File

@ -1,205 +0,0 @@
/**
* For a detailed explanation regarding each configuration property, visit:
* https://jestjs.io/docs/configuration
*/
import type { Config } from 'jest'
import nextJest from 'next/jest.js'
const createJestConfig = nextJest({
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
dir: './',
})
const config: Config = {
// All imported modules in your tests should be mocked automatically
// automock: false,
// Stop running tests after `n` failures
// bail: 0,
// The directory where Jest should store its cached dependency information
// cacheDirectory: "/private/var/folders/q7/mm__k43d4hggf3bwtkyrvbn00000gn/T/jest_dx",
// Automatically clear mock calls, instances, contexts and results before every test
// clearMocks: false,
// Indicates whether the coverage information should be collected while executing the test
collectCoverage: true,
// An array of glob patterns indicating a set of files for which coverage information should be collected
// collectCoverageFrom: undefined,
// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],
// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
// "json",
// "text",
// "lcov",
// "clover"
// ],
// An object that configures minimum threshold enforcement for coverage results
// coverageThreshold: undefined,
// A path to a custom dependency extractor
// dependencyExtractor: undefined,
// Make calling deprecated APIs throw helpful error messages
// errorOnDeprecated: false,
// The default configuration for fake timers
// fakeTimers: {
// "enableGlobally": false
// },
// Force coverage collection from ignored files using an array of glob patterns
// forceCoverageMatch: [],
// A path to a module which exports an async function that is triggered once before all test suites
// globalSetup: undefined,
// A path to a module which exports an async function that is triggered once after all test suites
// globalTeardown: undefined,
// A set of global variables that need to be available in all test environments
// globals: {},
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
// "node_modules"
// ],
// An array of file extensions your modules use
// moduleFileExtensions: [
// "js",
// "mjs",
// "cjs",
// "jsx",
// "ts",
// "tsx",
// "json",
// "node"
// ],
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
// moduleNameMapper: {},
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
// modulePathIgnorePatterns: [],
// Activates notifications for test results
// notify: false,
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",
// A preset that is used as a base for Jest's configuration
// preset: undefined,
// Run tests from one or more projects
// projects: undefined,
// Use this configuration option to add custom reporters to Jest
// reporters: undefined,
// Automatically reset mock state before every test
// resetMocks: false,
// Reset the module registry before running each individual test
// resetModules: false,
// A path to a custom resolver
// resolver: undefined,
// Automatically restore mock state and implementation before every test
// restoreMocks: false,
// The root directory that Jest should scan for tests and modules within
// rootDir: undefined,
// A list of paths to directories that Jest should use to search for files in
// roots: [
// "<rootDir>"
// ],
// Allows you to use a custom runner instead of Jest's default test runner
// runner: "jest-runner",
// The paths to modules that run some code to configure or set up the testing environment before each test
// setupFiles: [],
// A list of paths to modules that run some code to configure or set up the testing framework before each test
// setupFilesAfterEnv: [],
// The number of seconds after which a test is considered as slow and reported as such in the results.
// slowTestThreshold: 5,
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
// snapshotSerializers: [],
// The test environment that will be used for testing
testEnvironment: 'jsdom',
// Options that will be passed to the testEnvironment
// testEnvironmentOptions: {},
// Adds a location field to test results
// testLocationInResults: false,
// The glob patterns Jest uses to detect test files
// testMatch: [
// "**/__tests__/**/*.[jt]s?(x)",
// "**/?(*.)+(spec|test).[tj]s?(x)"
// ],
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
// "/node_modules/"
// ],
// The regexp pattern or array of patterns that Jest uses to detect test files
// testRegex: [],
// This option allows the use of a custom results processor
// testResultsProcessor: undefined,
// This option allows use of a custom test runner
// testRunner: "jest-circus/runner",
// A map from regular expressions to paths to transformers
// transform: undefined,
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "/node_modules/",
// "\\.pnp\\.[^\\/]+$"
// ],
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
// Indicates whether each individual test should be reported during the run
// verbose: undefined,
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
// watchPathIgnorePatterns: [],
// Whether to use watchman for file crawling
// watchman: true,
}
export default createJestConfig(config)

View File

@ -1,15 +0,0 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES2020",
"jsx": "react",
"allowImportingTsExtensions": true,
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}

View File

@ -1,10 +0,0 @@
// @ts-check
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
optimizePackageImports: ['@mantine/core', '@mantine/hooks'],
}
}
module.exports = nextConfig

File diff suppressed because it is too large Load Diff

View File

@ -1,81 +0,0 @@
{
"name": "pos-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watch"
},
"dependencies": {
"@chakra-ui/next-js": "^2.2.0",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@mantine/carousel": "^7.9.0",
"@mantine/charts": "^7.9.0",
"@mantine/code-highlight": "^7.9.0",
"@mantine/core": "^7.9.0",
"@mantine/dates": "^7.9.0",
"@mantine/dropzone": "^7.9.0",
"@mantine/form": "^7.9.0",
"@mantine/hooks": "^7.9.0",
"@mantine/modals": "^7.9.0",
"@mantine/notifications": "^7.9.0",
"@mantine/nprogress": "^7.9.0",
"@mantine/spotlight": "^7.9.0",
"@mantine/tiptap": "^7.9.0",
"@nextui-org/button": "^2.0.31",
"@nextui-org/react": "^2.3.6",
"@tabler/icons-react": "^3.3.0",
"@tanstack/react-query": "^5.40.1",
"@tiptap/extension-link": "^2.3.1",
"@tiptap/react": "^2.3.1",
"@tiptap/starter-kit": "^2.3.1",
"@types/react-bootstrap": "^0.32.36",
"@types/react-query": "^1.2.9",
"bootstrap": "^5.3.3",
"dayjs": "^1.11.11",
"embla-carousel-react": "^8.0.2",
"framer-motion": "^11.0.25",
"fuse.js": "^7.0.0",
"level-rocksdb": "^5.0.0",
"next": "^14.1.4",
"nodejs-polars": "^0.11.0",
"react": "^18",
"react-bootstrap": "^2.10.2",
"react-dom": "^18",
"react-query": "^3.39.3",
"recharts": "^2.12.6",
"rocksdb": "^5.2.1"
},
"devDependencies": {
"@babel/preset-typescript": "^7.24.1",
"@next/eslint-plugin-next": "^14.2.0",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@types/chai": "^4.3.14",
"@types/mocha": "^10.0.6",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/rocksdb": "^3.0.5",
"@types/sinon": "^17.0.3",
"chai": "^5.1.0",
"eslint": "^8",
"eslint-config-next": "14.1.4",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"mocha": "^10.4.0",
"postcss": "^8.4.38",
"postcss-preset-mantine": "^1.15.0",
"postcss-simple-vars": "^7.0.1",
"sinon": "^17.0.1",
"tailwindcss": "^3.4.3",
"ts-node": "^10.9.2",
"typescript": "^5"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
module.exports = {
plugins: {
'postcss-preset-mantine': {},
'postcss-simple-vars': {
variables: {
'mantine-breakpoint-xs': '36em',
'mantine-breakpoint-sm': '48em',
'mantine-breakpoint-md': '62em',
'mantine-breakpoint-lg': '75em',
'mantine-breakpoint-xl': '88em',
},
},
},
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1,11 +0,0 @@
const { nextui } = require("@nextui-org/react")
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
darkMode: "class",
plugins: [nextui()],
}

View File

@ -1,34 +0,0 @@
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}