Skip to content

Commit 41b6cec

Browse files
authored
Merge pull request #264 from moinulmoin/improve-structure
refactor: ♻️ improve file, folder structure
2 parents b80841c + dd8b62c commit 41b6cec

File tree

42 files changed

+69
-95
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+69
-95
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"autoprefixer": "10.4.20",
6161
"class-variance-authority": "^0.7.0",
6262
"clsx": "^2.1.1",
63-
"encoding": "^0.1.13",
6463
"eslint": "8.56.0",
6564
"eslint-config-next": "15.0.3",
6665
"eslint-config-prettier": "^8.10.0",

pnpm-lock.yaml

Lines changed: 0 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/actions/auth.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
import { revalidatePath } from "next/cache";
44
import { redirect } from "next/navigation";
55
import { alphabet, generateRandomString } from "oslo/crypto";
6-
import { deleteSessionTokenCookie } from "~/lib/cookies";
7-
import prisma from "~/lib/prisma";
8-
import { getCurrentSession, invalidateSession } from "~/lib/session";
6+
import { deleteSessionTokenCookie } from "~/lib/server/cookies";
7+
import prisma from "~/lib/server/prisma";
8+
import { getCurrentSession, invalidateSession } from "~/lib/server/session";
99

1010
export async function logout() {
1111
const { session } = await getCurrentSession();
12-
1312
if (!session) {
1413
return {
1514
message: "Unauthorized",

src/actions/mail.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ThanksTemp from "emails/thanks";
44
import VerificationTemp from "emails/verification";
55
import { nanoid } from "nanoid";
6-
import { resend } from "~/lib/resend";
6+
import { resend } from "~/lib/server/resend";
77
import { type SendOTPProps, type SendWelcomeEmailProps } from "~/types";
88

99
export const sendWelcomeEmail = async ({

src/actions/subscription.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use server";
22

33
import { freePlan, proPlan } from "~/config/subscription";
4-
import prisma from "~/lib/prisma";
4+
import prisma from "~/lib/server/prisma";
55
import { type UserSubscriptionPlan } from "~/types";
66

77
export async function getUserSubscriptionPlan(

src/app/[locale]/login/page.tsx renamed to src/app/[locale]/(auth)/login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { redirect } from "next/navigation";
22
import AuthForm from "~/components/layout/auth-form";
33
import { Card } from "~/components/ui/card";
4-
import { getCurrentSession } from "~/lib/session";
4+
import { getCurrentSession } from "~/lib/server/session";
55

66
export default async function Login() {
77
const { session } = await getCurrentSession();

src/app/[locale]/about/page.tsx renamed to src/app/[locale]/(marketing)/about/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { type Metadata } from "next";
44
function AboutCard(about: About) {
55
return (
66
<article className="prose prose-slate mb-8 dark:prose-invert">
7-
<h2 className="mb-0 text-3xl font-semibold tracking-tight transition-colors ">
7+
<h2 className="mb-0 text-3xl font-semibold tracking-tight transition-colors">
88
{about.title}
99
</h2>
1010
<div dangerouslySetInnerHTML={{ __html: about.content }} />

src/app/[locale]/changelog/page.tsx renamed to src/app/[locale]/(marketing)/changelog/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { type Metadata } from "next";
55
function ChangeCard(change: Change) {
66
return (
77
<article className="prose prose-slate mb-8 dark:prose-invert">
8-
<h2 className=" mb-0 text-3xl font-semibold tracking-tight transition-colors">
8+
<h2 className="mb-0 text-3xl font-semibold tracking-tight transition-colors">
99
{change.title}
1010
</h2>
11-
<time className=" text-sm text-muted-foreground" dateTime={change.date}>
11+
<time className="text-sm text-muted-foreground" dateTime={change.date}>
1212
{dayjs(change.date).format("MMM DD YYYY")}
1313
</time>
1414
<div dangerouslySetInnerHTML={{ __html: change.content }} />

src/app/[locale]/@loginDialog/(.)login/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { redirect } from "next/navigation";
22
import LoginModal from "~/components/layout/login-modal";
3-
import { getCurrentSession } from "~/lib/session";
3+
import { getCurrentSession } from "~/lib/server/session";
44

55
export default async function Login() {
66
const { session } = await getCurrentSession();

src/app/[locale]/dashboard/billing/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { AlertTriangleIcon } from "lucide-react";
22
import { getUserSubscriptionPlan } from "~/actions/subscription";
33
import { BillingForm } from "~/components/billing-form";
44
import { Alert, AlertDescription } from "~/components/ui/alert";
5-
import { getCurrentSession } from "~/lib/session";
6-
import { stripe } from "~/lib/stripe";
5+
import { getCurrentSession } from "~/lib/server/session";
6+
import { stripe } from "~/lib/server/stripe";
77

88
export const revalidate = 0;
99
export const dynamic = "force-dynamic";

0 commit comments

Comments
 (0)