xmindltd / xmind-sdk-js

This is a lightweight official software development kit to help people who wants to build the mapping file without the UI client and It's also supported to run in Browser or Node.js.
https://xmind.app
MIT License
445 stars 61 forks source link

I have XMind to SQL #65

Closed TonyGravagno closed 1 year ago

TonyGravagno commented 1 year ago

I just found this project. I see a note in the README that in the future there may be an official API into .xmind file/archives. I would welcome that API. (EDIT: My mistake: I mis-read the text in the readme.)

I would publish this somewhere else but I don't know where info like this might be visible to XMind users.

I recently wrote an app that extracts content.json from a .xmind file, and generates related SQL tables from maps that define database schema. This is a private, personal, non-commercial project by a self-employed developer. It is written in JavaScript over NodeJS, and is currently dedicated to MySQL. It will be enhanced with TypeScript and at some point should support other databases.

SQL is not a featured export option even for XMind Pro. I was thinking that when this is ready for general use I might purchase a Pro license, to be compliant with terms and to benefit from extended features. Then I am considering offer SaaS to process documents into schema. After that, the code might be FOSS'd.

Now that I'm familiar with the .xmind schema, and at some point I might look into this xmind-sdk-js to do the reverse, generating maps from SQL. There are tons of applications for that.

If XMind Ltd or anyone else is interested in this, please let me know. This is not yet ready for use by anyone else, but as I learn more about use cases from this audience, I'll add more features to prepare for whatever comes from this later.

Thanks for your time.

danielsss commented 1 year ago

Hi @TonyGravagno

What a note in the README that you have read? It would be possible to leave the link here because I am not sure about which API is.

As we all know our company never advertise to the clients and we only inform the news or important things by email or other social apps.

It's a great idea to generate the related SQL schema by a map. Personally speaking, I am very interested in your app but it would be very difficult if we do this from a company's perspective.

TonyGravagno commented 1 year ago

I edited my note above. This repo project creates .xmind files. I thought a library was planned to extract data From .xmind files.

Yes, I thank XMind Ltd for Not advertising to clients/users, but I do welcome news of your progress.

To be clear: I already have .xmind to SQL. I call my project XMind2DB. A sample is blow of a map that defines the schema, and the SQL for one of the tables. (Map is intentionally blurred for privacy.)

Current Features Topics on the map represent tables which are categorized under parent nodes. Relationships are translated into foreign-keys. Data types for fields are defined in Matrix-style nodes. Labels are used for some metadata. Notes on Topics are added as notes in the SQL. Labels are used for a few purposes. One is to tag fields that are in the map only to define relationships, and these do not create fields in the tables. Another use of labels is to define fields that require an index. Some Topics with a specific label do not translate into tables themselves, but contain collections of fields that are common to other tables. For example, many files have a user and timestamp, so there is a single Topic with those fields and other tables "inherit" these fields. Some Topics define Cross-Index tables for many-to-many relationships. There are a Lot of features that I have planned, for generating good SQL and also for going back to annotate the map - with errors found in type definitions, discrepancies in similar types (Description defined as both varchar 250 and 300), invalid relations, possible missing relations, separation of tables into different databases, and integration with other SQL-related tools.

230313140902

CREATE TABLE AuditLog (
  Key SERIAL,
  UserId BIGINT UNSIGNED,
  Timestamp TIMESTAMP(4),
  TableName varchar(60),
  FieldName varchar(60),
  ChangeFrom varchar(4000),
  ChangeTo varchar(4000),
  OldRecordKey BIGINT UNSIGNED,
  NewRecordKey BIGINT UNSIGNED,
  PRIMARY KEY (Key)
);

ALTER TABLE AuditLog (
  ADD CONSTRAINT 'fk_UserId_Users'
     FOREIGN KEY 'UserId'
     REFERENCES 'Users' (ID)
);

OK, I understand that the company does not plan to do this. That's good for me. :)

Also note again, that so far this is a personal project. It's fun for me and I can see using it for business. I'm not 100% sure yet of what I want to do with this ... which is why I'm putting all of this into this thread.

When someone creates a "product" like this, that is built on your platform, what do you think about creating a page on your site named "Built For XMind", where developers can profile their offerings? These "addons" might be free, code or SaaS, freemium, or commercial. The company does not need to "advocate" the addon, as in, you don't need to say it's good, and you can clearly state that these are NOT from XMind Ltd.

The benefit to everyone is that an ecosystem can be created around this platform, making it more valuable to the audience - and without you having to do all of the coding and support. Your own projects like this SDK repo can be profiled on that page so that people can easily find it.

Without a page on the company site to profile offerings like this, there are no other "vectors" to the XMind user audience. You have the keys to your channel. So an initiative like this can't move forward without you.

About business models: Personally, I support Many FOSS projects, whether with suggestions, answers to questions, bug reports, documentation, code, or QA. I do this gladly and freely. But I also need to eat, so I create and host some software for-fee. I would probably not FOSS this project for a while. I would prefer to offer it as freemium SaaS where people subscribe to my service and they can upload maps and download the SQL. But if I can do this for some of your commercial clients, I would be encouraged to FOSS some of my components for others to build their own addons. I might publish an API to extradt data from .xmind files - or at least blog about how I do it.

This is how an ecosystem develops. If we all insist on everything being "free", many things simply never happen because there is no motivation - people need to eat, even if their offerings are "free". By fostering a diverse ecosystem of free and "pro" offerings, there is something for everyone and more opportunities for the creation of solutions to challenges voiced by commercial users. Your prospects and clients can get more out of your products without you having to schedule the time and budget to create new features. More solutions based on the platform mean more sales. That's good for you and everyone else here.

I'm happy to continue this discussion here, but if you would like to move it off-site, I welcome an email to my GitHub account, or I can email XMind Support or some other address that you prefer.

Thanks for your time.

danielsss commented 1 year ago

Hi @TonyGravagno ,

  1. I've implemented an API of extract from .xmind and it's based on the branch, I didn't release this feature because of #20

  2. I think you publish an API to extract data from the files, which would be good and more straightforward for some simple features like you doing so.

  3. I got your point about what you are gonna do. If we are going to build a page as you mentioned above, It would be not very simple because we need to be responsible for our users and also need to make it proper :D. Anyway, This isn't a decision that I can make. It's up to my boss and I will let him know about your idea or you can try to get in touch with him through our support team. He is keen to do something that I can't anticipate and he is discerning of the business.

BTW, We have a lot of work to do this year. :> thanks for getting through to us.

TonyGravagno commented 1 year ago

I sincerely appreciate that you have taken your time with me here, and I will not take more of your time on this. :)

We have a lot of work to do this year. :> thanks for getting through to us.

I see that, and I've been thinking that more open APIs would help the company to have solutions in your portfolio - even without you needing to code these new solutions yourselves. This page of resources that I've described is similar to your existing gallery : This is what people are building with XMind. People might buy XMind because of addons in the third-party ecosystem. When you get more sales, for whatever reason, we all benefit, because it helps to keep the product alive. These things all work together.

I've just completed the database model above, with many more SQL constraints defined in nodes, more relations defined by relationships/lines, inter-relations with databases not defined here that already exist elsewhere, and many more features that improve the final scripts. To be clear: This map actually generates a full database without errors.

There are still many more challenges for this, one of which is to improve how the mindmap describes schema to make it easier for others to use. Some of this code can now be used to generate PHP or JavaScript that operates on the file structures, directly or remotely, and I'm already considering generating other database types and source code for other languages.

I'm excited about using XMind for all of this and more. It's not just about databases. A good mindmap describes structures in the real world, and by parsing the map we can use this data to interact with other systems and products. I hope you folks get excited with me. :)

image