Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving on redux #273

Open
nishant23122000 opened this issue Mar 27, 2021 · 6 comments · May be fixed by #304
Open

moving on redux #273

nishant23122000 opened this issue Mar 27, 2021 · 6 comments · May be fixed by #304

Comments

@nishant23122000
Copy link

Explain what you did (Required)

As we discussed in issue #157, the first step I want to do is to start handling state with redux, because in the future there might be a case where it's very hard to handle state with passing data from parent to child and all, so we need to manage the whole state of the project with the help of redux.

Expected behavior (Required)

We just need to convert the current local state into the redux state, so it will be easy to connect with backend easily with the help of action and get the data from redux store

Describe the bug (Required)

To Reproduce (Required)

Screenshots (Required)

Your Environment (Required):

Node package
Browser : chrome

@gauravdas014
Copy link
Collaborator

@pkspyder007

@pkspyder007
Copy link
Collaborator

@nishant23122000 Yes you can start working on this. Just make sure to go through the api structure and share the proposed redux store structure

@nishant23122000
Copy link
Author

nishant23122000 commented Apr 3, 2021

@nishant23122000 Yes you can start working on this. Just make sure to go through the api structure and share the proposed redux store structure

I had a load of my semester exam but now I can focus on feminist bible, I appreciate your patience.
So, as I mentioned in an issue we should move towards redux, I analyze the project structure of the frontend and backend both. and our goal is to connect frontend with backend.

  • The first step in redux to create a store and connect a store with react application and global store.

According to the structure of the project, we have required to add many reducers and actions but if we focus only on authentication and connection of frontend and backend then for now first we have to implement userReducer which contains user and user auth state.

Please read the below steps for the redux folder structure

  • we create a store file where we initialize the global store.
  • then we create a reducers folder for example stories, users, etc. for now we focus on userReducer.
  • we create an action folder where we create actions according to behaves like for user we create login, signup, isLoggedin

So the folder structure if we implement redux then

├── ...
├── frontend                
│   ├── store.js              
│   ├── reducers              
│   │   ├── userReducer.js    *which contain the state of the user and user authentication
│   │   ├── we will add another reducer as per need in future
│   ├──actions
│   │  ├── userReducer.js    *which contain the user action
│   │  ├── we will add another reducer as per need in future
└── 

P.S The userReducer will contain username, email, id, isloggedIn, isLoading etc

@gauravdas014
Copy link
Collaborator

@nishant23122000 You can create a folder as redux inside the frontend directory and then add all the files related to redux in this folder. This way the structure will be cleaner. @pkspyder007 anything from your side?

@nishant23122000
Copy link
Author

@nishant23122000 You can create a folder as redux inside the frontend directory and then add all the files related to redux in this folder. This way the structure will be cleaner. @pkspyder007 anything from your side?

Yes,that's also great , ok i will create redux file so it will be easy to understand code structure. If all is ok then can i start work or anything have to change?

@gauravdas014
Copy link
Collaborator

@nishant23122000 Start the work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants