amirfakhrullah / ecommerce-next13beta

E-Commerce site built with Next.js App Router (and other packages like tRPC, Next-Auth, Prisma, etc)

Home Page:https://checks.amrf.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simplify Local Setup with an Initial SQL Database of Products

Daniel-Boll opened this issue Β· comments

Simplify Local Setup with an Initial SQL Database of Products

First and foremost, I want to commend you, Amir, for creating such an impressive project and for generously sharing it with the community.

Problem

As I attempt to run the project locally, I've encountered an issue in having to manually populate the database with products and categories. It would greatly enhance the user experience if an init.sql file were provided that could be loaded to populate the database.

Possible Solution

To simplify local setup, consider providing an init.sql file that contains the minimum database dump necessary, including sample insertions like:

INSERT INTO "Category" (id, name, image, description)
VALUES (
   'clccamgxc0000p3rf9tgn0wo9', 
   'Air Jordan', 
   'images/categories/jordan.png', 
   'The first Air Jordan shoe was produced for Hall of Fame former basketball player Michael Jordan during his time with the Chicago Bulls in late 1984 and released to the public on April 1, 1985.'
);

Future Development

As you continue to work on this project, it may be worth considering the addition of an admin account (as it's already mapped in the schemas). Such an account could allow users to import new products through a .csv file or other similar methods, making it even easier for users to expand the product database.


Once again, thank you for sharing your work with the community. Your contributions are much appreciated.

Best regards,
Daniel Boll 🎴

Hi @Daniel-Boll , thanks for the kind words man, appreciate it!

To simplify local setup, consider providing an init.sql file that contains the minimum database dump necessary, including sample insertions like:

Yes, we can do that using prisma seed scripts. I can work on this later and will update you when it's up.

As you continue to work on this project, it may be worth considering the addition of an admin account (as it's already mapped in the schemas). Such an account could allow users to import new products through a .csv file or other similar methods, making it even easier for users to expand the product database.

Initially, I made this project to test out the new Next.js 13 beta with tRPC and stripe integration. I did plan to expand this project with an admin feature but haven't continue with it since I am quite busy.

If many people request this feature (and maybe willing to contribute as well), I can start planning this out.

Hope that helps πŸ™

@Daniel-Boll the seed scripts are up in the main branch, you can see how to run the scripts here: https://github.com/amirfakhrullah/ecommerce-next13beta#setting-up-locally πŸ‘

Hi @Daniel-Boll , I decided to spend some of my time to build the admin feature and now it is up in the main branch πŸ‘. If you want to see the demo for that feature, here's the link: https://www.youtube.com/watch?v=RJfNc9ef4_I

Great job, @amirfakhrullah! Your accomplishments are truly impressive and your work is of high quality. As someone who is new to the e-commerce world, I have already benefited greatly from your expertise.

I was considering suggesting that we collaborate on some issues to further enhance the common practices of e-commerce such as SEO and analytics. Let me know your thoughts on this and we may work on a PR eventually.

Once again, congratulations on your remarkable achievements!

Best regards,
Daniel Boll 🎴