Skip to content

CesarAugustoMartinez/Note_Taker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Note_Taker

picture

Links : Heroku App Online, Repository


Table of Contents


Description

The goal of this project is cerate a application that can be used to write, save, and delete notes. This application will use an express backend and save and retrieve note data from a JSON file. This app was builded using NODE.js code to generate a dynamically html file and control API routes.

Technologies
  • JavaScript
  • NPM Modules
  • Visual Studio Code
  • Node.js
  • Package.json
  • Html
  • CSS
  • EXPRESS
Code sample - JavaScript - Express

var express = require("express");
var path = require("path");

// Tells node that we are creating an "express" server
var app = express();

// Sets an initial port. We"ll use this later in our listener
var PORT = process.env.PORT || 3030

// Sets up the Express app to handle data parsing
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
// What folder the browser can see
app.use(express.static(path.join(__dirname,"./public")));


// ROUTER
// The below points our server to a series of "route" files.
require("./routes/apiRoutes")(app);
require("./routes/htmlRoutes")(app);

// LISTENER
// The below code effectively "starts" our server
app.listen(PORT, function() {
  console.log("App listening on PORT: " + PORT);
});
Code sample - package.json

 {
  "name": "note-taker",
  "version": "1.0.0",
  "description": "This application can be used to write, save, and delete notes",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node server.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.16.4",
    "fs": "0.0.1-security",
    "path": "^0.12.7",
    "util": "^0.12.3"
  }
}
Code sample - HTML routes

// DEPENDENCIES
const path = require("path");

// ROUTING

module.exports = function(app) {
    // HTML GET Requests  
    app.get("/notes", function(req, res) {
      res.sendFile(path.join(__dirname, "../public/notes.html"));
    });
  
    // If no matching route is found default to home
    app.get("*", function(req, res) {
      res.sendFile(path.join(__dirname, "../public/index.html"));
    });
      
  };

How To Use

This web application is running on a server. It has a principal html webpage where the user will click on GetStarted button to invoke the a new webpage. Once It has been invoked the page will have inputs for title, and data of the note. Then It can save, delete, or modify notes using the bottons on top of the page.

Back To The Top

Screenshots

  • HTML page for enter notes.

picture

  • Notes List section.

picture

  • Note Data section.

picture

  • Note nav and buttons

picture

Back To The Top


References

Back To The Top


License

Copyright (c) [2020] [Cesar A Martinez]

Back To The Top


Author Info

Back To The Top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages