Giter VIP home page Giter VIP logo

mern-tutorial's Introduction

Goalsetter MERN app

This is the goalsetter app from the Learn the MERN Stack series on YouTube.

Usage

Rename the .envexample to .env and add your MONGO_URI

Install dependencies

# Backend deps
npm install

# Frontend deps
cd frontend
npm install

Run Server

npm run server

Demo

I am not sure how long this will be up

https://mernappbrad.herokuapp.com/

mern-tutorial's People

Contributors

bradtraversy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mern-tutorial's Issues

Headers not being sent

Am not sure if I am the one not getting it correctly,I would be glad if someone will explain but whenever we make a post request, let's say login we don't send any headers in the request

node_modules and polyfill

This is the first time I've ever reached out like this but I've been getting a lot of polyfill errors with webpack 5 and I haven't been able to successfully fix it with the polyfill plugin. I also tried implementing react-app-rewired. Anyone have any ideas. I'm looking through my code now for typos and errors but I have been coding along with the tutorial. It seems to have happened after handling the spinner component.

Dockerize Application

Dockerize application so it is easy to run cross-platform as well as deploy. Keeping the theme of modern development going, this is a great improvement to make. I can do this if you'd like in a PR!

Error on Heroku deployment (Module not Found)

Whenever I push my app to Heroku, the terminal give me this error:

Creating an optimized production build...
remote:        Failed to compile.

` Module not found: Error: Can't resolve './pages/Dashboard' in '/tmp/build_3fe5f3dd/frontend/src'`

My App is working absolutely fine in development and it also builds the app perfectly when I run the npm run build command

Please help!!!

Infinite Loop

dispatch(getGoals())
return () => {
dispatch(reset())
}

I am a newbie in react but there is a infinite loop issue if dispatch(getGoals()) gets rejected.
The new state will be state.isError = true from extraReducers getGoals.rejected.
Then dispatch(reset()) comes and sets the state state.isError = false, component renders again and the loop starts again.

My fix:
dispatch(getGoals()) if(!isError){ dispatch(reset()) }

If someone can come with a linked explanation with the exact reason why this is happening would be great :)

JWT_SECRET Not In Env

Hi,

Hoping someone can help.

My backend fails to work when registering a new user, I have the error: "JsonWebTokenError: jwt malformed" the issue appears to be that the JWT_SECRET env is not available in the userController.js file. I'm wondering a couple of things here.

  1. Why no package.json for the backend project?
  2. Why is dotenv not imported/required in the userController.js

It's a little weird that others haven't had the same issue, so I guess I must be missing something?

view single goal and update

can any one please add the functionality on how to view a single Goal and also update the goal which is not included in the training

JWT at 29:00 (in the video) works for login, but not for register

{
"message": "Cannot access 'user' before initialization",
"stack": "ReferenceError: Cannot access 'user' before initialization\n at D:\z_Dev\MERN\mern-tuto\backend\controllers\userController.js:36:31"
}

for the login the token gets returned normally, but not for register

Configurations for Vitejs

add the below code in the vite.config.js

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    proxy: {
        "/api": "http://localhost:5000",
    },

// to serve on the 3000 port  
    host: '0.0.0.0',
    port: 3000,
  },
  plugins: [react()],
})

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.