A React-based frontend for the Hanging Piece application built with modern web technologies.
- Framework: React 19 with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Authentication: Better Auth
- Validation: Zod
This project uses pnpm as the package manager.
-
Install pnpm if you haven't already:
npm install -g pnpm
-
Install dependencies:
pnpm install
-
Create a
.envfile in the root directory with the backend API URL:VITE_API_BASE_URL=http://localhost:3000
Available pnpm scripts for development:
pnpm run dev- Starts the development server with hot reloadpnpm run build- Builds the project for productionpnpm run preview- Previews the production build locallypnpm run lint- Runs ESLint to check for code issues
This project uses the @ alias for clean import paths throughout the codebase.
TypeScript compilation:
tsconfig.app.jsonmaps"@/*": ["./src/*"]incompilerOptions.paths- Enables imports like
import { Component } from "@/components/Component"
Vite bundler:
vite.config.tsmaps"@"to"./src"inresolve.alias- Allows the bundler to resolve the alias during development and build
// Instead of: import { Button } from "../../components/Button"
// Use: import { Button } from "@/components/Button"
import { Button } from "@/components/Button";This setup provides clean, consistent imports while supporting both development and production environments.