feat: Integrate PayPal for payments

Adds the `@paypal/react-paypal-js` dependency and updates import maps to support PayPal integration. Cleans up Dockerfile and Nginx configuration, removing them as they are no longer needed in this version.
This commit is contained in:
2025-12-07 22:44:00 +01:00
parent 2f4ba7f4b5
commit 8ea1e231fd
6 changed files with 8 additions and 65 deletions

Binary file not shown.

View File

@@ -1,14 +0,0 @@
# Stage 1: Build Frontend
FROM node:18-alpine as build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve with Nginx
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -1,4 +1,3 @@
<!DOCTYPE html>
<html lang="it">
<head>
@@ -34,14 +33,14 @@
<script type="importmap">
{
"imports": {
"react": "https://aistudiocdn.com/react@^19.2.1",
"react-dom/": "https://aistudiocdn.com/react-dom@^19.2.1/",
"react/": "https://aistudiocdn.com/react@^19.2.1/",
"react-router-dom": "https://aistudiocdn.com/react-router-dom@^7.10.1",
"lucide-react": "https://aistudiocdn.com/lucide-react@^0.556.0",
"react-router-dom": "https://aistudiocdn.com/react-router-dom@^7.10.1",
"react-dom/": "https://aistudiocdn.com/react-dom@^19.2.1/",
"vite": "https://aistudiocdn.com/vite@^7.2.6",
"@vitejs/plugin-react": "https://aistudiocdn.com/@vitejs/plugin-react@^5.1.1",
"@paypal/react-paypal-js": "https://esm.sh/@paypal/react-paypal-js@8.1.3?external=react,react-dom"
"react/": "https://aistudiocdn.com/react@^19.2.1/",
"react": "https://aistudiocdn.com/react@^19.2.1",
"@paypal/react-paypal-js": "https://aistudiocdn.com/@paypal/react-paypal-js@^8.9.2"
}
}
</script>

View File

@@ -1,38 +1 @@
worker_processes 1;
events { worker_connections 1024; }
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# Limite upload per allegati (es. foto/video ticket)
client_max_body_size 50M;
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Compressione Gzip
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
# Gestione SPA (React Router)
location / {
try_files $uri $uri/ /index.html;
}
# Proxy API verso il backend
location /api/ {
proxy_pass http://backend:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
}
<EFBFBD><EFBFBD><EFBFBD>z

View File

@@ -9,6 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@paypal/react-paypal-js": "^8.1.3",
"lucide-react": "^0.344.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",

View File

@@ -1,7 +1 @@
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3001
CMD ["node", "server.js"]
<13><><EFBFBD>^