Git Product home page Git Product logo

tottem's Issues

How to separate logic when updating Apollo cache that used as global store?

Using Apollo cache as global store - for remote and local data, is very convenient.

However, while I've never used redux, I think that the most important thing about it is implementing flux: an event driven architecture in the front-end that separate logic and ensure separation of concerns.

I don't know how to implement that with Apollo. The doc says

When mutation modifies multiple entities, or if it creates or deletes entities, the Apollo Client cache is not automatically updated to reflect the result of the mutation. To resolve this, your call to useMutation can include an update function.

Adding an update function in one part of the application that handle all cache updates; by updating queries and/or fragments for the all application, is exactly what we want to avoid in Flux / Event driven architecture.

To illustrate this, let me give a single simple example. Here, we have (at least 3 linked components)

1. InboxCount
Component that show the number of Inbox items in SideNav

query getInboxCount {
    inbox {
        id
        count
    }
}

2. Inbox list items
Component that displays items in Inbox page

query getInbox {
    inbox {
        id
        items {
            ...ItemPreview
            ...ItemDetail
        }
    }
}

Both of those components read data from those GQL queries from auto generated hooks ie. const { data, loading } = useGetInboxItemsQuery()

3. AddItem
Component that creates a new item. Because it creates a new entity I need to manually update cache. So I am forced to write

(pseudo-code)

    const [addItem, { loading }] = useCreateItemMutation({
        update(cache, { data }) {
            const cachedData = cache.readQuery<GetInboxItemsQuery>({
                query: GetInboxItemsDocument,
            })

            if (cachedData?.inbox) {

                // 1. Update items list GetInboxItemsQuery
                const newItems = cachedData.inbox.items.concat(data.items)
                cache.writeQuery({
                    query: GetInboxItemsDocument,
                    data: {
                        inbox: {
                            id: 'me',
                            __typename: 'Inbox',
                            items: newItems,
                        },
                    },
                })

               // 2. Update another query wrapped into another reusable method, here
                setInboxCount(cache, newItems.length)
            }
        },
    })

Here, my AddItem component must be aware of my different other queries / fragments declared in my application 😭Moreover, as it's quite verbose, complexity is increasing very fast in update method. Especially when multiple list / queries should be updated like here

Does anyone have recommendations about implementing a more independent components? Am I wrong with how I created my queries?

Signing in to the platform should create a new user with empty collections

  • Signing in to the platform should prompt the user to pick a username.
  • A username should be unique
    The user will be pushed to the db, with empty collections for now.
    Bonus: replace the "sign in to auth0.com" inside the google login dialog
  • Ask for OAuth credentials on google account
  • Create the /username page on account creation

The username should be unique, the user will access its profile through tottem.app/username

It should probably be done outside of the Auth0 workflow - so we can check for username uniqueness.

database

What database does this project use?
Postgresql on your server?

Having to click "more" on mobile to see the rest of the collection is not intuitive enough

[From an extenal user test]

When scrolling horizontally on a collection on mobile, it doesn't feel intuitive that some items are hidden (with only the first 4 displayed) and that you have to click "More" to see the rest of the items.

My proposition:

  • Either, on mobile, display a "+ X more" item at the end of the scrollable div, kind of like:

image
(mockup done in 30s don't be harsh😛)

  • Or simply let's not limit to the first 4 on mobile and allow the user to directly see the whole collection without having to click?

Fix layout issues on Firefox

On Firefox 68.0.2, the cards aren't properly displayed when clicking "See More":

image

Also, clicking "See More" on the top section also expands the bottom section, adding a blank space:

image

image

Tabs name should be horizontally scrollable on small screen

We should define behaviour on large and small screen when too many sections are set to fill only one line. I don't expect this on large screen soon, but on small screen is almost already an issue. I suggest that the tab names should be horizontally scrollable

Screenshot 2019-09-20 at 17 59 14

Replacing auth0 with next-auth

Could anyone guide me how to use the next-auth package (in this source code) for Authentication instead of using the third-party authentication which is super expensive.

View more items button

Only 4 items are displayed by default

Screenshot 2019-09-17 at 18 11 28

A button View more should be displayed when more than 4 items are specified. Additional items are loaded on the same page after current elements and button Show less allow to hide them.

Screenshot 2019-09-17 at 18 13 13

Design still to be improved

Tabs system

For some major profiles user can have a lot of data. Tabs allow items to be categorised into different section. I suggest to create new field section in items data in order to specify Tab names. Corner cases should be discussed. Tab system should be optional.

Implement multi-profiles feature

For now only one profile is available from static data stored in /data folder. Data structure should be defined in order to access specific profile depending on url

Tabs component

We should have tabs component styled as specified in figma files

image

Auth0 help?

Awesome project! Thanks for sharing 🙏 .

I'm attempting to configure a local setup with my own Auth0 account, but have run into a few head scratchers.

Would you please describe how you configured your app and API in Auth0, including any special roles, permissions, etc? This might be something to add to the readme documentation, as well 🤷 ?

Also, I noticed a few places where 'tottem.app' URLs are hard coded.. Any reasons these don't reference env variables?

Thanks!
Ethan

Cards are not well aligned on mobile

When I resized the screen flexbox cards are wrapped but on my screen the second lines is not aligned. It's due to inserted box (because of gap parameters). I wonder if we should use Grid instead of flexbox to handle this behaviour. Wdyt?

Screenshot 2019-09-17 at 18 13 13

The card hover is buggy and inefficient

I won't make a video but, especially on mobile the experience is not cool enough. I feel the card hover display is a bit delayed.
Moreover, there is a bug on mobile. To reproduce :

  • Go home page with mobile phone
  • Click on a card, see the hover card
  • Change tab
  • Click on a card from this new tab section, nothing happen
  • Click on another card, the hover card is displayed

Expected behaviour
Once section changed the hover card should be displayed when it's clicked on mobile!

I tried an implemention with CSS & JS but I am not sure about elegance & performance. Can you take a look @deonclem ?

Migrate to Ant design

Main interested feature of Grommet are not used anymore (ResponsiveContext, Typography Theming), since usage of SSR with NextJs
As we will soon build more complex composant (Affix, Input, ...). We should use a more robust framework

Auth0 config help?

Awesome project! Thanks for sharing 🙏 .

I'm attempting to configure a local setup with my own Auth0 account, but have run into a few head scratchers.

Would you please describe how you configured your app and API in Auth0, including any special roles, permissions, etc? This might be something to add to the readme documentation, as well 🤷 ?

Also, I noticed a few places where 'tottem.app' URLs are hard coded.. Any reasons these don't reference env variables?

Thanks!
Ethan

Implement all cards component

Implement cards component of those components

  • Movies
  • Article
  • Influencers
  • Podcast

Then add sample data to display those fixtures in profile!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.