Week-21 Challenge (MERN)
This application was refactored from using strictly routing and express, to now implementing GraphQL typeDefs, resolvers and an Apollo Server. The backend uses MongoDB; it mixes Mongoose and GraphQL queries and mutations to run queries and mutations from the UI to the database.
Refactoring this application gave me a good understanding of the power of GraphQL when paired with React. It makes sense that it was developed by Facebook as it makes the routing on the front end of the code base much cleaner.
Deploying to Heroku was a massive challenge! The main hurdle was figuring out how to connect MongoDB with Heroku. To do so you must start by setting up an account through the MongoDB Cloud Atlas. Navigate to the database access tab, giving MongoDB roles atlasAdmin access, set a password and then access the correct connection string by accessing through the database tab, the connect button, and through their accessing drivers, once their, copy the connection string, hop back over to Heroku and in your setting tab add Config Vars (key: MONGODB_URI, value: mongodb+srv://:@cluster0.ibn4vyk.mongodb.net/?retryWrites=true&w=majority) paste the connection string in for the value filling in your username and password in the appropriate locations.
This application is powered by JavaScript. It uses React.js (v16.13.1), Node.js (v16.19.1), Express.js(v4.17.2), GraphQL(v15.8.0), and ApolloServer(3.11.1). CSS and Bootstrap (v5.2.3) were utilized to create the overall styling of the user interface.
-
To make changes to the code base, clone the repo (https://github.com/rmessett15/MERN-Book-Search-Engine), run npm i within the root directory of the terminal, then enter npm run develop -> you will then be taken to a live server running the site where if edits are made to the code base they can be seen in real time.
-
Users can also feel free to access the live application directly by visiting the Heroku link (https://mern-book-search-engine15-94a7abdc0a8a.herokuapp.com/).
Credits are attributed to the tutor I worked with, Joem Casusi, who helped me understand the way to use GraphQL mutations and queries and replace the currently in place routes and to AskBCS who helped me trouble shoot Heroku deployment issues.
Features of the site include Reacts ability to easily create a one page application that appears as though it is many pages. Users can easily navigate the site, search books using the implemented GoogleAPI, and save or delete books to their profile.
This application is very user intuitive, just visit the site (https://mern-book-search-engine15-94a7abdc0a8a.herokuapp.com/), navigate through different pages using the links in the nav-bar, and view desired content.
- Dark Mode Toggle
- Continued display and UI development
- Adding pages where users can interact with other users profiles
- Add additional CRUD operations
- Including unit testing
Open to collaboration, if you choose to do so open an issue and modify any changes you would like to see on a feature branch and wait for approval before merging to the main branch.
NOTICE: Contributor Covenant is released under the Creative Commons Attribution 4.0 International Public License, which requires that attribution be included.
There is currently no unit testing written yet for this application.
NOTICE: This application is covered under the MIT License
Have additional questions? Click the links below to reach me through my GitHub account or Email address.
This project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in your browser.
The page will reload when you make changes.
You may also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can't go back!
If you aren't satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
You don't have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify