Git Product home page Git Product logo

ppp's Introduction

โšก MEVN Stack Notes

  • Displays simple text notes in a grid of Bootstrap cards.
  • Uses the MongoDB, Express, Vue & Node.js (MEVN) stack to perform Create, Read, Update and Delete (CRUD) operations.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

๐Ÿ“„ Table of contents

๐Ÿ“š General info

  • Axios used to send/receive data from the MongoDB backend
  • A responsive grid of notes is displayed on the Vue frontend using data-binding and a v-for loop. Once a note is added then the grid of notes is reloaded.
  • There is an app info. page
  • Backend node.js code separated into routes/controller files with a Mongoose model Note schema.
  • Latest Mongoose v6 connection config. used (as of oct. 2021) with no deprecation warnings. Note an old config. will stop any Mongoose-based app from working.
  • The app is deployed on the Heroku 18 stack, based on Ubuntu 18.04

๐Ÿ“ท Screenshots

Example screenshot Example screenshot Example screenshot Example screenshot Example screenshot Example screenshot

๐Ÿ“ถ Technologies

Frontend

Backend

Full-Stack

๐Ÿ’พ Setup

Frontend:

  • from /client directory: npm run lint to lint files
  • npm run serve to run server.
  • Navigate to http://localhost:8080/. The app will automatically reload if you change any of the source files.
  • npm run build to create build file

/api Backend:

  • nodemon server.js to run node.js server.
  • Navigate to http://localhost:4000/ to see JSON object with todos or an empty array (refresh after changes - does not auto-update).
  • CRUD operations can be performed on this backend using the Postman API dev tool.

/ Full stack:

  • npm run dev to run client and backend server concurrently. Navigate to http://localhost:8080/ to see frontend and http://localhost:4000/ to see backend (refresh after changes - does not auto-update).
  • Heroku heroku login to login, git add . then git commit -m "commit message..." then git push heroku master to deploy to Heroku

๐Ÿ’ป Code Examples

  • note.controllers.js - add new note to database using POST
exports.post_note = async (req, res) => {
  const newNote = new Note(req.body);
  try {
    const note = await newNote.save();
    if (!note) throw new Error("Error saving note item");
    res.status(200).json(note);
  } catch (error) {
    res.status(500).json({ message: error.message });
  }
};

๐Ÿ†’ Features

  • Heroku deployment saves user notes using Heroku MongoDB database extension
  • Heroku auto updates deployment when I commit code updates to Github
  • In dev - Front and backends are run with one command using concurrently set up in package.json
  • Display of card array is responsive so they wrap around nicely as screen size changes
  • Simple 'Notes Hub' tells user how many notes there are and lets them navigate to the add note or app info pages
  • note max title length set to 23 so it shows on 1 line in card
  • note max content length set to 280, same as a twitter post
  • backend code separates controller functions from routes
  • Updating a note will automatically update the date so it goes to the front of the (date-sorted) notes list

๐Ÿ“‹ Status & To-Do List

  • Status: Working & deployed.Don't update Axios or you have to add a lot of strange (AxiosPromise) return types.
  • To-Do: Fix Websocket error. Consider alternative to Bootstrap to make app lighter - Tailwind

๐Ÿ‘ Inspiration

๐Ÿ“ License

  • This project is licensed under the terms of the MIT license.

โœ‰๏ธ Contact

ppp's People

Contributors

kuldeeprec avatar shivansh2304 avatar

Watchers

 avatar

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.