This project is the first e-commerce created by me. So i'm sorry if the code is "Amburadul" 😂. Fyi i don't have an "IT Background", so this project was made just to proves that people like me can make a thing like this :)
- pnpm
- Turborepo
- NextJS
- NestJS
- Prisma
- Supabase
One thing to note is that this stack is kind of opinionated, but you are completely free to tweak anything according to your needs and preferences. For example, this stack heavily depends on Supabase for auth and file storage, but you are still free to setup/build your preferred way of handling auth and storage.
The instructions below will mostly cover the default pre-configured frameworks and libraries I personally chose as the starting template of the V6 Stack.
$ pnpm install
Several .env.template
files have been created for you. Create your own .env
to be used in your project. Adjust the needed values accordingly.
To develop using supabase locally, a supabase config is provided inside the api
app. Navigate to the api
folder and run
npx supabase start
to start your own local supabase instance through docker. Run
npx supabase stop
inside the api
folder to shutdown the containers. For more guides and reference please refer to their official docs.
Create a Prisma migration to sync changes in your schema.prisma
to your database. Navigate to the db
package and run this command.
pnpm db:migrate
If you're using supabase's auth service, chances are you also want to store your user's data inside your database's public
schema. A minimal SQL function and trigger has been provided for you inside packages/db/supabase/triggers
.
-- handle_new_users.sql
-- inserts a row into public."Profiles"
create function public.handle_new_user()
returns trigger
language plpgsql
security definer set search_path = public
as $$
begin
insert into public."Profiles" (id, email, name)
values (
new.id,
new.email,
new.raw_user_meta_data->>'full_name');
return new;
end;
$$;
-- trigger the function every time a user is created
create trigger on_auth_user_created
after insert on auth.users
for each row execute procedure public.handle_new_user();
Run this query on your database to duplicate a user's data every time a user signs up using supabase auth.
Please refer to our non-existent Documentation. We're working on it, I promise.
- Separate Prisma Client to a package
- Separate React Query to a package
- Properly implement reusable configs
- typescript-config
- eslint-config
- dto
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.