Skip to content

HobbaZ/React-Graphql-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React GraphQL Template

License License Github Commits GitHub latest commit GitHub followers GitHub repo size GitHub issues GitHub forks GitHub language count

Description

Project Aim

To create a simple React app with GraphQL MongoDB database to be used as a template to develop websites quicker.

What Problem Does It Solve

Starting a React website from scratch

What I Learnt

How to use GraphQL with React

Deployment

Deployed on Heroku here

Table of Contents

User Story

Create a template for basic setup of a React SPA with a GraphQL backend.

Screenshots

the home page

the login page

the signup page

The profile page

Installation

Need to install MongoDB local server before trying to run this project, check the MongoDB documentation: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-windows/

  1. Clone the repo to your computer by clicking the green code button and copying the SSH version.

  2. Open Gitbash in your desired folder and type git clone then right click to paste the string and hit enter. The repo will then be cloned to your computer.

  3. Navigate to the repo folder and type code . into gitbash to open the repo in VS Code.

  4. Open a new Terminal in VS Code and type npm install to install the repo dependencies.

  5. Create a .env file like the image below in the server folder and input your database details.

example .env file

  1. Install concurrently as dev dependency npm i concurrently -D at root folder

  2. Start your local MongoDB server by going to the location mongoDB was installed or opening Gitbash and cd ing to it.

    The location path is usually similar to this: C:\Program Files\MongoDB\Server\<server version number>\bin

    Then type mongod into Gitbash and hit enter. This will start a local server.

  3. Then open Mongo Compass and connect to the local server by typing: mongodb://localhost:27017/

  4. Finally, type npm run develop into the terminal and it will start the dev server at localhost:3000.

Features

  • Can create an account, delete your account and update your details.
  • User Authentication for profile and login routes.
  • Login, signup, home, profile, about and contact pages.
  • Express server already set up and ready to go.
  • MongoDB database ready, change details in .env file to connect yours.
  • Fontawesome icons used where appropriate.

Technology

  • Express
  • Heroku
  • GraphQL
  • React
  • JWT
  • MongoDB
  • Bootstrap

Contributors

Zachary Hobba

You can also contribute by opening a pull request or submitting an issue.

Acknowledgements

Custom mongoDB error messages from Stack overflow

MongoDB error handling middleware

Background photo is by Geran de Klerk forest

Important: Code to kill port processes if something running on port 3000 error npx kill-port 3000, type into your VS Code terminal and hit enter, will kill port 3000 and let you run the app.

Testing

No tests yet

License

MIT

Copyright 2022 Zachary Hobba

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Questions

Find me on Github at HobbaZ

If this has helped you with your web development, consider buying me a Coffee (only costs $3) at zachobba

Email me at zachobba@gmail.com

About

A simple React app with GraphQL Mongo DB database and user authentication to be used as a starter template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from HobbaZ/README-template