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

[♻️ refactor] Use trpc for the project backend #53

Closed
1 task done
Fredkiss3 opened this issue Sep 4, 2023 · 3 comments
Closed
1 task done

[♻️ refactor] Use trpc for the project backend #53

Fredkiss3 opened this issue Sep 4, 2023 · 3 comments
Labels
need-triage This issue needs confirmation refactor code cleanup

Comments

@Fredkiss3
Copy link
Owner

Fredkiss3 commented Sep 4, 2023

What is the reason to do this refactor ?.

This is not needed as of now, but in the future i want to do much more things with the project and recreate the core of github : file hosting and browsing, commit history, time travel on the project, PRs workflow with a way to plug-in an external CI provider, etc.

All of these features will need a formalized backend and extensive testing, i wanted to use a framework like adonis, but trpc might just be enough.

Plus :

  • using trpc instead of adonis can give us stronger type sharing between the back & frontend, not only will we be able to share zod schemas, we will also share type checking on inputs & outputs of procedures & mutations.
  • we will also be able to use drizzle, since i started the repo with this, i can continue to use that.
  • Testing will be easier

Downsides :

  • I will have to implement some things by myself while in adonis it has been thoroughly implemented and tested

Describe the work that needs to be done

We need to pass to a monorepo organized as such :

  • packages/
    • api/ : trpc server + fastity + exported zod schemas (in another file, to avoid importing the trpc client in the web app)
  • apps/
    • web/ : nextjs app

Additional context

For inspiration, we can see :

Both use an HTTP adapter for RSCs and server actions.
We will also have to see the fastify adapter to host the API :

Some packages for reference :

@Fredkiss3 Fredkiss3 added refactor code cleanup need-triage This issue needs confirmation and removed need-triage This issue needs confirmation labels Sep 4, 2023
@Fredkiss3 Fredkiss3 added this to Gh-next Sep 4, 2023
@Fredkiss3 Fredkiss3 changed the title [♻️ refactor] Use trpc for the project backend [♻️ refactor] Use trpc or adonisjs for the project backend Sep 4, 2023
@Fredkiss3 Fredkiss3 changed the title [♻️ refactor] Use trpc or adonisjs for the project backend [♻️ refactor] Use trpc for the project backend Sep 4, 2023
@Fredkiss3 Fredkiss3 added the need-triage This issue needs confirmation label Sep 23, 2023
@Fredkiss3 Fredkiss3 removed this from Gh-next Sep 24, 2023
@Fredkiss3
Copy link
Owner Author

In the prospect of doing this, we might as well just use adonis for the backend, for sharing zod schemas we could take inspiration from this project : /~https://github.com/Christopher2K/weakassdev.

Plus we could use adonis built-in (and community modules) for this.

@Fredkiss3
Copy link
Owner Author

I think we can instead continue working with app router and the current architecture, without using neither tRPC or adonis.

But still expand the scope :

  • file hosting
  • file browsing
  • commit history
  • time travel
  • issue kanban board (like github projects), to close an issue either with a commit or from the UI
  • running CI with docker, we can take inspiration from gitlab : https://gitlab.com/gitlab-org/gitlab
  • support git push and git remote <cmd>

@Fredkiss3
Copy link
Owner Author

not planned, will stay on next app router

@Fredkiss3 Fredkiss3 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-triage This issue needs confirmation refactor code cleanup
Projects
None yet
Development

No branches or pull requests

1 participant