tinderjs / tinder-desktop

Use Tinder from your desktop, for Mac OS X, Microsoft Windows and Linux
https://tinderjsblog.herokuapp.com/
97 stars 25 forks source link

[How-To] Compile #5

Closed SaturnusDJ closed 8 years ago

SaturnusDJ commented 8 years ago

For this to work the npm install command must have been invoked already on root and 'desktop-app' directory.

In 'build.js' and 'newbuild.js' are some config options. For example the version of nwjs can be changed there. It will be downloaded and compiled along with the other stuff.

Open cmd. Enter the root directory. (One above desktop-app). npm install nw-builder node build.js

There it goes.

A 'cache' directory will contain nwjs downloads. A 'build' directory contains the output of this compiling process. On Windows the module appdmg is missing, it's for OS X only. So the .dmg will not be created. On Windows after this, the 'installer-script.iss' in the 'build' directory might need some modification. When done, the install can be build using the program 'Inno Setup Compiler.'

SaturnusDJ commented 8 years ago

One little problem: After running npm install as said above. There are many 'node_modules' installed in the 'desktop-app' directory. Those modules have package.json files. Inside it, there's data about my system. Especially the "_where" metadata. It's getting compiled too... Not so cool. Maybe some modules aren't even necessary in the compiled version?

amo13 commented 8 years ago

Hey guys, thanks a lot for making this desktop application! But since I am also experiencing the getting no matches issue and compiling stuff myself is asking to much of me =( could you please upload a compiled exe into the release channel here? I am still using 1.2.1 from the @mfkp repo, and I guess it shouldn't be too much an effort for you since you have to compile anyway ;)

SaturnusDJ commented 8 years ago

@amo13 Do you need win or osx?

amo13 commented 8 years ago

I use ArchLinux, but the 1.2.1 version runs fine on wine, so win version would be perfect for me. But I imagine that mac users could be thankful too if you upload the dmg ;) Thanks dude!

SaturnusDJ commented 8 years ago

http://members.home.nl/saturnusdj/Tinder/

There is a compiled version of my unstable branch (https://github.com/SaturnusDJ/tinder-desktop/tree/unstable). However 'unstable' I didn't find any problems the last week. Let me know if it works please and what you think of it.

mayeaux commented 8 years ago

Hey guys.

I am in the process of creating a new build script that is less buggy: newbuild.js, and I've tested it on Mac successfully but haven't finished it (with things like icons etc) nor gotten it up for Windows. I'll try and do that sometime today or tomorrow then get the executables up here for download. 👍 Feel free to ping me here for a reminder :)

SaturnusDJ commented 8 years ago

Does it solve https://github.com/tinderjs/tinder-desktop/issues/5#issuecomment-197582870?

mayeaux commented 8 years ago

node_modules is ignored by Git, the compiled apps don't contain a node_modules either

SaturnusDJ commented 8 years ago

On OSX I have.

Tinder++.app\Contents\Resources\app.nw\node_modules

45 dirs.

mayeaux commented 8 years ago

Wow good point. What happens when you build it into a .dmg file and then install it to another directory?

SaturnusDJ commented 8 years ago

On OS X it's dropping this error. :confused:

node build.js Before running, make sure versions are updated in both package.json and desktop-app/package.json /Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/graceful-ncp/node_modules/proxyquire/lib/proxyquire.js:13 if (!mdl[key]) mdl[key] = original[key]; ^

TypeError: Cannot assign to read only property 'F_OK' of # at /Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/graceful-ncp/node_modules/proxyquire/lib/proxyquire.js:13:30 at Array.forEach (native) at fillMissingKeys (/Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/graceful-ncp/node_modules/proxyquire/lib/proxyquire.js:12:25) at Proxyquire._require (/Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/graceful-ncp/node_modules/proxyquire/lib/proxyquire.js:143:7) at require (internal/module.js:16:19) at Object. (/Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/ncp/lib/ncp.js:1:72) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Object.require.extensions.(anonymous function) (/Users/SaturnusDJ/Documents/GitHub/SaturnusDJ/tinderplusplus/node_modules/graceful-ncp/node_modules/proxyquire/lib/proxyquire.js:235:43) at Module.load (module.js:357:32)

SaturnusDJ commented 8 years ago

And here the outcome: 45 dirs still inside. Most likely the same for Windows, except for Windows they really get compiled and thereby not browseable/findable anymore after compile.

SaturnusDJ commented 8 years ago

It is as if @mfkp did some kind of reverse npm install before compiling. Package.json in modules moment/nw-updater/tinderjs in .dmg from tinderplusplus.com is very different than the ones that come from the npm install command.

mayeaux commented 8 years ago

Yeah I found there were a lot of issues with the build script so I just started to make my own. The reason this _where thing is being added is because of the new version of Node/NPM (5+ and 3+). I'm asking the guys @ NPM about it and how to fix it, maybe you want to open a question on SO as well

SaturnusDJ commented 8 years ago

Nice! That will fix it.

The other thing we might need to look at are all the versions and paths. For example desktop-app/package.json has appdmg 0.3.1 mentioned. At this moment a newer is available. Not really a problem, but some modules/packages generate errors saying support is ending. Or something else: The two main package.json files need to have the version updated when doing a new compile. But when cloning the repo from Github to computer version 1.2.1 in the package.json files is needed for npm install to succeed. Etc.

amo13 commented 8 years ago

@SaturnusDJ thanks for your compiled exe! It does work, but I have 2 bugs: not getting matches is not solved for me; and I regurlarly (sometimes even after 5 swipes) I get the message "out of people", even though I didn't change my location at all. Is this also fixed with the latest commits?

SaturnusDJ commented 8 years ago

You mean your matches don't get loaded? Suggestion: Clear all cache. Then start app, login and wait for 10 minutes.

I don't know if 'out of people' really is a bug. Try extending the discovery range on phone, or sometimes even starting the app on phone will bring more swipes.

amo13 commented 8 years ago

I guess you mean the cache of the phone? Unfortunately, I don't have tinder on my phone, since I don't have any gapps on it and tinder won't work without it. Or is there something cache-wise I can do on the computer?

SaturnusDJ commented 8 years ago

7: C:\Users\USERNAME\AppData\Local\TinderPlusPlus XP: C:\Documents and Settings\USERNAME\Local Settings\TinderPlusPlus

ghost commented 8 years ago

upon compilation, platform set to win32, i've had this issue with the previous iteration of this app:

Uncaught node.js Error

Error: Cannot find module 'moment' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:273:25) at Module.require (module.js:362:17) at require (module.js:378:17) at window.require (:4:17) at file:///C:/Users/user~1/AppData/Local/Temp/nw13416_16909/index.html:18:18 `

SaturnusDJ commented 8 years ago

In the directory where the files are, does "desktop-app\node_modules\moment\" exists?

ghost commented 8 years ago

No, would this be a result of compiling it without running npm install in both the root and the desktop-app folders? If so, I keep trying to run the command, but it always returns with:

npm ERR! notsup Not compatible with your operating system or architecture: appdmg@0.3.6

I'm trying this on Windows 7 x64, I tried earlier on Ubuntu 15.10 x86.

SaturnusDJ commented 8 years ago

Yes, you need to run npm install in both directories. For the root dir, you can edit the package.json file and temporary take out the line containing appdmg.

mayeaux commented 8 years ago

No, would this be a result of compiling it without running npm install in both the root and the desktop-app folders? If so, I keep trying to run the command, but it always returns with:

Yes.

npm ERR! notsup Not compatible with your operating system or architecture: appdmg@0.3.6 I'm trying this on Windows 7 x64, I tried earlier on Ubuntu 15.10 x86.

Appdmg is regarding building out icons for Mac applications. See if you can remove the dependency and the relevant lines of code, it could be possible to change the build script to not include anything to do with Mac compilation, perhaps that will work.

amo13 commented 8 years ago

sorry I'm kinda late with replying... Clearing the cache seemed to help, thanks a lot! Unfortunately the out of people thing keep reappearing after only 10 swipes, but I guess without the app on the phone there's no workaround for now...

mayeaux commented 8 years ago

Hey @amo13 , that error is coming from the Tinder API returning 'recs exhausted' when it searches for new people. Can you test with the Tinder mobile client that there are actually more people in your area? It could very well be that you've swiped for all the people in your area.

mayeaux commented 8 years ago

Or change the matching area via the Tinder mobile client to a larger area and see if that helps. I don't think it's actually a problem with tinder-desktop, although it could be

amo13 commented 8 years ago

Well, I don't have the mobile app on my phone because it won't work without google apps (especially GCM I guess) and I use an AOSP rom without any google apps. Therefore I also can't set the search distance, but the last time I used it on a phone, I set it to quite a long distance, and I am still getting matches that are 20 miles away :/ But honestly, I can't imagine that there are no more people in my area since I live in the center of a big German city! And I know a lot of people use tinder here...

ghost commented 8 years ago

I don't have the mobile app on my phone because it won't work without google apps

Download an Android emulator with Google Play services enabled, such as BlueStacks.

Appdmg is regarding building out icons for Mac applications. See if you can remove the dependency and the relevant lines of code, it could be possible to change the build script to not include anything to do with Mac compilation, perhaps that will work.

Ah yes, I removed those OS X specific parameters and the compilation went fine afterwards. I can't believe I didn't realise that sooner >.<

Thanks for the help.

mayeaux commented 8 years ago

Hey @amo13 , yes I would download Bluestacks emulator and then install the Tinder app. It works pretty well actually, that should get you around not having a mobile device. Amo13, are you building the app using nodewebkit or are you using a compiled version?

Nice @wake-n-bake , glad to hear it. Truthfully I am purposefully neglecting a lot of frontend/compliation stuff in the meantime as I continue to build out features. Once the features I want are ready I'll turn my attention to touching up the frontend and fixing compilation :)

ghost commented 8 years ago

I'm thinking I want to be able to contribute to the project, is there any up-to-date documentation on the Tinder API available? Perhaps I'll do some tinkering and get some excluded features up and running.

amo13 commented 8 years ago

I'm using a compiled version that @SaturnusDJ provided me. I don't know how to compile stuff myself and to be honest, I don't really want to mess around with that ;) @wake-n-bake there's no bluestacks for linux but I might try genymotion... thanks for the hint!

mayeaux commented 8 years ago

@wake-n-bake , this is the unofficial watering hole from documenting the Tinder API:

https://gist.github.com/rtt/10403467

The client that we're using is at http://www.github.com/tinderjs/tinderjs . That module (tinderjs) could use support for unmatch, and updating all sorts of user info (match distance, bio, blah blah blah, anything that's not picture uploads which are a bit more complex).

mayeaux commented 8 years ago

And @amo13 , I just ran into the same issue while doing some dev. I can verify that it's because attempting to get new users is running into the recs-timeout error, which means you are querying their API for an update too much and they don't let you get new 'recommendations' as they're called for 30 minutes. I'm uncovering a lot of stuff in this app that isn't really structured optimally, I think that issue could be prevented with a refactor of some of the code frankly.

amo13 commented 8 years ago

Oh I see, well if it gets fixed, I would be very thankful to get a compiled exe =)

Anthony Mayfield notifications@github.com hat am 3. April 2016 um 20:28 geschrieben:

And @amo13 https://github.com/amo13 , I just ran into the same issue while

doing some dev. I can verify that it's because attempting to get new users is running into the recs-timeout error, which means you are querying their API for an update too much and they don't let you get new 'recommendations' as they're called for 30 minutes. I'm uncovering a lot of stuff in this app that isn't really structured optimally, I think that issue could be prevented with a refactor of some of the code frankly.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

https://github.com/tinderjs/tinder-desktop/issues/5#issuecomment-205025966

mayeaux commented 8 years ago

Were you logging in / out a lot, or were you just swiping like normal and then it timed out? Were you swiping quite a lot?

mayeaux commented 8 years ago

@wake-n-bake , and anybody else who is interested, I got us a Slack channel up! :) https://slack.tinderjs.com

amo13 commented 8 years ago

I was not logging in/out a lot, not swiping a lot, I don't know. The last scenario was like: Didn't connect for 3 days, start this application, swipe normally, and before the 10th swipe, I run out of people. I didn't change location or preferences. And with this happening, you can imagine that I didn't swipe away all the tindering city in the last two weeks ;) Thanks for troubleshooting and for looking into this, appreciated.

SaturnusDJ commented 8 years ago

What you are saying makes sense to me. I have a similar experience, where swiping stack turns empty surprisingly fast.

SaturnusDJ commented 8 years ago

Compiling doesn't work anymore. Not really clear why. The process of downloading nwjs hangs often, or status isn't updated in terminal (probably latter).

I reinstalled git and nwjs and redownloaded my repo as clean.

I'm pretty sure something external changed. But what. This sucks...

SaturnusDJ commented 8 years ago

Ok ofcourse, as always, minutes after posting getting it working again.

Manually downloaded nw.js and extracted it to the cache folder.