diff --git a/package.json b/package.json index cb0d82f..100a7c4 100644 --- a/package.json +++ b/package.json @@ -29,28 +29,33 @@ "@radix-ui/react-scroll-area": "^1.0.5", "@radix-ui/react-separator": "^1.0.3", "@radix-ui/react-slot": "^1.0.2", + "@solana/pay": "^0.2.5", + "@solana/wallet-adapter-base": "^0.9.5", + "@solana/wallet-adapter-react": "^0.15.4", + "@solana/wallet-adapter-react-ui": "^0.9.6", + "@solana/wallet-adapter-wallets": "^0.19.32", + "@solana/web3.js": "^1.91.1", "@tanstack/react-query": "4.36.1", "@trpc/client": "^10.45.2", "@trpc/next": "^10.45.2", "@trpc/react-query": "^10.45.2", "@trpc/server": "^10.45.2", - "@typescript-eslint/eslint-plugin": "^7.4.0", - "@typescript-eslint/parser": "^7.4.0", - "body-parser": "^1.20.2", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "cross-env": "^7.0.3", "date-fns": "^3.6.0", "dotenv": "^16.4.5", - "express": "^4.19.2", + "escape-html": "^1.0.3", + "express": "^4.19.1", "lucide-react": "^0.363.0", "next": "14.1.4", + "nodemailer": "^6.9.13", "payload": "^2.11.2", "react": "^18", "react-dom": "^18", - "react-hook-form": "^7.51.2", + "react-hook-form": "^7.51.1", "sonner": "^1.4.41", - "swiper": "^11.1.0", + "swiper": "^11.0.7", "tailwind-merge": "^2.2.2", "tailwindcss-animate": "^1.0.7", "ts-node": "^10.9.2", @@ -58,12 +63,14 @@ "zustand": "^4.5.2" }, "devDependencies": { + "@types/escape-html": "^1.0.4", + "@types/express": "^4.17.21", "@types/node": "^20", + "@types/nodemailer": "^6.4.14", "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", - "copyfiles": "^2.4.1", - "eslint": "^8.57.0", + "eslint": "^8", "eslint-config-next": "14.1.4", "nodemon": "^3.1.0", "postcss": "^8", diff --git a/package2.json b/package2.json new file mode 100644 index 0000000..11f099e --- /dev/null +++ b/package2.json @@ -0,0 +1,70 @@ +{ + "name": "cna", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "cross-env PAYLOAD_CONFIG_PATH=src/payload-config.ts nodemon", + "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload-config.ts payload generate:types", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@hookform/resolvers": "^3.3.4", + "@payloadcms/bundler-webpack": "^1.0.6", + "@payloadcms/db-mongodb": "^1.4.3", + "@payloadcms/richtext-lexical": "^0.7.0", + "@radix-ui/react-dialog": "^1.0.5", + "@radix-ui/react-dropdown-menu": "^2.0.6", + "@radix-ui/react-label": "^2.0.2", + "@radix-ui/react-scroll-area": "^1.0.5", + "@radix-ui/react-separator": "^1.0.3", + "@radix-ui/react-slot": "^1.0.2", + "@solana/pay": "^0.2.5", + "@solana/wallet-adapter-base": "^0.9.5", + "@solana/wallet-adapter-react": "^0.15.4", + "@solana/wallet-adapter-react-ui": "^0.9.6", + "@solana/wallet-adapter-wallets": "^0.19.32", + "@solana/web3.js": "^1.91.1", + "@tanstack/react-query": "4.36.1", + "@trpc/client": "^10.45.2", + "@trpc/next": "^10.45.2", + "@trpc/react-query": "^10.45.2", + "@trpc/server": "^10.45.2", + "class-variance-authority": "^0.7.0", + "clsx": "^2.1.0", + "cross-env": "^7.0.3", + "dotenv": "^16.4.5", + "escape-html": "^1.0.3", + "express": "^4.19.1", + "lucide-react": "^0.363.0", + "next": "14.1.4", + "nodemailer": "^6.9.13", + "payload": "^2.11.2", + "react": "^18", + "react-dom": "^18", + "react-hook-form": "^7.51.1", + "sonner": "^1.4.41", + "swiper": "^11.0.7", + "tailwind-merge": "^2.2.2", + "tailwindcss-animate": "^1.0.7", + "ts-node": "^10.9.2", + "zod": "^3.22.4", + "zustand": "^4.5.2" + }, + "devDependencies": { + "@types/escape-html": "^1.0.4", + "@types/express": "^4.17.21", + "@types/node": "^20", + "@types/nodemailer": "^6.4.14", + "@types/react": "^18", + "@types/react-dom": "^18", + "autoprefixer": "^10.0.1", + "eslint": "^8", + "eslint-config-next": "14.1.4", + "nodemon": "^3.1.0", + "postcss": "^8", + "tailwindcss": "^3.3.0", + "typescript": "^5" + } +} diff --git a/src/get-payload.ts b/src/get-payload.ts index 5c60944..c7778cb 100644 --- a/src/get-payload.ts +++ b/src/get-payload.ts @@ -2,22 +2,11 @@ import dotenv from 'dotenv' import path from 'path' import type { InitOptions } from 'payload/config' import payload, { Payload } from 'payload' -import nodemailer from 'nodemailer' dotenv.config({ path: path.resolve(__dirname, '../.env'), }) -const transporter = nodemailer.createTransport({ - host: 'smtp.resend.com', - secure: true, - port: 465, - auth: { - user: 'resend', - pass: process.env.RESEND_API_KEY, - }, -}) - let cached = (global as any).payload if (!cached) { diff --git a/src/server.ts b/src/server.ts index 5f3c88b..149c43a 100644 --- a/src/server.ts +++ b/src/server.ts @@ -47,23 +47,23 @@ const start = async () => { return } - const cartRouter = express.Router() + const checkoutRouter = express.Router() - cartRouter.use(payload.authenticate) + checkoutRouter.use(payload.authenticate) - cartRouter.get('/', (req, res) => { + checkoutRouter.get('/', (req, res) => { const request = req as PayloadRequest if (!request.user) - return res.redirect('/sign-in?origin=cart') + return res.redirect('/sign-in?origin=checkout') const parsedUrl = parse(req.url, true) const { query } = parsedUrl - return nextApp.render(req, res, '/cart', query) + return nextApp.render(req, res, '/checkout', query) }) - app.use('/cart', cartRouter) + app.use('/checkout', checkoutRouter) app.use( "/api/trpc",