ChickenKyiv / frontend

GNU General Public License v3.0
0 stars 0 forks source link

[Wangdong] Intro to project #2

Open atherdon opened 6 years ago

atherdon commented 6 years ago

First task you will be to check the code repo, find documents, that I've pushed there and please generate some questions. Take your time, don't rushing you right now, because jumping in a new project can be a bit challenging.

bug-and-debug commented 6 years ago

I am Wangdong. I had understood the project structure. But i don't know anything about React. And i don't understand the database structure a little. I wanna know following things: 1.react 2.API 3.Authentication

atherdon commented 6 years ago

React

Ok, i think i understand that we'll go with you from the very beginning of React. I'll create a separated course for you when you'll be able to master basics. and when you'll complete it - you'll be able to come back into this project and join your team-members.

API

We created basic API a year ago. If your team will make a lot of updates soon - you'll force me to extend it. It's created with Loopback Framework help(IBM company). In short, it's a server with expressJs inside. But as Hans told me that you'll master Frontend only - you'll not be assigned to work on API.

But in order to pull/push data to the server, you'll need to interact with the server via API endpoints. For example, you have a recipe page. You send recipe ID to URL like http://URL/api/recipe/{recipe_id} you'll receive a JSON response with data that you'll be able to display at your page.

Authentification

Main logic is done at server side. But in order to give your users ability to login and save data into their account you'll need to pass their username/password to the server endpoint, related to login process. then you'll receive a token that will be used for this session. and you'll be able to manipulate with data, by using that token.

If something is not clear or you need more details - don't hesitate to ask

bug-and-debug commented 6 years ago

Let me know you Loopback Framework. I don’t know anything about it.

atherdon commented 6 years ago

it's a great framework. it has an ORM system, so when you specified models(database tables) and setup relations between them - you get a lot of CRUD methods generated on fly, so it's a timesaver. for example - when i create RecipeModel & add relations to IngredientsModel i'll get generated on the fly methods for add, delete, edit recipes. i also will be able to attach ingredients to recipe by passing recipe_id. and i'll have a basic method that will return me a complex array, with recipe and igredients list inside it. like this

{
   id: 123,
  recipe_title: `Chicken Salad`,
  ingrredients: [
    {id: 2, name: 'chicken'},
    {id: 3, name: 'tomato'},
    {id: 4, name: 'olive oil'},
  ]
}
atherdon commented 6 years ago

1

atherdon commented 6 years ago

Tell me if you have some other questions to me.