A React-based web application for managing and processing policy insurance workflows efficiently.
- React (Vite or CRA-based frontend)
- TypeScript (if applicable)
- Axios for API calls
- Tailwind CSS & Shadcn
- Docker for production deployment
git clone https://github.com/TLabTech/Dashboard-Insurance-Policy.git policy-insurance-dashboard
cd policy-insurance-dashboardPastikan Node.js (versi 20 atau lebih baru) dan npm/yarn/pnpm sudah terinstal.
# Menggunakan npm
npm install
# atau menggunakan yarn
yarn installBuat file .env di root project, contoh:
VITE_API_URL=http://localhost:3000
VITE_APP_NAME=Policy Insurance Dashboard# npm
npm run dev
# atau yarn
yarn devAkses di browser:
http://localhost:5173
# npm
npm run build
# atau yarn
yarn buildHasil build akan berada di folder:
dist/
Untuk melihat hasil build sebelum di-deploy:
npm run previewPastikan Docker sudah terinstal.
docker build -t policy-insurance-dashboard .docker run -d \
-p 8080:80 \
--name policy-insurance-dashboard \
policy-insurance-dashboardAkses aplikasi di browser:
http://localhost:8080
Jika belum ada Dockerfile, berikut contoh dasar untuk React (Vite):
# Stage 1: Build the React app
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve with nginx
FROM nginx:stable-alpine
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]Untuk menjalankan bersama backend API (misalnya di port 3000), gunakan file docker-compose.yml berikut:
version: '3.9'
services:
frontend:
container_name: policy-insurance-dashboard
build: .
ports:
- "8080:80"
environment:
- VITE_API_URL=http://backend:3000
depends_on:
- backend
backend:
image: node:20-alpine
working_dir: /app
command: ["npm", "run", "start"]
volumes:
- ./backend:/app
ports:
- "3000:3000"Jalankan dengan:
docker compose up -d --build| Command | Deskripsi |
|---|---|
npm run lint |
Menjalankan ESLint untuk memastikan code style |
npm run build |
Build production-ready assets |
npm run preview |
Menjalankan server lokal untuk hasil build |
npm run dev |
Menjalankan aplikasi dalam mode pengembangan |
Developed by PT Teknologi Kode Indonesia (TLab)
Section: Web Development — Fullstack & Frontend
This project is proprietary and internal to PT Teknologi Kode Indonesia (TLab).
Unauthorized distribution is strictly prohibited.