ae-andre / insights-bench

An online community of conversation, built with the MERN stack, that will allow those with personal, financial or career-related problems to talk them through with others, in either a private or a public channel.
MIT License
0 stars 3 forks source link

Home page, encorporating ConversationsList and Conversation components with data and server config updates #40

Closed kwubbenhorst closed 8 months ago

kwubbenhorst commented 8 months ago

Added ConversationsList and Conversation files to components folder, worked on routing in App.js and main.js so they would be included and go to different endpoint for conditional rendering of the conversation view of the homepage. Added stylings to Header and Footer and integrated Navbar in Header so I could see the whole view of the homepage. Added a Home.jsx file to pages folder which takes in the ConversationsList component and the Conversation component. Added the data seeds which were included in my last, still pending, pull request. Started up both servers which required some changes to server.js, vite.config.js and package.jsons. Included queries in my code for ConversationsList, Conversation and Home components and that required some tweaks to existing models, typeDefs and resolvers files at the backend to get out the data that we needed and to make everything consistent. Currently it's a success that a. database is seeding, b. both servers are starting up (I added a script so you just have to enter npm run start-dev now to run the seeds and start both servers), c. data is getting through to ConversationsList, d. data is getting through to Conversation. Currently still trying to debug a few gaps in the data that we're getting (eg. comments for last two conversations in the seeds and conversation titles in the Conversation component). Next step is to work on the styling for the Conversation component, because it doesn't look very well at the moment.

What landing page now looks like in my browser: Screen Shot 2024-03-16 at 12 35 37 PM

What the view looks like on the homepage when I click one of the titles in the ConversationsList Screen Shot 2024-03-16 at 12 37 25 PM

The summary of new files I created and files in which I made changes

Screen Shot 2024-03-16 at 12 50 45 PM

Screen Shot 2024-03-16 at 12 50 55 PM

Note: don't forget to do another npm install before trying to run this code as new packages have been added and I find the new script useful npm run start-dev from the root directory to do everything: seed db, start fe and be server.

kwubbenhorst commented 8 months ago

Fix for first issue (no comments coming through for the conversations Craving more space and Religion and Work) is to change the key in the conversationSeeds.json file to “comments” for those last two (I had it as “responses”). With that change reseed data base and comments are coming through to the ConversationsList for all conversations.

kwubbenhorst commented 8 months ago

"Other bug fixed by changing {fetchedConversation.title} to {fetchedConversation.conversationTitle} on l.35 of Conversation.jsx, and {fetchedConversation.conversationHeadText} to {fetchedConversation.conversationText} on l. 36. Now title and conversation head are coming thought to the view." Screen Shot 2024-03-16 at 2 02 04 PM Screen Shot 2024-03-16 at 2 02 39 PM

Screen Shot 2024-03-16 at 2 03 28 PM

tchan128 commented 8 months ago

I think these conflicts:

server/models/Conversation.js server/schemas/resolvers.js server/schemas/typeDefs.js

should be mostly resolved from the above and only minimal tweaking is needed later on.