Giter Site home page Giter Site logo

samanthgourineni / node-express-mvc-ejs-start Goto Github PK

View Code? Open in Web Editor NEW

This project forked from denisecase/node-express-mvc-ejs-start

0.0 1.0 0.0 660 KB

Starter app using Node Express MVC EJS

License: MIT License

JavaScript 39.47% CSS 0.56% HTML 59.97%

node-express-mvc-ejs-start's Introduction

node-express-mvc-ejs-start Starter app

Build Status

Links

About

Use this starter app to initialize a full-stack app using:

  • Node.js platform
  • Express web framework
  • EJS templating engine
  • MVC design pattern
  • Mongoose MongoDB object modeling
  • Lodash for JavaScript object iteration and manipulation
  • jQuery library for DOM manipulation
  • BootStrap Material Design framework for responsive design
  • Morgan HTTP request logger
  • Winston multi-level logger that transports to log files

Prerequisites

Following must be downloaded, installed, and configured according to the product directions:

  • Node.js (comes with npm)
  • Git version control system
  • VS Code light-weight, cross-platform code editor or other IDE

Recommended

Start a new MVC full-stack project

  1. Fork this repo into your own cloud account.
  2. Clone your repo down to your local machine.
  3. Copy .env.example to .env
  4. Update .env with your information.
  5. Open PowerShell in root folder and run npm install to install dependencies.
  6. Run nodemon app.js to start the server.
  7. Open browser to the location displayed, e.g. http://localhost:3004/.

Production Environment

  1. Run MongoDB in the cloud - see https://www.mongodb.com/cloud/atlas

Review Code Organization

  • app.js - Starting point for the application. Defines the express server, requires routes and models. Loads everything and begins listening for events.
  • controllers/ - logic for handling client requests
  • data/ - seed data loaded each time the application starts
  • models/ - schema descriptions for custom data types
  • routes/ - route definitions for the API
  • utils/ - utilities
  • views/ - EJS - embedded JavaScript and HTML used to create dynamic pages

Resources

Deploy with Google Cloud Platform

  1. Choose a person to host your application code.
  2. Hoster should click on their Student Coupon Retrieval Link.
  3. Follow instructions to get an account.
  4. Install GCloud SDK
  5. Enable Cloud Build API and billing.
  6. Use the commands below to create a project - use your repo name.
  7. Then initialize an App Engine Application in the project - it will ask for a region. Choose one nearby with free option.
  8. package.json needs new dependency: @google-cloud/logging-winston
  9. package.json needs to set the node entry value to "^10"
  10. See app.yaml for suggested settings.
  11. After the app deploy command, you will get an error. Read the error and go to the URL provided to enable billing.
gcloud projects create node-express-mvc-ejs-start --set-as-default 
gcloud projects describe node-express-mvc-ejs-start
gcloud app create --project=node-express-mvc-ejs-start
gcloud app deploy
gcloud app browse

When starting a new session, you'll have to log in again and then set the project.

gcloud config set project node-express-mvc-ejs-start

You should get some results that include something like the following.

descriptor:      C:\44563\node-express-mvc-ejs-start\app.yaml
source:          C:\44563\node-express-mvc-ejs-start
target project:  node-express-mvc-ejs-start
target url:      <https://node-express-mvc-ejs-start.appspot.com>

See Also

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.