Frontend aplikasi chat real-time Clavox yang dibangun dengan React + Vite + Tailwind CSS. Terintegrasi dengan Ionic + Capacitor untuk deployment ke mobile app (Android/iOS).
Note: Ini adalah repository frontend. Backend API tersedia di Clavox Backend
- π¨ Modern UI/UX dengan Tailwind CSS
- π± Responsive Design - Mobile First
- β‘ Fast Development dengan Vite Hot Reload
- π Phone Authentication dengan OTP Input
- π¬ Real-time Chat Interface
- π± Mobile App Ready - Ionic + Capacitor
- π Dark Mode Support (Coming Soon)
- π Socket.IO Integration untuk real-time messaging
clavox-frontend/
βββ public/
β βββ index.html
β βββ assets/
βββ src/
β βββ components/ # Komponen UI
β β βββ Auth/
β β βββ Chat/
β β βββ Common/
β βββ pages/ # Halaman utama
β β βββ Login.jsx
β β βββ Chat.jsx
β β βββ Profile.jsx
β βββ hooks/ # Custom hooks
β βββ services/ # API & Socket services
β βββ utils/ # Helper functions
β βββ styles/ # Global styles
β βββ App.jsx
β βββ main.jsx
βββ capacitor.config.ts # Konfigurasi Capacitor
βββ ionic.config.json # Konfigurasi Ionic
βββ tailwind.config.js # Konfigurasi Tailwind
βββ vite.config.js # Konfigurasi Vite
βββ package.json
- Node.js (v16+)
- npm atau yarn
- Android Studio (untuk Android build)
- Xcode (untuk iOS build - Mac only)
git clone https://github.com/Peter-sour/clavox-frontend.git
cd clavox-frontend# Core dependencies
npm install
# React Router
npm install react-router-dom
# Phone number input
npm install react-phone-number-input libphonenumber-js --legacy-peer-deps
# OTP input
npm install react-otp-input
# Ionic & Capacitor
npm install @ionic/react @ionic/react-router ionicons
npm install @capacitor/core
npm install --save-dev @capacitor/cli
# Socket.IO client
npm install socket.io-clientBuat file .env di root project:
VITE_API_BASE_URL=http://localhost:5000
VITE_SOCKET_URL=http://localhost:5000npm run devAplikasi akan berjalan di http://localhost:5173
# Inisialisasi Capacitor
npx cap init
# Build web assets
npm run build
# Sync dengan native platforms
npx cap sync# Add Android
npx cap add android
# Add iOS (Mac only)
npx cap add ios# Build untuk production
npm run build
# Sync assets ke native
npx cap sync
# Open di Android Studio
npx cap open android
# Open di Xcode (Mac only)
npx cap open iosnpm run dev # Development server
npm run build # Production build
npm run preview # Preview production build
npm run lint # ESLint check
npm run lint:fix # Fix ESLint issues// tailwind.config.js
module.exports = {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
colors: {
primary: {
50: '#eff6ff',
500: '#3b82f6',
600: '#2563eb',
}
}
},
},
plugins: [],
}// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
host: true
}
})// src/services/socket.js
import io from 'socket.io-client';
const socket = io(import.meta.env.VITE_SOCKET_URL);
export default socket;// src/services/api.js
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
export const apiService = {
async sendOTP(phoneNumber) {
// API call logic
},
async verifyOTP(phoneNumber, otp) {
// API verification logic
}
};npm install @capacitor/push-notificationsnpm install @capacitor/camera
npm install @capacitor/filesystem
npm install @capacitor/hapticsButton- Custom button dengan variantsInput- Input field dengan validationModal- Modal componentChatBubble- Chat message bubblePhoneInput- Phone number inputOTPInput- OTP verification input
- Dark Mode Implementation
- Push Notification UI
- Chat Encryption Indicator
- File Upload Interface
- Voice Message Recording
- Chat Export Feature
- Multiple Theme Support
- PWA Implementation
- Build Error: Pastikan semua dependencies terinstall dengan benar
- Socket Connection: Periksa VITE_SOCKET_URL di file .env
- Mobile Build: Pastikan Android Studio/Xcode sudah terinstall
- Phone Input: Gunakan flag
--legacy-peer-depsjika ada conflict
# Enable debug untuk Socket.IO
localStorage.debug = 'socket.io-client:socket';- Fork repository ini
- Buat feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push ke branch (
git push origin feature/AmazingFeature) - Buka Pull Request
Distributed under the MIT License. See LICENSE for more information.
- React - UI Library
- Vite - Build Tool
- Tailwind CSS - CSS Framework
- Ionic - Mobile UI Components
- Capacitor - Native Mobile Runtime
Jika project ini membantu, jangan lupa beri β di repo ini!
Link Repository:
- Frontend: Clavox Frontend
- Backend: Clavox Backend
Made with β€οΈ by Peter-sour