ChickenKyiv / loopback-tutor-intern-9

i think it's on pause, not a lot of progress
GNU General Public License v3.0
0 stars 0 forks source link

First step. Loopback intro #1

Open atherdon opened 6 years ago

atherdon commented 6 years ago

intro

https://github.com/optis/loopback-rest-api - this is the best tutorial that helps me 1 year ago.

Please buzz me before including MongoDB database - so I'll generate a new instance for you.

As I want to see your progress - please use this repo and push your progress here. Share with me progress and questions that I can help you with. Don't hesitate to use my help. i willing to start fast and with less stress for you at the beginning. Also will check your git skills.

Is there any timeline to finish?

nope, because you only starting this. and I know how hard it can be from the beginning. But this is the best tutorial that I find about loopback. I use it too a year ago. btw, as usually - feel free and ask any questions or seek my help here.

invite link

Please use this link in order to be added as contributor : https://github.com/ChickenKyiv/loopback-tutor-intern-9/invitations

ViktorM888 commented 6 years ago

Hi Arthur,

So I have been trying to make the loopback work, however a different error appears now and I am not sure how to solve it. untitled1

I am able to make models and datasource...I will continue until something breaks :D

atherdon commented 6 years ago

as i still hiding - don't want to waste your time waiting. if you have spare time, please check this article. Put all things in one place. it was created for you https://medium.com/p/things-that-should-read-and-use-javascript-intern-at-groceristar-april-18-collection-bd6541e9ae28

atherdon commented 6 years ago

@ViktorM888 do you need my help? can you push your current progress on this repo?

ViktorM888 commented 6 years ago

I'm in the middle of making a REST API with express. I have been watching this video in order to get a clearer picture and better understanding of what are REST API. https://youtu.be/pKd0Rpw7O48. I will try to finish it up during the week so I can move on to mongodb, after I iron out some issues I am having.

atherdon commented 6 years ago

got it. ok, i assume it's restify plugin. but later you'll need to come back to loopback tutorial. i think it'll be more clear for you, when you'll complete that course. thank you for your reply - keep me in touch! and dont' hesitate to buzz me here - i'm ready to help you

ViktorM888 commented 6 years ago

I have been watching some tutorials, and I am getting into it. I have tried again to do the loopback, however my npm start keeps aborting (missing script start), I am not sure what to put in package.json

atherdon commented 6 years ago

can you re-install your node + npm envoronment? by re-install i mean delete and erase all config files and then install a latest version. btw, tell me about what OS do you have? because usually i'm reinstalling node and everything start to work good

ViktorM888 commented 6 years ago

I am using Windows 7...ok Ill try that

atherdon commented 6 years ago

please note that you shouldn't install mongodb. because it's a bit painful at windows

ViktorM888 commented 6 years ago

Im thinking if I dont resolve these issues soon.. I will download Linux and put it on virtual machine, i believe its less painful

ViktorM888 commented 6 years ago

I installed Ubuntu on virtual box...and I am still struggling with the same errors errorlog.txt

I cannot do npm start, because it is missing in the package.json script. In npm init, there is no option to add anything in start script. So I am kind of stuck now. I have attached the error log above.

atherdon commented 6 years ago

first thing that i can see:

2 info using npm@3.5.2
3 info using node@v4.2.6

and it's a really old packages.

don't worry about being stuck. when i was trying to apply at my first development job i break ubunty 4 times, while trying to setup a LAMP server.

please run this in your ubuntu terminal: https://stackoverflow.com/questions/41195952/updating-nodejs-on-ubuntu-16-04

atherdon commented 6 years ago

btw, keep going. i think you'll crack it soon. and don't worry - local setup is usually the complex things. later it'll goes more smoothly

ViktorM888 commented 6 years ago

Yes I cracked it finally, I am working on some new issues, (curl (7) couldnt connect to localhost) but I am optimistic that I will solve this soon :)

ViktorM888 commented 6 years ago

I am currently on the storage part of the tutorial, trying to solve some issues there

ViktorM888 commented 6 years ago

Can you give me some pointers, what to look for when I get error ELIFECYCLE. I don't understand it at all, and don't know where to look for error. untitled It says npm is fine, but my guess is the .js files are not correctly done, but that's my guess.

atherdon commented 6 years ago

usually this error shows to me when i have an old node. lets start from scratch. step by step. without any complex things. 1) delete node/npm from your windows setup. fully erase it. and show me that - open cli on windows, type node and it'll tell you that you don't have that command. then back to me and i'll create a next step for you. because it looks like you need my help :)

On 26-Apr-2018 at 09:51 AM, ViktorM888 wrote:

Can you give me some pointers, what to look for when I get error ELIFECYCLE. I don't understand it at all, and don't know where to look for error. [image: untitled] https://user-images.githubusercontent.com/30383247/39298970-ec8309c0-4947-11e8-965f-39a127aafb0f.png It says npm is fine, but my guess is the .js files are not correctly done, but that's my guess.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/loopback-tutor-intern-9/issues/1#issuecomment-384581880, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDjps1A6ogZnHcTCSzjBnIMPEOWL3ks5tsZi3gaJpZM4TDQ-P .

ViktorM888 commented 6 years ago

untitled

atherdon commented 6 years ago

https://nodejs.org/ Download node v 10

ViktorM888 commented 6 years ago

untitled untitled1

I have tried node v10, but it showed the same error...I will try to find a solution from the error I am getting

atherdon commented 6 years ago

do you have installed visual studio or some .net libraries? i think this is something related to VS. But i think at least we start to figure out that this is not a node server issue - this is good

ViktorM888 commented 6 years ago

I have uninstalled VS and reinstalled 2017 enterprise edition. Still doesn't work. However, I think I have narrowed it down to this VsDevCmd.bat. I think it's an important file but I don't have it on my system. So I will try to solve it somehow

atherdon commented 6 years ago

can you try to run node instance inside the VS? maybe this will help us? https://www.visualstudio.com/vs/features/node-js/

atherdon commented 6 years ago

I think i got it. when node trying to install on windows - it's create a separated CLI(console) instance, but maybe VS is overriding it. so i assume - if you have VS installed - maybe it have inside nodejs server instance - so you can code this project inside IDE that you know :)

ViktorM888 commented 6 years ago

I finally solved it, no errors. However I have done it in Linux. I updated npm and node to latest. Windows was pissing me off too much. I will try to finish the tutorial today if no unexpected errors appear.

ViktorM888 commented 6 years ago

untitled I cannot seem to login as Kenneth. I will try to find the mistake, but I am glad I finally managed to create something :D

atherdon commented 6 years ago

hope you'll not try to finish it today... Because it's not an easy thing. ok, push some code and i'll see what is happeninh.

Btw, i assume you happy - you cracked it by yourself! and it's important

And maybe you understand why i'm using Linux and my codeeditor is Atom - not any complex IDE like VS or NetBeans

ViktorM888 commented 6 years ago

I have made a new repository where I pushed all my code https://github.com/ViktorM888/Tutorial-app

atherdon commented 6 years ago

@ViktorM888 ok, but please store code in this repo. because it'll be easy for me to track your progress

ViktorM888 commented 6 years ago

Ok no problem I will push here

ViktorM888 commented 6 years ago

I am still trying to log in with Kenneth (I have tried with the other two also), I am not sure why it doesn't let me through. Only a 400 error shows, should I be looking in the db.json file or the access control lists? Also maybe you could explain in the db.json file after every name i.e. Kenneth in the password field it is encoded, and in the tutorial it is just kenneth in that area.

atherdon commented 6 years ago

We will now add 3 users to application: Andy, our administrator : (username: andy, password: andy) Kenneth, a customer : (username: kenneth, password: kenneth) Claudiu, another customer: (username: claudiu, password: claudiu)

ViktorM888 commented 6 years ago

Yes I understood that, the passwords were confusing me because they needed to be hashed...I will keep trying to solve the problem

atherdon commented 6 years ago

ok, not a problem - keep going!

ViktorM888 commented 6 years ago

untitled

Ok so I am stuck with the login page...I have tried logging in with all three users, but none work. I have also given access control list full access and still I get 401 error. This picture is when I tried to see if Kenneth exists in the customers. How do I enter as admin?

atherdon commented 6 years ago

did you post your latest code updates to this repo?

ViktorM888 commented 6 years ago

Yes I pushed the latest code, haven't changed it after I pushed it

atherdon commented 6 years ago

can you point me to the place, where you stuck in?

On 09-May-2018 at 03:04 PM, ViktorM888 wrote:

Yes I pushed the latest code, haven't changed it after I pushed it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/loopback-tutor-intern-9/issues/1#issuecomment-387770126, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDhZOCr9vrZedOKgheoqHyrILwLblks5twwVggaJpZM4TDQ-P .

ViktorM888 commented 6 years ago

untitled

I cannot receive a 200 code i.e. it doesn't go through

atherdon commented 6 years ago

1 item: i assume you're trying to go fast and not follow up all things inside this tutorial 2 item: i assume there is a problem with table(Model) names.


1 item: before trying to login you should try some of this links /api/campgrounds?filter[where][name][like]=KOA

/api/reservations?filter[where][startDate][gte]=2017-03-22 and as i tried them - i didn't see anyhting

2 item: my assumption based on prev item. so if i open campgrounds and cannot see anything - then this is an error/misunderstanding at model names.


yeah, login is not working now from my side too

atherdon commented 6 years ago

there also can be a problem with ACL thing. Not sure how you configure it, without going through the login step. is this code from your project created from scratch by hands, or this is a copy of tutorial code? i'm a bit confused....

ViktorM888 commented 6 years ago

I have copied the code exactly from the tutorial, i will go through it again to see if i made an error somewhere On Wed, May 9, 2018 at 6:31 PM Arthur Tkachenko notifications@github.com wrote:

there also can be a problem with ACL thing. Not sure how you configure it, without going through the login step. is this code from your project created from scratch by hands, or this is a copy of tutorial code? i'm a bit confused....

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/loopback-tutor-intern-9/issues/1#issuecomment-387798020, or mute the thread https://github.com/notifications/unsubscribe-auth/Ac-cjxPwzyzpHIrKAnrbPHhtPNXo4_bbks5twxnXgaJpZM4TDQ-P .

atherdon commented 6 years ago

let's go another way. you delete all files from this repo, then install clean loopback -> commit -> add models -> commit -> add database(it's better if you'll create it by hands)-> commit, etc... I assume this will be good for knowing loopback

atherdon commented 6 years ago

@ViktorM888 we're moving our servers into a new approach. not sure if you still interested to work together, but buzz me if you want to learn another technology, not a Loopback :)