AmanNegi / FreshNest

A platform that connects local producers directly with consumers seeking fresh produce.
https://fresh-nest.netlify.app
GNU Affero General Public License v3.0
23 stars 39 forks source link

[React] Optimize Filtering #77

Closed AmanNegi closed 1 year ago

AmanNegi commented 1 year ago

Issue

Currently, we re-fetch all the items when we change the filter. However, we sort them in the front end itself. Instead, sort the list of items as we already store them to render the items.

Files to be changed

fronted/react/src/pages/shop/presentation/Shop.jsx

This is just provided for simplicity of navigation and reference. If required more files can be affected according to needs.

bymunajat commented 1 year ago

may i try to help you @AmanNegi

AmanNegi commented 1 year ago

Sure, feel free to contribute. ✨🌝 Let me know if you need any help :)

AmanNegi commented 1 year ago

may i try to help you @AmanNegi

You may check the contributing documentation for setting up project in your local environment. 😁

bymunajat commented 1 year ago

login how to be able to login?

bymunajat commented 1 year ago

login how to be able to login?

@AmanNegi

AmanNegi commented 1 year ago

Hey @bymunajat currently there is no signup feature in the interface. You can utilize the API endpoint /signup like this:

(POST) http://localhost:3000/api/auth/signup
{ body: { name, email, password, userType, phone } }

Start the backend and make the following request using any client (POSTMAN, THUNDERCLIENT) and a user will be created with the provided credentials. Let me know if anything is still missing.

bymunajat commented 1 year ago

Hey @bymunajat currently there is no signup feature in the interface. You can utilize the API endpoint /signup like this:

(POST) http://localhost:3000/api/auth/signup
{ body: { name, email, password, userType, phone } }

Start the backend and make the following request using any client (POSTMAN, THUNDERCLIENT) and a user will be created with the provided credentials. Let me know if anything is still missing.

sorry I'm having trouble not being able to log in @AmanNegi

AmanNegi commented 1 year ago

96 Once this is done, you will be able to Sign In via user interface itself.

AmanNegi commented 1 year ago

@bymunajat Follow the steps below and you can test directly on the remote website.

  1. Clone the project and go into frontend/react.
  2. Create an .env file and add the following line

    VITE_API_URL="https://agromillets.adaptable.app/api "

  3. Run the following commands:
    npm install
    npm run dev
  4. Go to localhost:5173 and you will enter the login page.
  5. Go to SignUp Page and register, you will now be able to access the application. OR
  6. Simply Sign Up using Test Mail.
    UserType: Customer
    - Email: customer@gmail.com
    - Password: password
  7. Make changes and test, and create a PR.

NOTE: Google Login/SignUp will not work until you add the VITE_GOOGLE_CLIENT_ID to the .env file.

AmanNegi commented 1 year ago

Fixed via #105