Skip to content

FelienZ/KuchiStore-Frontend

Repository files navigation

πŸ›οΈ KuchiStore Frontend

Aplikasi frontend e-commerce gadget modern berbasis web yang dibangun dengan React, TypeScript, dan Vite. Menyediakan pengalaman berbelanja yang cepat dan responsif dengan UI yang Minimalis menggunakan Tailwind CSS dan Radix UI.

πŸ“‹ Daftar Isi

✨ Fitur Utama

  • Autentikasi: Login dan registrasi pengguna
  • Katalog Produk: Browsing dan pencarian produk dari berbagai brand
  • Detail Produk: Informasi lengkap produk dengan gambar dan deskripsi
  • Wishlist: Simpan produk favorit
  • Pesanan: Riwayat dan manajemen pesanan
  • Profil Pengguna: Kelola data akun dan preferensi
  • Dark Mode: Tema gelap untuk kenyamanan mata
  • Responsive Design: Optimal di semua ukuran layar
  • Real-time Updates: Menggunakan React Query untuk data management

πŸ› οΈ Teknologi

Frontend Framework & Build:

  • React 19.2.3
  • TypeScript
  • Vite 5.x
  • React Router 7.x

Styling & UI:

  • Tailwind CSS 4.x
  • Radix UI Components
  • Lucide React Icons
  • Motion (Animations)

State Management & API:

  • React Query (@tanstack/react-query)
  • Axios (HTTP Client)
  • Interceptors untuk request/response

Tema & Aksesibilitas:

  • Next Themes (Dark Mode)
  • Radix UI (Accessible Components)

Developer Tools:

  • ESLint
  • TypeScript Type Checking

πŸ“‹ Prasyarat

Sebelum memulai, pastikan Anda sudah menginstal:

  • Node.js (v16.0.0 atau lebih tinggi)

  • npm atau yarn (included dengan Node.js)

  • Git (untuk version control)

πŸ“¦ Instalasi

1. Clone Repository

git clone https://github.com/yourusername/KuchiStore-FE.git
cd KuchiStore-FE

2. Install Dependencies

Menggunakan npm:

npm install

Atau menggunakan yarn:

yarn install

3. Setup Environment Variables

Buat file .env.local di root project dan tambahkan konfigurasi berikut:

# API Configuration
VITE_API_BASE_URL=http://localhost:3000/api
VITE_API_TIMEOUT=10000

# Application
VITE_APP_NAME=KuchiStoreV2
VITE_APP_VERSION=2.0.0

File Output

dist/
β”œβ”€β”€ index.html          # HTML entry point
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ index-*.js     # JavaScript bundle (minified)
β”‚   └── index-*.css    # CSS bundle (minified)
└── Brands/            # Static assets

## πŸ“ Struktur Project

src/
β”œβ”€β”€ main.tsx # Entry point aplikasi
β”œβ”€β”€ app.css # Global styles
β”œβ”€β”€ index.css # Base styles
β”œβ”€β”€ components/
β”‚ β”œβ”€β”€ Common/ # Reusable components
β”‚ β”‚ β”œβ”€β”€ Navbar.tsx
β”‚ β”‚ β”œβ”€β”€ Sidebar.tsx
β”‚ β”‚ β”œβ”€β”€ Accordion.tsx
β”‚ β”‚ β”œβ”€β”€ Calendar.tsx
β”‚ β”‚ β”œβ”€β”€ Carousel.tsx
β”‚ β”‚ β”œβ”€β”€ Combobox.tsx
β”‚ β”‚ β”œβ”€β”€ Pagination.tsx
β”‚ β”‚ β”œβ”€β”€ Select.tsx
β”‚ β”‚ β”œβ”€β”€ Table.tsx
β”‚ β”‚ └── Card/
β”‚ β”œβ”€β”€ Layout/ # Layout components
β”‚ β”‚ └── Store.tsx
β”‚ └── ui/ # Shadcn/ui components
β”œβ”€β”€ frontend/ # Page components
β”‚ β”œβ”€β”€ 404.tsx
β”‚ β”œβ”€β”€ Loading.tsx
β”‚ β”œβ”€β”€ LoginPage.tsx
β”‚ β”œβ”€β”€ RegisterPage.tsx
β”‚ β”œβ”€β”€ Home/
β”‚ β”œβ”€β”€ Store/
β”‚ β”œβ”€β”€ Orders/
β”‚ β”œβ”€β”€ Profile/
β”‚ β”œβ”€β”€ Wishlist/
β”‚ └── Help/
β”œβ”€β”€ context/ # React Context
β”‚ β”œβ”€β”€ AuthContext.ts
β”‚ └── ThemeContext.ts
β”œβ”€β”€ hooks/ # Custom React Hooks
β”‚ β”œβ”€β”€ useAuth.ts
β”‚ β”œβ”€β”€ useTheme.ts
β”‚ β”œβ”€β”€ useWindow.ts
β”‚ └── use-mobile.ts
β”œβ”€β”€ utils/
β”‚ β”œβ”€β”€ services/ # API calls
β”‚ β”‚ β”œβ”€β”€ Auth/
β”‚ β”‚ β”œβ”€β”€ Account/
β”‚ β”‚ β”œβ”€β”€ Products/
β”‚ β”‚ β”œβ”€β”€ Orders/
β”‚ β”‚ └── Wishlists/
β”‚ β”œβ”€β”€ types/ # TypeScript types & interfaces
β”‚ β”‚ β”œβ”€β”€ Form.ts
β”‚ β”‚ β”œβ”€β”€ Response.ts
β”‚ β”‚ β”œβ”€β”€ Auth/
β”‚ β”‚ β”œβ”€β”€ Account/
β”‚ β”‚ β”œβ”€β”€ Orders/
β”‚ β”‚ └── Wishlists/
β”‚ β”œβ”€β”€ data/ # Static data & constants
β”‚ └── util/ # Helper utilities
└── lib/
└── utils.ts # Utility functions

πŸ” Environment Variables

Untuk development, buat file .env.local:

# API Configuration
VITE_API_BASE_URL=http://localhost:3000/api
VITE_API_TIMEOUT=10000

# Feature Flags
VITE_ENABLE_DEMO_MODE=false

Variable yang Tersedia

Variable Default Deskripsi
VITE_API_BASE_URL http://localhost:3000/api Base URL untuk API backend
VITE_API_TIMEOUT 10000 Timeout API request (ms)
VITE_ENABLE_DEMO_MODE false Mode demo untuk testing

πŸ’» Development Guide

Available Scripts

# Development server
npm run dev

# Production build
npm run build

# Lint code
npm run lint

# Preview production build
npm run preview

Coding Standards

  • TypeScript: Strict mode enabled
  • Styling: Tailwind CSS + CSS Modules (jika diperlukan)
  • Components: Functional components dengan hooks
  • API Calls: Gunakan React Query untuk data fetching
  • Error Handling: Try-catch untuk async operations

Best Practices

  1. Folder Structure: Gunakan struktur yang ada, jangan buat folder baru tanpa discussion
  2. Component Naming: PascalCase untuk component files (.tsx)
  3. Constants: Simpan di utils/data/
  4. Types: Simpan di utils/types/
  5. API Calls: Buat service files di utils/services/
  6. Hooks: Buat custom hooks di hooks/

Component Template

import { FC } from "react";

interface Props {
  // Define props here
}

const MyComponent: FC<Props> = ({}) => {
  return <div>{/* JSX here */}</div>;
};

export default MyComponent;

API Service Template

import api from "../interceptor";

export const myService = async () => {
  try {
    const response = await api.get("/endpoint");
    return response.data;
  } catch (error) {
    console.error("Error:", error);
    throw error;
  }
};

πŸ”§ Konfigurasi

TypeScript Config

  • tsconfig.json: Base configuration
  • tsconfig.app.json: Application-specific config
  • tsconfig.node.json: Node.js tools config

Vite Config

Konfigurasi berada di vite.config.ts:

  • Path alias: @/ β†’ src/
  • React plugin untuk HMR
  • Tailwind CSS Vite plugin

ESLint

Konfigurasi di eslint.config.js:

npm run lint       # Check linting issues
npm run lint --fix # Auto-fix issues

πŸ“š Resources

🀝 Contributing

  1. Create feature branch: git checkout -b feature/your-feature
  2. Commit changes: git commit -m 'Add your feature'
  3. Push branch: git push origin feature/your-feature
  4. Open Pull Request

πŸ‘₯ Author

FelienZ


Last Updated: December 2025

About

Kuchi Store Frontend V2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages