All Projects → IBM-Cloud → Nodejs Mean Stack

IBM-Cloud / Nodejs Mean Stack

Licence: other
Solution tutorial: Modern Web Application using MEAN stack on IBM Cloud

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Nodejs Mean Stack

Todo Apps
Sample ToDo application (various languages) running on IBM Cloud
Stars: ✭ 195 (+427.03%)
Mutual labels:  cloud-foundry, bluemix, mongodb
swift-buildpack
IBM Cloud buildpack for Swift
Stars: ✭ 33 (-10.81%)
Mutual labels:  cloud-foundry, bluemix
bluemix-go
Go library for accessing the Bluemix API
Stars: ✭ 37 (+0%)
Mutual labels:  cloud-foundry, bluemix
Mongodb Interview Questions
MongoDB Interview Questions
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Health Blockchain
A blockchain for fitness data demo
Stars: ✭ 31 (-16.22%)
Mutual labels:  bluemix
Smarthome
💡 智能电器管理综合系统
Stars: ✭ 33 (-10.81%)
Mutual labels:  mongodb
Goeat Api
Rest API for a food delivery application - Built with Express, Postgres, Redis, MongoDB and Nodemailer
Stars: ✭ 36 (-2.7%)
Mutual labels:  mongodb
Spring Cloud Stream Tutorial
Spring Cloud Stream Tutorial
Stars: ✭ 30 (-18.92%)
Mutual labels:  cloud-foundry
Puppet Mongodb
This module manages mongodb services. It provides the functions for sharding, mongod and mongos instances.
Stars: ✭ 34 (-8.11%)
Mutual labels:  mongodb
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-13.51%)
Mutual labels:  mongodb
Cmms
Computerized Maintenance Management System
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Learningprocess
💥 本仓库用于记录我的学习历程和学习笔记
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Foodeazy
Stars: ✭ 34 (-8.11%)
Mutual labels:  mongodb
Vue Admin Spa Api
本项目使用node.js+express+MongoDB编写后端接口代码,主要为vue-admin-spa(前端项目)提供在线api接口
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Node Production
Take Your Node.js Project to The Production Environment (VPS/Dedicated Server).
Stars: ✭ 35 (-5.41%)
Mutual labels:  mongodb
Insurance Bot
A message based insurance experience
Stars: ✭ 30 (-18.92%)
Mutual labels:  cloud-foundry
Spring Session Data Mongodb
Spring Session for MongoDB
Stars: ✭ 34 (-8.11%)
Mutual labels:  mongodb
Oauth2orize resource owner password example
This is an example of the oAuth resource owner password flow using oauth2orize, express 4 and mongoDB.
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Checksheet Manager
Checksheet Manager for college checksheets. Created with AngularJS and Node/Express/MongoDB.
Stars: ✭ 31 (-16.22%)
Mutual labels:  mongodb
Mongo4idea
MongoDB integration in Intellij
Stars: ✭ 966 (+2510.81%)
Mutual labels:  mongodb

Modern Web Application using MEAN stack

This is a basic boilerplate for the MEAN stack (MongoDB, Express, AngularJS and Node.js) on IBM Cloud.

This application uses the IBM Cloud Databases for MongoDB service and Node.js runtime on IBM Cloud.

The code and detailed steps are discussed in the IBM Cloud solution tutorial titled Modern web application using MEAN stack.

Features

  • MVC project structure
  • Create, edit and delete user accounts
  • Authentication with username/password
  • Protected routes that can only be accessed by authenticated users
  • Bootstrap CSS framework & Cosmo theme
  • HTTPS built-in if deployed to IBM Cloud
  • Mongoose for MongoDB interactions.
  • PassportJS for authentication, with over 300 authentication strategies to pick from.

Application Requirements

Getting Started

Run the application locally
  1. Clone or download this repo onto your machine.
  2. Install application requirements if not done so already.
  3. Open application directory in your terminal and run npm install
  4. If you don't have an account, create a free one here.
  5. Login to your account via the command line: ibmcloud login
  6. Target your account ORG and SPACE ibmcloud target --cf
  7. Create the instance of IBM Cloud Databases for MongoDB on IBM Cloud: ibmcloud cf create-service databases-for-mongodb standard mean-starter-mongodb
  8. Rename .env.example file to .env and run ibmcloud cf service-key mean-starter-mongodb "Service credentials-1" for MONGODB_URL and CERTIFICATE_BASE64. Choose your own SESSION_SECRET.
  9. Run node server.js to start your app
  10. Open a browser to the link provided in the terminal prompt to view your app

Note that the code assumes a secured connection to MongoDB using SSL and a certificate. This way you can run the app locally but connect to IBM Cloud Databases for MongoDB.

An alternative way of running locally is using the provided Dockerfile.

  • Install docker on your machine and build the docker image
     docker build . -t mean-stack:v1.0.0
    
  • Run the app locally
     docker run -p 6020:6020 -ti mean-stack:v1.0.0
    
Deploy to IBM Cloud

Option 1 (launch this app directly from this repo):

Deploy to IBM Cloud

Option 2 (deploy from your local machine):

  1. Clone or download this repo onto your machine.
  2. Open a terminal prompt to the directory of your application.
  3. If you don't have an account, create a free one here.
  4. Login to your account via the command line: ibmcloud login
  5. Target your account ORG and SPACE ibmcloud target --cf
  6. Create the instance of IBM Cloud Databases for MongoDB on IBM Cloud: ibmcloud cf create-service databases-for-mongodb standard mean-starter-mongodb
  7. Push your app to IBM Cloud with ibmcloud cf push
  8. Done, the app should be looking like:

Problems or Questions?

Create a GitHub issue for questions or problems occurs using this demo.

Critical Files & Folders

File Description
manifest.yml File that defines deployment paramaters. More info here
.env.example Set custom environment variables for your application. This is the proper way to store credentials and other sensitive values.
server.js Main server file that the Node.js runtime uses. It contains all the server logic.
/server Folder for files used by the Node.js server
/server/models/user.model.js Model for storing users in MongoDB
/public Folder for files delivered to users, such as html and css files
/public/js/app.js Angular application for manipulating and rendering data in browser

Application

  • MongoDB stores user account information and persists sessions (so that a server crash does not log out all users.)
  • Express functions Node.js middleware to handle all HTTP requests and routing.
  • Angular handles HTML templating and data manipulation.
  • Node.js is the runtime for the application.

There is also generous commenting throughout the application which helps explain critical parts of the application.

Contribute

Please create a pull request with your desired changes.

Troubleshooting

The primary source of debugging information for your app is the logs. To see them, run the following Cloud Foundry command using the IBM Cloud CLI:

$ ibmcloud cf logs <application-name> --recent

If you are not sure what your application name is, use this command to print your application name(s):

$ ibmcloud cf apps

For more detailed information on troubleshooting your application, see the Troubleshooting section in the documentation.

License

See LICENSE.MD for license information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].