Skip to content

Commit e0aec15

Browse files
authored
Merge pull request #135 from medusajs/feat/app-router-vic
feat: migrate to app router
2 parents ba4744b + 764cf5a commit e0aec15

File tree

84 files changed

+711
-761
lines changed

Some content is hidden

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

84 files changed

+711
-761
lines changed

.env.template

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Your Medusa backend, should be updated to where you are hosting your server. Remember to update CORS settings for your server. See – https://docs.medusajs.com/usage/configurations#storefront-cors
22
NEXT_PUBLIC_MEDUSA_BACKEND_URL=http://localhost:9000
33

4+
# Your store URL, should be updated to where you are hosting your storefront.
5+
NEXT_PUBLIC_BASE_URL=http://localhost:8000
6+
7+
# Posgres URL for your Medusa DB for the Product Module. See - https://docs.medusajs.com/modules/products/serverless-module
8+
PRODUCT_POSTGRES_URL=postgres://postgres:postgres@localhost:5432/medusa-store
9+
410
# Your Stripe public key. See – https://docs.medusajs.com/add-plugins/stripe
511
NEXT_PUBLIC_STRIPE_KEY=
612

@@ -11,4 +17,4 @@ NEXT_PUBLIC_PAYPAL_CLIENT_ID=
1117
NEXT_PUBLIC_SEARCH_APP_ID=
1218
NEXT_PUBLIC_SEARCH_ENDPOINT=http://127.0.0.1:7700
1319
NEXT_PUBLIC_SEARCH_API_KEY=
14-
NEXT_PUBLIC_SEARCH_INDEX_NAME=products
20+
NEXT_PUBLIC_SEARCH_INDEX_NAME=products

next-env.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
/// <reference types="next/navigation-types/compat/navigation" />
43

54
// NOTE: This file should not be edited
65
// see https://nextjs.org/docs/basic-features/typescript for more information.

next.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ const { withStoreConfig } = require("./store-config")
22
const store = require("./store.config.json")
33

44
module.exports = withStoreConfig({
5+
experimental: {
6+
serverActions: true,
7+
},
58
features: store.features,
69
reactStrictMode: true,
710
images: {
8-
domains: ["medusa-public-images.s3.eu-west-1.amazonaws.com", "localhost"],
11+
domains: [
12+
"medusa-public-images.s3.eu-west-1.amazonaws.com",
13+
"localhost",
14+
"medusa-server-testing.s3.amazonaws.com",
15+
],
916
},
1017
})
1118

src/app/account/addresses/layout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
3+
export default function AddressPageLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode
7+
}) {
8+
return <AccountLayout>{children}</AccountLayout>
9+
}

src/app/account/addresses/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import AddressesTemplate from "@modules/account/templates/addresses-template"
2+
import { Metadata } from "next"
3+
4+
export const metadata: Metadata = {
5+
title: "Addresses",
6+
description: "View your addresses",
7+
}
8+
9+
export default function Addresses() {
10+
return <AddressesTemplate />
11+
}

src/app/account/layout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import PageLayout from "app/page-layout"
2+
3+
export default function AccountPageLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode
7+
}) {
8+
return <PageLayout>{children}</PageLayout>
9+
}

src/app/account/login/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import LoginTemplate from "@modules/account/templates/login-template"
2+
import { Metadata } from "next"
3+
4+
export const metadata: Metadata = {
5+
title: "Sign in",
6+
description: "Sign in to your ACME account.",
7+
}
8+
9+
export default function Login() {
10+
return <LoginTemplate />
11+
}

src/app/account/orders/layout.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
3+
export default function OrdersPageLayout({
4+
children,
5+
}: {
6+
children: React.ReactNode
7+
}) {
8+
return <AccountLayout>{children}</AccountLayout>
9+
}

src/app/account/orders/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import OrdersTemplate from "@modules/account/templates/orders-template"
2+
import { Metadata } from "next"
3+
4+
export const metadata: Metadata = {
5+
title: "Orders",
6+
description: "Overview of your previous orders..",
7+
}
8+
9+
export default function Orders() {
10+
return <OrdersTemplate />
11+
}

src/app/account/page.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import AccountLayout from "@modules/account/templates/account-layout"
2+
import OverviewTemplate from "@modules/account/templates/overview-template"
3+
import { Metadata } from "next"
4+
5+
export const metadata: Metadata = {
6+
title: "Account",
7+
description: "Overview of your account activity.",
8+
}
9+
10+
export default function Account() {
11+
return (
12+
<AccountLayout>
13+
<OverviewTemplate />
14+
</AccountLayout>
15+
)
16+
}

0 commit comments

Comments
 (0)