mubaris / curiosity

Find Amazing Github :octocat: Projects :zap:
https://mubaris.github.io/curiosity/
244 stars 65 forks source link

Added git services, db caching and front end API changes #57

Open asiyani opened 7 years ago

asiyani commented 7 years ago

After merging this pull request Frontend will get data from backend DB. Created Search API for front-end - (This one is not GraphQL) but some this for now just to use same front end without much modification.

Folders added.

created static method updateRepoWithStargazer in repositorySchema which we can use to update records in DB. this method will link Stargazer to Repos being updated.

Note:

We need to seed our DB for /api/repos/v1/search to work. To do that i have created simple call we can make from the browser (after login in). Just go to http://localhost:3000/api/repos/v1/updateRecord. this will start seeding process and you will get logs on the terminal. I am doing seeding for ALL starred records. some username got about 1K+ starred repos.I got about 11K repos documents in Repository collections. This process might take some time.

After seeding data front end will work as it is working now- just data will come from our db. Since we are getting data from our server we can do following. image

In the front-end, we need to change they way we do API calls when language is selected. Since now we can pass language as search parameter No need to filter that on the front-end.

Please let me know if any issue or what you guys think about this process of getting data.

mubaris commented 7 years ago

It didn't work until I called, /api/repos/v1/updateRecord manually. We need to find a method to overcome this.

Language selection is not working.

After a point application exits due to undefined response body

asiyani commented 7 years ago

Ya some of the language doesn't work becz dB doesn't have any repo for that language. Which one you tried?does it work on previous front end?

mubaris commented 7 years ago

It's not working for Javascript. It was working previously.

asiyani commented 7 years ago

I think its something to do with scroll, if you scroll down it starts doing API calls. Not sure why this is happening....

mubaris commented 7 years ago

It's working now. I don't know why it was happening.

mubaris commented 7 years ago

Username array isn't stored in DB. Is it?

asiyani commented 7 years ago

No its just a file for now, but DB got all github info regarding those usernames.....

mubaris commented 7 years ago

If the user wants to add new username, it's not possible now.

asiyani commented 7 years ago

Regarding adding username on end user request is not yet possible but I was Thinking if user wants to add username we will let him add that but only for him like temp data. we will add it to our DB only if they it meet certain criteria. something like how many follower he got or count of repo. Otherwise our starzagers list will grow and we will loose quality.

mubaris commented 7 years ago

@alejandronanez @asiyani Status?

asiyani commented 7 years ago

Sorry guys have been busy for last few days. I have made all changes now. Let me know if anything else needs changing.

asiyani commented 7 years ago

Hi guys did you had time to review this? Let me know if any issue