Giter Site home page Giter Site logo

albingroen / prismabuilder.io Goto Github PK

View Code? Open in Web Editor NEW
263.0 3.0 29.0 1.81 MB

Build your Prisma schema visually in this easy-to-use web based tool

Home Page: https://www.prismabuilder.io

TypeScript 96.89% JavaScript 0.78% CSS 2.33%
prisma nextjs tailwindcss

prismabuilder.io's Introduction

prismabuilder.io

Build your Prisma schema visually in this easy-to-use web based tool.

Try it out at prismabuilder.io

Schema generator code by Richard Powell

Documentation

Generating the schema from JSON

The application uses JSON as the data format, and then generates the Prisma schema string on demand. This is done by sending a POST request to this url and passing in the schema.

axios.post("https://prismabuilder-io-api.onrender.com/generate", { schema });

Parsing a schema string into JSON

axios.post("https://prismabuilder-io-api.onrender.com/parse", { schema });

You can find the code for this here: albingroen/prismabuilder.io-api

prismabuilder.io's People

Contributors

albingroen avatar sonylomo avatar janpio avatar rushikeshg25 avatar

Stargazers

Said BENLYAZID avatar Nicolas Anjoran avatar iPommes avatar urquico avatar jiahen avatar Carter avatar Rafael Drigo avatar Jervi Sir avatar Dennis kinuthia avatar Tutul avatar Tyler Kinney avatar samanyu avatar  avatar Martin Grasso avatar  avatar Christian Louise B. Aranas avatar gooney avatar Abhi  avatar  avatar Francesco Vattiato avatar Matthew Morek avatar Onur Akdeniz avatar Christian Smith Mantas avatar Fardin Abdi avatar Pika avatar Daniel Moisa avatar Dimas Avrian Fachriza. avatar Aleh Putsyla avatar Mohamed Elmardi avatar Rades Pratama avatar  avatar  avatar Eric F. avatar Alessandro Diez avatar  avatar Oli Gray avatar Rihan avatar Anthony avatar Fernando avatar Sayied Amir Ahmadi avatar Subrata Porwal avatar Ali Torki avatar Daniel Eagle avatar Alan Gabriel avatar Rychillie avatar Aland Sleman avatar Sandheep Kumar  avatar  avatar Shashank Bhat  avatar gunaones avatar james avatar Klensch avatar Luka Furlan avatar Amr Badawy avatar Rei avatar limblamb avatar PatoGordo avatar Bruno Wego avatar Liumy avatar  avatar Kuluru Vineeth Kumar Reddy avatar tpkee avatar Akash Jadhav avatar Vivek Palanisamy avatar Clayton avatar Milos Dimitrijevic avatar Giovanni Orciuolo avatar Erick Ponce avatar  avatar Lila Rest avatar Ali Thanikkal avatar Võ Hoàng Đức Khoa avatar Angelo B. J. Luidens avatar Wouter Deen avatar Pablo Anttila avatar guog avatar miguel avatar Maximilian Raschle avatar 小白 avatar Starry North avatar Thomas Lekanger avatar Jarrod Medrano - Senior Software Engineer avatar Lee Hoe Mun avatar Jorge Arreola - Kua.ts avatar  avatar develop-juice avatar  avatar Maximilian Zauner avatar Daniel Mateiu avatar Park Tae Jin avatar Bruno Cassapula avatar <Artisan> avatar Yordan avatar Mehul Kundu avatar sol avatar Roger Lucas avatar Szymon Sukiennik avatar Jovan Blažek avatar Diky Arga avatar Thomas Barbier avatar

Watchers

Maher Chikhaoui avatar  avatar  avatar

prismabuilder.io's Issues

Support composite IDs from Prisma

Hi. Great work with the tool 👍🏼 I am thinking of exposing this to our business. Was trying this out and noticed @@id is not suported as of now.

If I want to define a key as @@id([field1, field2]) as defined here I dont see a way to do that through UI, also the info gets lost when I say generate schema

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Resolve Text Overflow Issue in `react-flow` box component

Hello, This project is amazing. However, I get an issue where text overflows beyond the boundaries of its container. This usually happens when the text length exceeds the size of the box. This can result to readability issues and potential loss of content.

Issue

When having a lengthy text within the node, the text extends beyond the alloted space of the box, causing overflow and disrupts the layout.

Expected Behavior

Text should be properly contained within the box and should either wrap or truncate to maintain readability and visual consistency

Steps to Reproduce:

Here's the prisma model that has an overflow issue when I use it on www.prismabuilder.io

model CustomerInvoicePayments{
  invoicePaymentId        Int @id @default(autoincrement())
}

Here's the result on using that model:
image

Proposed Solution

To address the issue, I think we wrap the text so that it will automaticall adjust based on the length of the string. or if the react-flow does not allow this, maybe we can make the text smaller? Also, I think this problem also occurs on the sub nodes of each main node

Thank you!

Model name not able to edit

Hello there,
I tried to create model, and it is created with new, I am trying to rename it so I can add new model.
Right now It is not editable, and in this case, not able to create new model there. Please help give functionality to make the model name editable.

image

Feature Live Collaboration

It would be good to have live collaboration sessions for more people to join in and prepare and have an overview of their schemas

  • Setup Login with for example GitHub/GitLab, would be good to use next-auth for this one as it is quite handy for such things
  • Show who is working/worked on a model, maybe something along the lines how confluence shows past updates
  • Save previously prepared schemas

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Importation bug

Hello,

When I import this schema it gives me this error "Make sure to import a full schema" :

`datasource db {
provider = "mysql"
url = env("DATABASE_URL")
relationMode = "prisma"
}

generator client {
provider = "prisma-client-js"
}

model users {
id Int @id @default(autoincrement())
email String @db.VarChar(255)
name String? @db.VarChar(255)
username String? @db.VarChar(255)
}
`

Select list impossible to read in dark mode

When I use the site with my browser in dark mode, I have problems displaying the select list. The text is white on a white background which makes it impossible to read. I use chrome as my browser.

Screenshot in light mode :
image

Screenshot in dark mode :
image

Add MongoDB !

Hi, I love the idea behind your tool, but... It didn't supports mongodb.

More than one relation to the same model

When need to add different fields refer to the same model, app generates identical name for value field.

  createdBy         Person?          @relation(fields: [personId], references: [id])
  updatedBy         Person?          @relation(fields: [personId], references: [id])

  personId          String?
  personId          String?

Would be cool to auto set value field name as relation field + model + key field. And set name for relation.

  createdBy         Person?          @relation("createdByPersonId", fields: [createdByPersonId], references: [id])
  updatedBy         Person?          @relation("updatedByPersonId", fields: [updatedByPersonId], references: [id])

  createdByPersonId          String?
  updatedByPersonId          String?

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

ER diagram visualization

It would be awesome if we could view the schema directly with the schema builder as an ER diagram. There is already a little web tool and a prisma generator, but its not very nice copying the schema from one place to several places to few times until I'm done with the changes. Maybe this ER diagram could also be shown while adding new fields.

EDIT: I now noticed that very little graph view icon at the bottom left. But I still think the method how the graph look is not very structured. For me its very hard to read and tell which one is connected to which other.
image
vs.
image

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Template tables

the ability to create and save tables as templates for easier reuse and consistency across your projects

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Fields added that aren't a default type aren't visualized.

I don't know if this is bug just in my computer, but the fields that I add (For example, a field "Item" list in a "User") doesn't appear in the main board.

But, it generated just fine.
Example:

Screenshot from 2022-08-01 13-16-31

Screenshot from 2022-08-01 13-16-44

Even if I refresh the page, it just doesn't appear.

Introduce PWA

Use next-pwa to turn this platform into a pwa reference link is here.

const withPWA = require('next-pwa')

module.exports = withPWA({
  // other next config
})

With a bit of extending some aspects, this pwa could be used via mobile as well and people could do stuff on the go :D

Todo

  • Make app responsive
  • Enable PWA support

Enums

We should add support for creating and using enums in other models

Custom field not shown

I've added a Task model and added that to the User model as tasks field but it does not show in the list. When exporting the schema you can see the data is actually there. Tried it twice so that why it shows the field twice.

image

Database selector

Since the available fields and default values differ depending on what database you're using with Prisma, it might be a good idea to add a selector for specifying which database you're going to use you're schema with.

Could looks something like this:

image

Software License

Hi @albingroen, really awesome tool you've built here. I was wondering if there’s any limitations to using your code in other projects since there’s no license included in the repository?

Multiple schemas

We should introduce functionality for working with multiple schemas and not just one.

Requirements

  • URL based
  • Sync with local storage

Add prisma schema migration

Hi,

Thank you for your amazing work on this project!

I have a suggestion for a new feature that I believe would significantly improve the user experience: visual schema migration.

Currently, migrating schemas can be a complex and error-prone process. A visual editor would allow users to easily define the target schema by dragging and dropping tables and columns. The editor could highlight potential conflicts and suggest corrective actions, making the process much more intuitive and streamlined.

To track previous schemas and guide users through individual migrations, user accounts could be integrated into the feature. This would allow users to store their preferred schemas and easily initiate and apply migrations with one click.

I think this feature would be incredibly valuable for the project and its users. I'd be happy to discuss this further and contribute in any way possible.

Reorder tables

I would like to reorder the tables just like the fields of it.

its similar to issue #36

Update relations on model rename

For now need to reset relation when target model was renamed.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Improve Accessibility

Add missing accessibility features, when navigating with keyboard, reference for that would be here

Also resolve some lighthouse related topics to bring up the accessibility score:

image

Save data to local storage

Data is currently just stored in memory, resulting in a clean slate after reloading the page. This was a decision I took to lower the barrier to shipping.

Now would probably be a good time to implement data saving to local storage throughout the app.

File live editing

It would be awesome if I could start the editor e.g. via npx prisma builder and then a browser opens with the current schema, so that I can make changes and if I'm done the changes will be persisted to the local disk so that there is no 3rd pary API server needed (no data will be send to stranger servers, all data is keep private on local computer). It would also be nice if that also re-syncs from disk, so that if I change the schema on disk it will be updated on the builder UI.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Implict many-to-many relationships

When adding a reference to another model, it would be nice if you could specify the cardinality of the relationship (one-to-one, one-to-many, many-to-many).
It could add the necessary fields to the respective models in the schema.

I'd be happy to help and open PR for this.

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.