mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-22 16:51:34 +00:00
Preparing for deployment
This commit is contained in:
parent
17ca8fcf59
commit
0a40b7c04c
@ -4,10 +4,10 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"build": "prisma generate && next build && prisma migrate deploy",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"postinstall": "npx prisma generate"
|
||||
"postinstall": "prisma generate"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "^3.645.0",
|
||||
|
@ -1,6 +1,12 @@
|
||||
// datasource db {
|
||||
// provider = "postgresql"
|
||||
// url = env("DATABASE_URL")
|
||||
// }
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
provider = "postgresql"
|
||||
url = env("POSTGRES_PRISMA_URL")
|
||||
directUrl = env("POSTGRES_URL_NON_POOLING")
|
||||
}
|
||||
|
||||
generator client {
|
||||
|
@ -39,8 +39,6 @@ export default function CourseDetails({ processedEvent, paidCourse, lessons, dec
|
||||
const windowWidth = useWindowWidth();
|
||||
const isMobileView = windowWidth <= 768;
|
||||
|
||||
const lnAddress = process.env.NEXT_PUBLIC_LIGHTNING_ADDRESS;
|
||||
|
||||
useEffect(() => {
|
||||
if (session) {
|
||||
setUser(session.user);
|
||||
@ -86,7 +84,7 @@ export default function CourseDetails({ processedEvent, paidCourse, lessons, dec
|
||||
if (paidCourse && !decryptionPerformed) {
|
||||
return (
|
||||
<CoursePaymentButton
|
||||
lnAddress={lnAddress}
|
||||
lnAddress={author?.lnAddress}
|
||||
amount={processedEvent.price}
|
||||
onSuccess={handlePaymentSuccess}
|
||||
onError={handlePaymentError}
|
||||
|
@ -19,8 +19,6 @@ import appConfig from "@/config/appConfig";
|
||||
import useTrackCourse from '@/hooks/tracking/useTrackCourse';
|
||||
import { ProgressSpinner } from 'primereact/progressspinner';
|
||||
|
||||
const lnAddress = process.env.NEXT_PUBLIC_LIGHTNING_ADDRESS;
|
||||
|
||||
export default function CourseDetailsNew({ processedEvent, paidCourse, lessons, decryptionPerformed, handlePaymentSuccess, handlePaymentError }) {
|
||||
const [zapAmount, setZapAmount] = useState(0);
|
||||
const [author, setAuthor] = useState(null);
|
||||
|
@ -1,8 +1,4 @@
|
||||
import prisma from "../prisma";
|
||||
import { webln } from "@getalby/sdk";
|
||||
import { LightningAddress } from "@getalby/sdk";
|
||||
|
||||
const lnAddress = process.env.NEXT_PUBLIC_LIGHTNING_ADDRESS;
|
||||
|
||||
export const getAllUsers = async () => {
|
||||
return await prisma.user.findMany({
|
||||
|
@ -12,7 +12,9 @@ import { updateUser } from "@/db/models/userModels";
|
||||
import { createRole } from "@/db/models/roleModels";
|
||||
import appConfig from "@/config/appConfig";
|
||||
|
||||
const BASE_URL = process.env.BASE_URL;
|
||||
// todo update EMAIL_FROM to be a plebdevs email
|
||||
|
||||
const BACKEND_URL = process.env.BACKEND_URL;
|
||||
|
||||
const ndk = new NDK({
|
||||
explicitRelayUrls: appConfig.defaultRelayUrls,
|
||||
@ -26,7 +28,7 @@ const authorize = async (pubkey) => {
|
||||
const profile = await user.fetchProfile();
|
||||
|
||||
// Check if user exists, create if not
|
||||
const response = await axios.get(`${BASE_URL}/api/users/${pubkey}`);
|
||||
const response = await axios.get(`${BACKEND_URL}/api/users/${pubkey}`);
|
||||
if (response.status === 200 && response.data) {
|
||||
const fields = await findKind0Fields(profile);
|
||||
|
||||
@ -34,7 +36,7 @@ const authorize = async (pubkey) => {
|
||||
const combinedUser = { ...fields, ...response.data };
|
||||
|
||||
// Update the user on the backend if necessary
|
||||
// await axios.put(`${BASE_URL}/api/users/${combinedUser.id}`, combinedUser);
|
||||
// await axios.put(`${BACKEND_URL}/api/users/${combinedUser.id}`, combinedUser);
|
||||
|
||||
return combinedUser;
|
||||
} else if (response.status === 204) {
|
||||
@ -43,7 +45,7 @@ const authorize = async (pubkey) => {
|
||||
const fields = await findKind0Fields(profile);
|
||||
const payload = { pubkey, ...fields };
|
||||
|
||||
const createUserResponse = await axios.post(`${BASE_URL}/api/users`, payload);
|
||||
const createUserResponse = await axios.post(`${BACKEND_URL}/api/users`, payload);
|
||||
return createUserResponse.data;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user