Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment #46

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 57 additions & 57 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
name: Node.js CI

on:
push:
branches:
- main
pull_request:
branches:
- main
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
uses: actions/checkout@v3
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Check Environment Variables
run: |
echo "NEXT_PUBLIC_SITE_URL is set: ${{ env.NEXT_PUBLIC_SITE_URL != '' }}"
echo "NEXTAUTH_SECRET is set: ${{ env.NEXTAUTH_SECRET != '' }}"
echo "GOOGLE_ID is set: ${{ env.GOOGLE_ID != '' }}"
echo "GOOGLE_SECRET is set: ${{ env.GOOGLE_SECRET != '' }}"
echo "TURSO_AUTH_TOKEN is set: ${{ env.TURSO_AUTH_TOKEN != '' }}"
echo "TURSO_DATABASE_URL is set: ${{ env.TURSO_DATABASE_URL != '' }}"
echo "RESEND_API_KEY" is set ${{ env.RESEND_API_KEY != '' }}
echo
env:
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }}
TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
- name: Check Environment Variables
run: |
echo "NEXT_PUBLIC_SITE_URL is set: ${{ env.NEXT_PUBLIC_SITE_URL != '' }}"
echo "NEXTAUTH_SECRET is set: ${{ env.NEXTAUTH_SECRET != '' }}"
echo "GOOGLE_ID is set: ${{ env.GOOGLE_ID != '' }}"
echo "GOOGLE_SECRET is set: ${{ env.GOOGLE_SECRET != '' }}"
echo "TURSO_AUTH_TOKEN is set: ${{ env.TURSO_AUTH_TOKEN != '' }}"
echo "TURSO_DATABASE_URL is set: ${{ env.TURSO_DATABASE_URL != '' }}"
echo "RESEND_API_KEY" is set ${{ env.RESEND_API_KEY != '' }}
echo
env:
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }}
TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}

- name: Build project
run: npm run build
env:
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }}
TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
RAZORPAY_KEY_ID: ${{ secrets.RAZORPAY_KEY_ID }}
RAZORPAY_SECRET: ${{ secrets.RAZORPAY_SECRET }}
NEXT_PUBLIC_RAZORPAY_KEY_ID: ${{ secrets.NEXT_PUBLIC_RAZORPAY_KEY_ID }}
- name: Build project
run: npx prisma generate && npx prisma migrate deploy && npm run build
env:
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
TURSO_AUTH_TOKEN: ${{ secrets.TURSO_AUTH_TOKEN }}
TURSO_DATABASE_URL: ${{ secrets.TURSO_DATABASE_URL }}
RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }}
RAZORPAY_KEY_ID: ${{ secrets.RAZORPAY_KEY_ID }}
RAZORPAY_SECRET: ${{ secrets.RAZORPAY_SECRET }}
NEXT_PUBLIC_RAZORPAY_KEY_ID: ${{ secrets.NEXT_PUBLIC_RAZORPAY_KEY_ID }}

- name: Upload build artifacts (optional)
if: always()
uses: actions/upload-artifact@v3
with:
name: build
path: build # Adjust this if your build output is in a different directory
- name: Upload build artifacts (optional)
if: always()
uses: actions/upload-artifact@v3
with:
name: build
path: build # Adjust this if your build output is in a different directory
38 changes: 22 additions & 16 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "tedx-sjec.github.io",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "startup-template-sage.vercel.app",
port: "",
pathname: "/**",
},
],
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "tedx-sjec.github.io",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "startup-template-sage.vercel.app",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "utfs.io",
port: "",
pathname: "/**",
},
],
},
};

export default nextConfig;
11 changes: 8 additions & 3 deletions src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ export default function RootLayout({
<html lang="en">
<body className={inter.className}>
<Providers>
<div className="flex">
<AdminNavbar />
{children}
<div className="flex h-screen">
<div className="fixed h-full">
<AdminNavbar />
</div>
<div className="flex-1 ml-[250px] overflow-y-auto">
{children}
</div>
</div>

</Providers>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion src/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function AdminPage() {

return (
<>
<div className="w-screen h-screen flex justify-center items-center">
<div className=" h-screen flex justify-center items-center">
<Coupon session={session} />
</div>
</>
Expand Down
16 changes: 9 additions & 7 deletions src/app/admin/payment/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { SearchableInfiniteScrollTable } from "@/components/common/searchable-infinite-scroll-table";
import prisma from "@/server/db";
import React from "react";

export default async function Payments() {
return (
<>
<div className="pt-20 flex min-h-screen w-full flex-col bg-background">
<SearchableInfiniteScrollTable />
</div>
</>
);
const totalPayments = await prisma.payment.count();
return (
<>
<div className="pt-20 flex min-h-screen w-full flex-col bg-background">
<SearchableInfiniteScrollTable totalPayments={totalPayments} />
</div>
</>
);
}
61 changes: 33 additions & 28 deletions src/app/admin/users/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@ import prisma from "@/server/db";
import React from "react";

export default async function Users() {
let initialUserData = await prisma.user.findMany({
select: {
id: true,
name: true,
email: true,
role: true,
image: true,
},
take: 10,
});
if (initialUserData === null) {
initialUserData = [
{
id: "1",
name: "Test name",
email: "[email protected]",
role: "PARTICIPANT",
image: "https://i.pravatar.cc/300?img=1",
},
];
}
return (
<>
<div className="pt-20 flex min-h-screen w-full flex-col bg-background">
<UsersList initialUsers={initialUserData} initialPage={1} />
</div>
</>
);
let initialUserData = await prisma.user.findMany({
select: {
id: true,
name: true,
email: true,
role: true,
image: true,
},
take: 10,
});
const totalNumberOfUsers = await prisma.user.count();
if (initialUserData === null) {
initialUserData = [
{
id: "1",
name: "Test name",
email: "[email protected]",
role: "PARTICIPANT",
image: "https://i.pravatar.cc/300?img=1",
},
];
}
return (
<>
<div className="pt-20 flex min-h-screen w-full flex-col bg-background">
<UsersList
initialUsers={initialUserData}
initialPage={1}
totalNumberOfUsers={totalNumberOfUsers}
/>
</div>
</>
);
}
Loading
Loading