Skip to content

Commit

Permalink
✨ feat(app): improve the project file hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
blefnk committed Aug 25, 2023
1 parent b61217d commit 3a66fa8
Show file tree
Hide file tree
Showing 175 changed files with 574 additions and 438 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"dotenv": "^16.3.1",
"drizzle-orm": "^0.28.5",
"embla-carousel-react": "8.0.0-rc12",
"lucide-react": "^0.268.0",
"lucide-react": "^0.269.0",
"next": "13.4.19",
"next-international": "^0.9.3",
"next-themes": "^0.2.1",
Expand Down Expand Up @@ -117,7 +117,7 @@
"@t3-oss/env-nextjs": "^0.6.1",
"@tailwindcss/typography": "^0.5.9",
"@tanstack/eslint-plugin-query": "^4.32.5",
"@types/node": "20.5.4",
"@types/node": "20.5.6",
"@types/react": "18.2.21",
"@types/react-dom": "18.2.7",
"@typescript-eslint/eslint-plugin": "^6.4.1",
Expand Down
68 changes: 34 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions prettier.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ const config = {
arrowParens: "always",
endOfLine: "lf",
importOrder: [
"^~/styles/(.*)$",
"",
"^(react/(.*)$)|^(react$)",
"^(next/(.*)$)|^(next$)",
"<THIRD_PARTY_MODULES>",
"",
"^~/utils/types/(.*)$",
"^~/utils/appts/(.*)$",
"^~/utils/(.*)$",
"^~/types/(.*)$",
"^~/server/(.*)$",
"^~/data/(.*)$",
"^~/hooks/(.*)$",
"^~/forms/(.*)$",
"^~/islands/(.*)$",
"^~/styles/(.*)$",
"^~/app/(.*)$",
"^~/env.mjs",
"^~/app.ts",
Expand Down
Binary file removed public/images/avatar/lofi-girl-yt.webp
Binary file not shown.
11 changes: 6 additions & 5 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// ?? To reduce the number of config files, we aim to combine everything into a single file.
// ?? Materials about @satisfies: https://youtu.be/49gHWuepxxE, https://youtu.be/G1RtAmI0-vc

import { ContentSection, HeroHeader } from "~/utils/appts/appts";
import { productCategories } from "~/utils/appts/products";
import { networks } from "~/utils/appts/socials";
import { slugify } from "~/utils/server/utils";
import type { FooterItem, MainNavItem } from "~/utils/types";
import type { FooterItem, MainNavItem } from "~/types";

import { ContentSection, HeroHeader } from "~/server/config/appts";
import { productCategories } from "~/server/config/products";
import { networks } from "~/server/config/socials";
import { slugify } from "~/server/utils";

// ========================================================

Expand Down
2 changes: 1 addition & 1 deletion src/app/(api)/api/newsletter/subscribe/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { eq } from "drizzle-orm";
import { type ErrorResponse } from "resend";
import { z } from "zod";

import { resend } from "~/utils/server/resend";
import { resend } from "~/server/resend";
import { db } from "~/data/db";
import { emailPreferences } from "~/data/db/schema";
import NewsletterWelcomeEmail from "~/data/mail/newsletter-welcome-email";
Expand Down
7 changes: 4 additions & 3 deletions src/app/(api)/api/webhooks/stripe/route.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { headers } from "next/headers";
import { clerkClient } from "@clerk/nextjs";
import type { CheckoutItem } from "~/types";
import { eq } from "drizzle-orm";
import type Stripe from "stripe";

import { stripe } from "~/utils/server/stripe";
import type { CheckoutItem } from "~/utils/types";
import { stripe } from "~/server/stripe";
import { db } from "~/data/db";
import { addresses, carts, orders, payments } from "~/data/db/schema";
import { userPrivateMetadataSchema } from "~/data/zod/auth";
Expand Down Expand Up @@ -94,6 +94,7 @@ export async function POST(req: Request) {
break;
case "payment_intent.succeeded":
// Handle the payment_intent.succeeded event

const stripeObject = event?.data?.object as Stripe.PaymentIntent;

const paymentIntentId = stripeObject?.id;
Expand Down Expand Up @@ -152,7 +153,7 @@ export async function POST(req: Request) {
.update(carts)
.set({
closed: true,
items: null
items: []
})
.where(eq(carts.paymentIntentId, paymentIntentId));
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(adm)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { redirect } from "next/navigation";
import { currentUser } from "@clerk/nextjs";

import { dashboardConfig } from "~/utils/appts/dashboard";
import { dashboardConfig } from "~/server/config/dashboard";
import { SidebarNav } from "~/islands/common/sidebar-nav";
import { SiteFooter } from "~/islands/modules/site-footer";
import { SiteHeader } from "~/islands/modules/site-header";
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(auth)/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { redirect } from "next/navigation";
import { currentUser } from "@clerk/nextjs";

import { SignInForm } from "~/forms/signin-form";
import { OAuthSignIn } from "~/islands/account/oauth-signin";
import { OAuthSignIn } from "~/islands/auth/oauth-signin";
import {
Card,
CardContent,
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(auth)/sign-out/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from "next";

import { LogOutButtons } from "~/islands/account/logout-buttons";
import { LogOutButtons } from "~/islands/auth/logout-buttons";
import {
PageHeader,
PageHeaderDescription,
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(auth)/sign-sso/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type HandleOAuthCallbackParams } from "@clerk/types";

import SSOCallback from "~/islands/account/sso-callback";
import SSOCallback from "~/islands/auth/sso-callback";
import { Shell } from "~/islands/shells/shell";

// Running out of edge function execution units on vercel free plan
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(auth)/sign-up/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { redirect } from "next/navigation";
import { currentUser } from "@clerk/nextjs";

import { SignUpForm } from "~/forms/signup-form";
import { OAuthSignIn } from "~/islands/account/oauth-signin";
import { OAuthSignIn } from "~/islands/auth/oauth-signin";
import {
Card,
CardContent,
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(inner)/dashboard/account/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from "next";

import { UserProfile } from "~/islands/account/user-profile";
import { UserProfile } from "~/islands/auth/user-profile";
import {
PageHeader,
PageHeaderDescription,
Expand Down
Loading

0 comments on commit 3a66fa8

Please sign in to comment.