A fullstack, multi-app, monorepo dedicated to streamline your development process and satisfy all your needs ;)
Report Bug
·
Request Feature
This project was built based on my needs in my software development experience. Most often, real world software projects require multiple apps to be built. Say, if you're building a web application such as an e-commerce, chances are you would need to also build an admin/back office system, and these applications are likely to be connected to an API. So why not bundle them all up in a monorepo, while creating reusable packages to make development changes faster and easier?
The default template features a NextJS and NestJS app. The package
folder will contain code that should be reusable across apps. My personal favorite is the api
package which bundles and exports react-query queries and mutations to be used across multiple frontend apps (assuming you're using React). Write queries and mutations once, import, and use them in your frontend apps. No more broken API requests because you forgot to implement a few params changes.
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 server
app. Navigate to the server
folder and run
npx supabase start
to start your own local supabase instance through docker. Run
npx supabase stop
inside the server
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
folder inside the packages
folder and run this command.
#inside root level project directory
# non-windows users
cd ./packages && cd ./db && pnpm db:migration
# windows users
cd .\packages\
cd .\db\
pnpm db:migration
# or simply just like this if u already inside the *db* folder 👇
pnpm db:migration
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 apps/server/supabase/triggers
.
-- handle_new_users.sql
-- inserts a row into public.Profile
create function public.handle_new_user()
returns trigger
language plpgsql
security definer set search_path = public
as $$
begin
insert into public."Profile" ("userId")
values (new.id);
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.
ui
packageSee the open issues for a full list of proposed features (and known issues).
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!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
Project Link: https://github.com/entry-point-community/v6-app