Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 47 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,62 @@
# PSA: This project is not actively maintained. I consider it feature complete for what it set out to do. I'll fix critical bugs should they pop up but I won't be adding new features.
# If you have any doubt, feel free to contact me at cvazeem@gmail.com

## Requirements
--
A simple webserver and PHP (Version 5 or above) if you want to save public mindmaps. Otherwise PHP is not needed.

# mindmaps
mindmaps is a HTML5 based mind mapping application. It lets you create neat looking mind maps in the browser.
Extract the files and place it in the root directory of your website.

This project started in 2011 as an exploration into what's possible to do in browsers using modern APIs. Nowadays, most of this stuff is pretty common and the code base is a bit outdated. This was way before React, ES6, webpack. Heck, it doesn't even use Backbone.
'S3' folder is used to save the public mindmap files. If you are in linux, make that folder writable, ie, chmod 666

However, there is no reason to change any of that and it makes the code base quite easy to grok. There is no compilation step, no babel plugins, no frameworks. Just a JavaScript application and a very simple Model-View-Presenter pattern.
# i. Google Drive

## HTML5 stuff which was cool in 2011
- 100% offline capable via ApplicationCache
- Stores mind maps in LocalStorage
- FileReader API reads stored mind maps from the hard drive
- Canvas API draws the mind map
Note: This sign-in will not work after February 6, 2023. Google is making changes. Goto the link below to know more about it.
https://developers.googleblog.com/2021/06/upcoming-security-changes-to-googles-oauth-2.0-authorization-endpoint.html

## Try it out
The latest stable build is hosted [here](https://www.mindmaps.app).
How to setup Google Drive:
a. Setup apiKey, clientId, appId from Google Cloud console. Use your website name. Goto https://console.cloud.google.com/
b. Open js/GoogleDrive.js
c. Fill in 'apiKey, clientId, appId' which you obtained from the step, a.

## Build
* First run `npm install` to install required dependencies
* Run `npm run start` to launch a local dev server. The app will be hosted at [http://localhost:3000](http://localhost:3000).
* Run `npm run build` to compile the production bundle. The artifacts will be located in `/dist`.
# ii. S3 storage (public storage)
Make sure there is 'S3' folder in the root path. Make sure it contains two php files, process.php and processFilenames.php . Make 'S3' folder writable. If you are in linux, make that folder writable, ie, chmod 666
Edit 'js/Config.js' and replace 'yourwebsite.com' with your website url.

# iii. Sharemap.js
To share your public map via Facebook, do the following changes.

## Host yourself
All you need is a web server for static files. After building, copy all files from /dist into your web directory and launch the app with index.html.
Make sure your web server serves .appcache files with the mime type `text/cache-manifest` for the application to
be accessible offline.
a. Create an App in facebook. Make sure your website is allowed as origin.

In Apache add the following line to your .htaccess:
Open Sharemap.js and make the following changes.
a. Locate this line (number 28) and change https://www.facebook.com/dialog/feed?app_id=11111111&'
to app_id='With your facebook app id'

```
AddType text/cache-manifest .appcache
```
b. Change http://mindmapmaker.org/mind-map-maker.png (on line number 32) to your website
c. Change https://app.mindmapmaker.org (on line number 34) to your website

In nginx add this to conf/mime.types:
# iv. UrlShortener.js
To share map via 'bit.ly' make changes in js/UrlShortener.js
//Register for an account at bit.ly/a/sign_up
Change 'var username="";' (on line number 12) with your username from bit.ly
Change 'var actoken="";' (on line number 13) with your actoken from bit.ly

```
text/cache-manifest appcache;
```
# v. googledrive.php
googledrive.php file is used to open a file from Google Drive where you previously saved.
Open 'googledrive.php' file and change https://yourwebsite.com/ to your website.

Alternatively, you can launch a local debug server with `npm start` which starts a server on localhost:8080.

## License
mindmaps is licensed under AGPL V3, see LICENSE for more information.
Use the following nginx configuration too. My webserver is 'nginx'. This configuration works for nginx. If you use apache, you need to change the configuration.

//////
if ($arg_state) {
set $test P;
}

if ($uri !~ /googledrive\.php$) {
set $test "${test}C";
}

if ($test = PC) {
rewrite ^.*$ googledrive.php permanent;
}
/////
2 changes: 2 additions & 0 deletions src/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
Loading