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

Updating the demo app to point Medusa V2 official release. #45

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
108 changes: 102 additions & 6 deletions backend/data/medusa-eats-seed-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,25 @@
}
]
}
]
],
"options": [
{
"title": "Dough",
"values": ["Thin Crust", "Thick Crust"]
},
{
"title": "Sauce",
"values": ["Classic", "Garlic-Infused"]
},
{
"title": "Cheese & Toppings",
"values": ["Mozzarella & Tomatoes", "Vegan Option"]
},
{
"title": "Baking Style",
"values": ["Stone Oven", "Conventional Oven"]
}
]
},
{
"title": "Spicy Pepperoni Extravaganza",
Expand All @@ -81,7 +99,25 @@
}
]
}
]
],
"options": [
{
"title": "Dough",
"values": ["Traditional", "Stuffed Crust"]
},
{
"title": "Sauce",
"values": ["Spicy Tomato", "BBQ Base"]
},
{
"title": "Toppings",
"values": ["Classic", "Deluxe"]
},
{
"title": "Baking Style",
"values": ["Crisp", "Soft & Chewy"]
}
]
},
{
"title": "Falafel Wrap Supreme",
Expand All @@ -108,7 +144,25 @@
}
]
}
]
],
"options": [
{
"title": "Falafel",
"values": ["Crispy", "Baked"]
},
{
"title": "Wrap Base",
"values": ["Tortilla", "Pita"]
},
{
"title": "Fillings",
"values": ["Traditional", "Deluxe"]
},
{
"title": "Finishing Touch",
"values": ["Tahini Sauce", "Hot Sauce"]
}
]
},
{
"title": "Mediterranean Falafel Salad",
Expand All @@ -135,7 +189,25 @@
}
]
}
]
],
"options": [
{
"title": "Salad Base",
"values": ["Classic Greens", "Kale & Spinach"]
},
{
"title": "Falafel",
"values": ["Crispy", "Soft"]
},
{
"title": "Dressings",
"values": ["Tahini", "Vinaigrette"]
},
{
"title": "Toppings",
"values": ["Feta & Pita Chips", "Avocado & Sunflower Seeds"]
}
]
},
{
"title": "Craft Lager Beer",
Expand All @@ -162,7 +234,21 @@
}
]
}
]
],
"options": [
{
"title": "Ingredients",
"values": ["Malted Barley", "Gluten-Free"]
},
{
"title": "Fermentation",
"values": ["Classic Lager", "Dry Hopped"]
},
{
"title": "Serving Options",
"values": ["Bottle", "On Tap"]
}
]
},
{
"title": "Chilled Coke Zero",
Expand All @@ -189,7 +275,17 @@
}
]
}
]
],
"options": [
{
"title": "Temperature",
"values": ["Fridge-Cold", "Over Ice"]
},
{
"title": "Packaging",
"values": ["Bottle", "Can"]
}
]
}
]
}
2 changes: 1 addition & 1 deletion backend/medusa-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ loadEnv(process.env.NODE_ENV || "development", process.cwd());

module.exports = defineConfig({
admin: {
backendUrl: "https://medusa-eats.medusajs.app",
backendUrl: "http://localhost:9000/",
},
projectConfig: {
databaseUrl: process.env.DATABASE_URL,
Expand Down
31 changes: 16 additions & 15 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@
"seed": "medusa exec ./src/scripts/seed.ts",
"start": "medusa start",
"dev": "medusa develop",
"setup-db": "npx medusa build && npx medusa migrations run && npx medusa links sync && medusa exec ./src/scripts/seed.ts && npx medusa user -e admin@email.com -p supersecret",
"setup-db": "npx medusa build && npx medusa db:migrate && npx medusa db:sync-links && npx medusa exec ./src/scripts/seed.ts && npx medusa user -e admin@email.com -p supersecret",
"test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
"test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
"test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
},
"dependencies": {
"@medusajs/admin-sdk": "rc",
"@medusajs/framework": "rc",
"@medusajs/medusa": "rc",
"@medusajs/medusa-cli": "rc",
"@medusajs/admin-sdk": "latest",
"@medusajs/framework": "latest",
"@medusajs/medusa": "latest",
"@medusajs/medusa-cli": "latest",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/knex": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.1",
"pg": "^8.13.0",
"cors": "^2.8.5",
"dotenv": "16.3.1",
"express": "^4.17.2",
"jsonwebtoken": "^9.0.2",
"lucide-react": "^0.379.0",
"medusa-core-utils": "rc",
"medusa-core-utils": "latest",
"pg": "^8.13.0",
"prism-react-renderer": "^2.0.4",
"prop-types": "^15.8.1"
},
Expand All @@ -49,25 +49,26 @@
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"@stdlib/number-float64-base-normalize": "0.0.8",
"@swc/core": "1.5.7",
"@swc/jest": "^0.2.36",
"@types/express": "^4.17.13",
"@types/jest": "^29.5.13",
"@types/jsonwebtoken": "^9.0.6",
"@types/mime": "1.3.5",
"@swc/jest": "^0.2.36",
"medusa-test-utils": "rc",
"@types/jest": "^29.5.13",
"jest": "^29.7.0",
"@types/node": "^20.0.0",
"@swc/core": "1.5.7",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"jest": "^29.7.0",
"medusa-test-utils": "rc",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"vite": "^5.2.11"
},
"engines": {
"node": ">=20"
}
},
"packageManager": "yarn@4.5.0+sha512.837566d24eec14ec0f5f1411adb544e892b3454255e61fdef8fd05f3429480102806bac7446bc9daff3896b01ae4b62d00096c7e989f1596f2af10b927532f39"
}
17 changes: 4 additions & 13 deletions frontend/src/lib/actions/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,12 @@ export async function signup(prevState: FormState, data: FormData) {
}

await createUser(createUserData).catch((error) => {
throw new Error("Error creating user");
throw new Error("Error creating user: " + error);
});

const newToken = await createAuthUser({
email,
password,
actor_type,
provider: "emailpass",
});

createSession(newToken);
revalidateTag(getCacheTag("users"));

} catch (error) {
return {
message: "Error creating user",
message: "Error creating user: " + error,
};
}

Expand Down Expand Up @@ -198,4 +189,4 @@ export async function getToken({
);

return token;
}
}