Merge remote-tracking branch 'origin/master' into feature/slicing
This commit is contained in:
commit
ffc649d06d
24
Dockerfile
24
Dockerfile
@ -1,22 +1,26 @@
|
|||||||
FROM node:20-alpine AS development-dependencies-env
|
FROM node:22.13.1-alpine AS development-dependencies-env
|
||||||
|
RUN npm install -g pnpm@9.15.4
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm ci
|
RUN pnpm install
|
||||||
|
|
||||||
FROM node:20-alpine AS production-dependencies-env
|
FROM node:22.13.1-alpine AS production-dependencies-env
|
||||||
COPY ./package.json package-lock.json /app/
|
RUN npm install -g pnpm@9.15.4
|
||||||
|
COPY ./package.json pnpm-lock.yaml /app/
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm ci --omit=dev
|
RUN pnpm install --prod
|
||||||
|
|
||||||
FROM node:20-alpine AS build-env
|
FROM node:22.13.1-alpine AS build-env
|
||||||
|
RUN npm install -g pnpm@9.15.4
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
|
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm run build
|
RUN pnpm build
|
||||||
|
|
||||||
FROM node:20-alpine
|
FROM node:22.13.1-alpine
|
||||||
COPY ./package.json package-lock.json /app/
|
RUN npm install -g pnpm@9.15.4
|
||||||
|
COPY ./package.json pnpm-lock.yaml /app/
|
||||||
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
|
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
|
||||||
COPY --from=build-env /app/build /app/build
|
COPY --from=build-env /app/build /app/build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
CMD ["npm", "run", "start"]
|
CMD ["pnpm", "start"]
|
||||||
|
|||||||
53
README.md
53
README.md
@ -1,27 +1,26 @@
|
|||||||
# Welcome to React Router!
|
|
||||||
|
|
||||||
A modern, production-ready template for building full-stack React applications using React Router.
|
|
||||||
|
|
||||||
[](https://stackblitz.com/github/remix-run/react-router-templates/tree/main/default)
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- 🚀 Server-side rendering
|
|
||||||
- ⚡️ Hot Module Replacement (HMR)
|
|
||||||
- 📦 Asset bundling and optimization
|
|
||||||
- 🔄 Data loading and mutations
|
|
||||||
- 🔒 TypeScript by default
|
|
||||||
- 🎉 TailwindCSS for styling
|
|
||||||
- 📖 [React Router docs](https://reactrouter.com/)
|
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
### Prerequisite
|
||||||
|
|
||||||
|
This project requires:
|
||||||
|
|
||||||
|
- Node.js version 22.13.1
|
||||||
|
- pnpm version 9.15.4
|
||||||
|
|
||||||
|
To install Node.js, visit [nodejs.org](https://nodejs.org/)
|
||||||
|
|
||||||
|
To install pnpm, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install -g pnpm@9.15.4
|
||||||
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
|
|
||||||
Install the dependencies:
|
Install the dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
@ -29,7 +28,7 @@ npm install
|
|||||||
Start the development server with HMR:
|
Start the development server with HMR:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
pnpm dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Your application will be available at `http://localhost:5173`.
|
Your application will be available at `http://localhost:5173`.
|
||||||
@ -39,31 +38,19 @@ Your application will be available at `http://localhost:5173`.
|
|||||||
Create a production build:
|
Create a production build:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run build
|
pnpm build
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
### Docker Deployment
|
### Docker Deployment
|
||||||
|
|
||||||
This template includes three Dockerfiles optimized for different package managers:
|
|
||||||
|
|
||||||
- `Dockerfile` - for npm
|
|
||||||
- `Dockerfile.pnpm` - for pnpm
|
|
||||||
- `Dockerfile.bun` - for bun
|
|
||||||
|
|
||||||
To build and run using Docker:
|
To build and run using Docker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# For npm
|
# Build the docker
|
||||||
docker build -t my-app .
|
docker build -t my-app .
|
||||||
|
|
||||||
# For pnpm
|
|
||||||
docker build -f Dockerfile.pnpm -t my-app .
|
|
||||||
|
|
||||||
# For bun
|
|
||||||
docker build -f Dockerfile.bun -t my-app .
|
|
||||||
|
|
||||||
# Run the container
|
# Run the container
|
||||||
docker run -p 3000:3000 my-app
|
docker run -p 3000:3000 my-app
|
||||||
```
|
```
|
||||||
@ -81,7 +68,7 @@ The containerized application can be deployed to any platform that supports Dock
|
|||||||
|
|
||||||
If you're familiar with deploying Node applications, the built-in app server is production-ready.
|
If you're familiar with deploying Node applications, the built-in app server is production-ready.
|
||||||
|
|
||||||
Make sure to deploy the output of `npm run build`
|
Make sure to deploy the output of `pnpm build`
|
||||||
|
|
||||||
```
|
```
|
||||||
├── package.json
|
├── package.json
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { Dialog, DialogPanel } from '@headlessui/react'
|
import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react'
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
|
|
||||||
type ModalProperties = {
|
type ModalProperties = {
|
||||||
@ -16,20 +16,19 @@ export default function PopupModal({
|
|||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
as="div"
|
|
||||||
className="relative z-30 focus:outline-none"
|
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
>
|
className="relative z-50"
|
||||||
<div className="fixed inset-0 z-30 w-screen overflow-y-auto backdrop-blur-sm">
|
|
||||||
<div className="flex min-h-full items-center justify-center sm:p-4">
|
|
||||||
<DialogPanel
|
|
||||||
transition
|
transition
|
||||||
className="w-full rounded-xl bg-white p-5 shadow duration-300 ease-out data-[closed]:transform-[scale(95%)] data-[closed]:opacity-0 max-md:min-h-screen max-md:min-w-screen max-sm:p-[50px] sm:max-w-md sm:p-10"
|
|
||||||
>
|
>
|
||||||
{children}
|
<DialogBackdrop
|
||||||
|
className="fixed inset-0 bg-black/50 duration-300 ease-out data-[closed]:opacity-0"
|
||||||
|
transition
|
||||||
|
/>
|
||||||
|
<div className="fixed inset-0 flex w-screen items-center justify-center p-4">
|
||||||
|
<DialogPanel className="max-w-lg space-y-4 rounded-lg bg-white p-8 shadow-lg duration-300 ease-out data-[closed]:scale-95 data-[closed]:opacity-0">
|
||||||
|
<div className="relative">{children}</div>
|
||||||
</DialogPanel>
|
</DialogPanel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,18 +4,30 @@ import { useState } from 'react'
|
|||||||
import { Link } from 'react-router'
|
import { Link } from 'react-router'
|
||||||
|
|
||||||
import { EyeIcon } from '~/components/icons/eye'
|
import { EyeIcon } from '~/components/icons/eye'
|
||||||
import HeaderModal from '~/components/popup/header-modal'
|
import { APP } from '~/data/meta'
|
||||||
|
|
||||||
const FormLogin = () => {
|
const FormLogin = () => {
|
||||||
const [showPassword, setShowPassword] = useState(false)
|
const [showPassword, setShowPassword] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex flex-col items-center justify-center">
|
<div className="flex items-center justify-center">
|
||||||
<HeaderModal>
|
|
||||||
<p>Selamat Datang, silakan masukkan akun Anda untuk melanjutkan!</p>
|
|
||||||
</HeaderModal>
|
|
||||||
|
|
||||||
<div className="w-full max-w-md">
|
<div className="w-full max-w-md">
|
||||||
|
<div className="mb-6 flex justify-center">
|
||||||
|
<Link to="/news">
|
||||||
|
<img
|
||||||
|
src={APP.logo}
|
||||||
|
alt={APP.title}
|
||||||
|
className="h-[80px]"
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="mb-4 p-4 text-center">
|
||||||
|
<p className="text-[#565658]">
|
||||||
|
Selamat Datang, silakan daftarkan akun Anda untuk melanjutkan!
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
{/* Input Email / No Telepon */}
|
{/* Input Email / No Telepon */}
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
|
|||||||
@ -57,5 +57,9 @@
|
|||||||
"typescript-eslint": "^8.22.0",
|
"typescript-eslint": "^8.22.0",
|
||||||
"vite": "^5.4.11",
|
"vite": "^5.4.11",
|
||||||
"vite-tsconfig-paths": "^5.1.4"
|
"vite-tsconfig-paths": "^5.1.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=22.13.1",
|
||||||
|
"pnpm": ">=9.15.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user