Skip to content

Commit

Permalink
Frontend: Package refactor
Browse files Browse the repository at this point in the history
* updated package dependenciees
  • Loading branch information
bescka committed Aug 1, 2024
1 parent 07c3f70 commit fb2af9d
Show file tree
Hide file tree
Showing 28 changed files with 5,162 additions and 176 deletions.
10 changes: 0 additions & 10 deletions frontend-app/.editorconfig

This file was deleted.

2 changes: 0 additions & 2 deletions frontend-app/.env.production

This file was deleted.

5 changes: 0 additions & 5 deletions frontend-app/.eslintignore

This file was deleted.

36 changes: 36 additions & 0 deletions frontend-app/.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: 0 additions & 12 deletions frontend-app/.prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions frontend-app/.vscode/settings.json

This file was deleted.

36 changes: 36 additions & 0 deletions frontend-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
16 changes: 10 additions & 6 deletions frontend-app/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import "@/styles/globals.css"
import { Metadata } from "next"

import { siteConfig } from "@/config/site"
import { fontSans } from "@/libs/fonts"
import { cn } from "@/libs/utils"
import { fontSans } from "@/lib/fonts"
import { cn } from "@/lib/utils"
import { SiteHeader } from "@/components/site-header"
import { TailwindIndicator } from "@/components/tailwind-indicator"
import { ThemeProvider } from "@/components/theme-provider"
Expand All @@ -14,17 +14,20 @@ export const metadata: Metadata = {
template: `%s - ${siteConfig.name}`,
},
description: siteConfig.description,
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
icons: {
icon: "/AT-cropped-64.ico",
// shortcut: "/favicon-16x16.png",
// apple: "/apple-touch-icon.png",
},
}

export const viewport = {
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
}

interface RootLayoutProps {
children: React.ReactNode
}
Expand Down Expand Up @@ -52,3 +55,4 @@ export default function RootLayout({ children }: RootLayoutProps) {
</>
)
}

14 changes: 8 additions & 6 deletions frontend-app/components.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.js",
"config": "tailwind.config.ts",
"css": "app/globals.css",
"baseColor": "slate",
"cssVariables": true
"cssVariables": false,
"prefix": ""
},
"rsc": false,
"aliases": {
"utils": "@/libs/utils",
"components": "@/components"
"components": "@/components",
"utils": "@/lib/utils"
}
}
}
1 change: 0 additions & 1 deletion frontend-app/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
LucideProps,
Moon,
SunMedium,
Twitter,
type Icon as LucideIcon,
} from "lucide-react";

Expand Down
2 changes: 1 addition & 1 deletion frontend-app/components/main-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from "next/link"

import { NavItem } from "@/types/nav"
import { siteConfig } from "@/config/site"
import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"
import { Icons } from "@/components/icons"

interface MainNavProps {
Expand Down
22 changes: 11 additions & 11 deletions frontend-app/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 dark:ring-offset-slate-950 dark:focus-visible:ring-slate-300",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
default: "bg-slate-900 text-slate-50 hover:bg-slate-900/90 dark:bg-slate-50 dark:text-slate-900 dark:hover:bg-slate-50/90",
destructive:
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
"bg-red-500 text-slate-50 hover:bg-red-500/90 dark:bg-red-900 dark:text-slate-50 dark:hover:bg-red-900/90",
outline:
"border border-input hover:bg-accent hover:text-accent-foreground",
"border border-slate-200 bg-white hover:bg-slate-100 hover:text-slate-900 dark:border-slate-800 dark:bg-slate-950 dark:hover:bg-slate-800 dark:hover:text-slate-50",
secondary:
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "underline-offset-4 hover:underline text-primary",
"bg-slate-100 text-slate-900 hover:bg-slate-100/80 dark:bg-slate-800 dark:text-slate-50 dark:hover:bg-slate-800/80",
ghost: "hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-800 dark:hover:text-slate-50",
link: "text-slate-900 underline-offset-4 hover:underline dark:text-slate-50",
},
size: {
default: "h-10 py-2 px-4",
sm: "h-9 px-3 rounded-md",
lg: "h-11 px-8 rounded-md",
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
icon: "h-10 w-10",
},
},
Expand Down
6 changes: 3 additions & 3 deletions frontend-app/components/ui/card.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"

import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"

const Card = React.forwardRef<
HTMLDivElement,
Expand All @@ -9,7 +9,7 @@ const Card = React.forwardRef<
<div
ref={ref}
className={cn(
"rounded-lg border bg-card text-card-foreground shadow-sm",
"rounded-lg border border-slate-200 bg-white text-slate-950 shadow-sm dark:border-slate-800 dark:bg-slate-950 dark:text-slate-50",
className
)}
{...props}
Expand Down Expand Up @@ -50,7 +50,7 @@ const CardDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn("text-sm text-muted-foreground", className)}
className={cn("text-sm text-slate-500 dark:text-slate-400", className)}
{...props}
/>
))
Expand Down
10 changes: 6 additions & 4 deletions frontend-app/components/ui/form.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
import { Slot } from "@radix-ui/react-slot"
Expand All @@ -10,7 +12,7 @@ import {
useFormContext,
} from "react-hook-form"

import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"
import { Label } from "@/components/ui/label"

const Form = FormProvider
Expand Down Expand Up @@ -93,7 +95,7 @@ const FormLabel = React.forwardRef<
return (
<Label
ref={ref}
className={cn(error && "text-destructive", className)}
className={cn(error && "text-red-500 dark:text-red-900", className)}
htmlFor={formItemId}
{...props}
/>
Expand Down Expand Up @@ -133,7 +135,7 @@ const FormDescription = React.forwardRef<
<p
ref={ref}
id={formDescriptionId}
className={cn("text-sm text-muted-foreground", className)}
className={cn("text-sm text-slate-500 dark:text-slate-400", className)}
{...props}
/>
)
Expand All @@ -155,7 +157,7 @@ const FormMessage = React.forwardRef<
<p
ref={ref}
id={formMessageId}
className={cn("text-sm font-medium text-destructive", className)}
className={cn("text-sm font-medium text-red-500 dark:text-red-900", className)}
{...props}
>
{body}
Expand Down
4 changes: 2 additions & 2 deletions frontend-app/components/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react"

import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"

export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
Expand All @@ -11,7 +11,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
<input
type={type}
className={cn(
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
"flex h-10 w-full rounded-md border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:bg-slate-950 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus-visible:ring-slate-300",
className
)}
ref={ref}
Expand Down
4 changes: 3 additions & 1 deletion frontend-app/components/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use client"

import * as React from "react"
import * as LabelPrimitive from "@radix-ui/react-label"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/libs/utils"
import { cn } from "@/lib/utils"

const labelVariants = cva(
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
Expand Down
4 changes: 2 additions & 2 deletions frontend-app/config/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const siteConfig = {
},
],
links: {
github: "https://github.com/bescka/spreadsheet_uploader",
docs: "https://github.com/bescka/spreadsheet_uploader",
github: "https://github.com/bescka/spreadsheet_upload_tool",
docs: "https://github.com/bescka/spreadsheet_upload_tool",
login: "/login",
register: "/register",
uploader: "/uploader"
Expand Down
11 changes: 0 additions & 11 deletions frontend-app/libs/fonts.ts

This file was deleted.

6 changes: 0 additions & 6 deletions frontend-app/libs/utils.ts

This file was deleted.

6 changes: 2 additions & 4 deletions frontend-app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
}
const nextConfig = {};

export default nextConfig
export default nextConfig;
Loading

0 comments on commit fb2af9d

Please sign in to comment.