Closed klequis closed 3 years ago
@dhaef
I created data for you to use and have documented setting-up the database and server. You can find the instructions in the project wiki
The pages for server setup are numbered 1 - 5.
I'll try to do client setup later or tomorrow.
Let me know how it goes.
@klequis The setup is going smoothly but I'm not seeing "mm.aabank.checking.2222.csv" in /setup-resources
@dheaf It is there now.
I had .csv in .gitignore to avoid uploading actual data.
I'll have to do client setup tomorrow. Don't really remember what is needed. Could be nothing.
@dheaf Nothing needs to be done on the client to get it to run. I added a setup step for it anyway just to get you started. There is no user guide. Feel free to ask as many questions as you need.
@klequis Thank you!
Now when I start the server I get the error below. I created config.settings.js in /server/config. Any ideas?
Error: Cannot find module './config.settings' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/Users/derekheafner/Documents/openSourceContributions/private-money-server/config/index.js:3:1) at Module._compile (internal/modules/cjs/loader.js:778:30) at Module._compile (/Users/derekheafner/Documents/openSourceContributions/private-money-server/node_modules/pirates/lib/index.js:99:24) at Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Object.newLoader [as .js] (/Users/derekheafner/Documents/openSourceContributions/private-money-server/node_modules/pirates/lib/index.js:104:7) at Module.load (internal/modules/cjs/loader.js:653:32)
Looks like you are using Windows and that is likely the problem. There is an easy fix for it I used a few years ago but have forgotten. I'll look for it.
You can also look into it. The problem is in the 'scripts' section of package.json
"start-dev": "DEBUG=server* NODE_ENV=development NODE_PATH=./ nodemon --exec babel-node server/index.js"
If I remember correctly, it is the NODE_PATH=./
that Windows doesn't understand and NODE_ENV=development
might be a problem as well.
In the mean time, we should also consider if it is a machine configuration problem. Here is how I setup my machine. Please take a look to see if something seems significant, different or missing.
I'm actually running on a mac
Oh, I though mac had /home not /Users, but good. Should be easier to figure out.
I did a setup on a Mac and had no problem. The issue I was thinking of was with Windows.
Can you show me a screen shot of you editor similar to this one?
I figured it out. I had mistaken "/server/config/config.settings.js" as "/server/server/config/config.settings.js"
I now got a 0 at the end of my import request "{"dataLoaded":"[{\"operation\":\"load data\",\"status\":\"success\",\"numDocsLoaded\":0}]"}" and my password in config.settings.js is correct as I forgot to change it when creating
It isn't likely a password issue bec that would cause the server to throw an error. But just to double-check, according to your picture above your password is literately 'yourPWD' which is OK as long as that is what you used for you mongodb users.
Did you look at the terminal for server to see if there are any errors?
You should see something like (your numbers will be different)
Looking at the accounts collection in MongoDB Compass it should look like this: (ignore that my db name is pm-setup, that's a tmp thing I did)
Yeah that is what I used for the mongodb password.
I don't have any errors in the server terminal I just get this.
My accounts collections looks correct as well
I created a new branch named 'debug-import'. Please check it out and then re-execute the import from the browser. Post a picture of all the output in the terminal.
So '01: accounts' is the result of a db call. It should be an array but looks undefined from the output. I put some more debug (console.log) code in around the db call to see what is happening. Please pull the new code, give it a try and post a screen shot.
Looks like my testUser is undefined
testUser is undefined for me as well. Currently you are using devUser.
The first 'find' is the query to get the accounts. 'ret' is the return value of the query and it is an empty array. That is a key clue that points to something being off in the db.
remember wherever you see 'pm-setup' it must be 'private-money' on yours.
// log into mongo as devUser
mongo -u devUser -p --authenticationDatabase private-money
// enter password at prompt
// switch to the private-money db use private-money
db.accounts.find({}) // should print out contents 'accounts'
db.accounts.find({ active: { '$ne': false } }) // result should be same result as previous command
When I follow the steps for step 2 I get no output
I think, guessing from your screenshot, the problem is you are connected to mongodb atlas in the cloud. The app and the queries in the console are looking at mongodb running on your local machine.
I created some instructions for using localhost. Sorry, I don't know your experience level so apologies if you don't need the instructions:
https://github.com/klequis/private-money-client/wiki/3.-Setup:-Setup-the-private-money-Database
That did it! I had always used atlas prior when using mongodb so that was my confusion.
Really appreciate all the help
Great. Were you able to get the client running? I don't remember writing instructions but just clone it, npm install, npm start and it should work
Yeah the client is up and running
Use this post to establish local dev setup for app.