Convert Figma logo to code with AI

linnovate logomean

The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications

12,109
3,423
12,109
82

Top Related Projects

4,862

MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js -

A boilerplate application for building web apps using node and mongodb

A boilerplate for Node.js web applications

13,199

LoopBack makes it easy to build modern applications that require complex integrations.

The superpowered headless CMS for Node.js — built with GraphQL and React

15,203

The API and real-time application framework

Quick Overview

MEAN.JS is a full-stack JavaScript solution that helps you build fast, robust, and maintainable production web applications using MongoDB, Express, AngularJS, and Node.js. It provides a solid starting point for developers to create modern web applications with a focus on modularity and scalability.

Pros

  • Provides a complete, pre-configured development environment
  • Follows best practices and modular architecture for scalable applications
  • Includes built-in features like authentication, user management, and RESTful API
  • Active community and extensive documentation

Cons

  • Learning curve for developers new to the MEAN stack
  • AngularJS (1.x) is outdated; newer projects might prefer Angular (2+) or other modern frameworks
  • Opinionated structure may not suit all project requirements
  • Requires understanding of multiple technologies (MongoDB, Express, Angular, Node.js)

Code Examples

  1. Creating a new MEAN.JS application:
npm install -g meanjs-cli
meanjs new my-mean-app
cd my-mean-app
npm install
npm start
  1. Defining a MongoDB schema:
const mongoose = require('mongoose');
const Schema = mongoose.Schema;

const UserSchema = new Schema({
  firstName: String,
  lastName: String,
  email: {
    type: String,
    unique: true,
    required: 'Email address is required'
  },
  username: {
    type: String,
    unique: true,
    required: 'Username is required'
  },
  password: {
    type: String,
    required: 'Password is required'
  },
  created: {
    type: Date,
    default: Date.now
  }
});

mongoose.model('User', UserSchema);
  1. Creating an Express route:
module.exports = function(app) {
  const users = require('../controllers/users.server.controller');

  app.route('/api/users')
    .get(users.list)
    .post(users.create);

  app.route('/api/users/:userId')
    .get(users.read)
    .put(users.update)
    .delete(users.delete);

  app.param('userId', users.userByID);
};

Getting Started

  1. Install Node.js and MongoDB on your system.
  2. Install the MEAN.JS CLI:
    npm install -g meanjs-cli
    
  3. Create a new MEAN.JS project:
    meanjs new my-project
    
  4. Navigate to the project directory and install dependencies:
    cd my-project
    npm install
    
  5. Start the application:
    npm start
    
  6. Open your browser and visit http://localhost:3000 to see your MEAN.JS application running.

Competitor Comparisons

4,862

MEAN.JS - Full-Stack JavaScript Using MongoDB, Express, AngularJS, and Node.js -

Pros of mean

  • More active development and maintenance
  • Better documentation and community support
  • Cleaner and more modular codebase structure

Cons of mean

  • Slightly steeper learning curve for beginners
  • Less opinionated, which may require more decision-making
  • Fewer built-in features out of the box

Code Comparison

mean:

// Server-side routing example
app.route('/api/articles').all(articlesPolicy.isAllowed)
  .get(articles.list)
  .post(articles.create);

MEAN:

// Server-side routing example
app.get('/api/articles', ArticlesController.list);
app.post('/api/articles', ArticlesController.create);

The code comparison shows that mean uses a more concise and chained approach for defining routes, while MEAN opts for separate route definitions. This reflects mean's more modular and flexible structure, which can be advantageous for larger projects but may require more setup initially.

Both repositories provide full-stack JavaScript solutions using MongoDB, Express, Angular, and Node.js. mean tends to be more up-to-date and actively maintained, with a larger community and more comprehensive documentation. However, MEAN offers a simpler structure that might be easier for beginners to grasp initially.

Ultimately, the choice between the two depends on project requirements, team expertise, and personal preferences regarding structure and flexibility.

A boilerplate application for building web apps using node and mongodb

Pros of node-express-mongoose

  • Lightweight and modular structure, allowing for easier customization
  • Focuses on core Node.js, Express, and Mongoose integration
  • Simpler learning curve for developers familiar with these technologies

Cons of node-express-mongoose

  • Lacks built-in Angular integration, requiring additional setup for full-stack development
  • May require more manual configuration for features that MEAN includes out-of-the-box
  • Less opinionated, which can lead to inconsistencies in project structure across teams

Code Comparison

node-express-mongoose:

const express = require('express');
const mongoose = require('mongoose');
const app = express();

mongoose.connect('mongodb://localhost/myapp');
app.listen(3000, () => console.log('Server started'));

MEAN:

const express = require('express');
const mongoose = require('mongoose');
const app = express();
const angularPath = path.join(__dirname, 'public');

mongoose.connect('mongodb://localhost/mean');
app.use(express.static(angularPath));
app.listen(3000, () => console.log('MEAN app started'));

The code comparison shows that node-express-mongoose provides a more basic setup, while MEAN includes Angular integration and a predefined structure. node-express-mongoose offers more flexibility but requires additional configuration for a full-stack application, whereas MEAN provides a more comprehensive out-of-the-box solution for building full-stack JavaScript applications.

A boilerplate for Node.js web applications

Pros of Hackathon Starter

  • More comprehensive set of features and integrations out-of-the-box
  • Regularly updated with modern dependencies and security patches
  • Extensive documentation and beginner-friendly setup process

Cons of Hackathon Starter

  • Potentially overwhelming for simple projects due to its extensive feature set
  • Less focus on scalability compared to MEAN stack
  • Opinionated structure may require more customization for specific use cases

Code Comparison

Hackathon Starter (Express.js route):

app.get('/api', (req, res) => {
  res.json({ message: 'Welcome to the API!' });
});

MEAN (Angular component):

@Component({
  selector: 'app-root',
  template: '<h1>{{ message }}</h1>'
})
export class AppComponent {
  message = 'Welcome to MEAN!';
}

Key Differences

  • Hackathon Starter is primarily focused on backend and API development with Node.js and Express
  • MEAN provides a full-stack solution with Angular for the frontend
  • Hackathon Starter includes more third-party integrations and authentication options
  • MEAN emphasizes scalability and modular architecture for larger applications

Use Cases

  • Choose Hackathon Starter for rapid prototyping and API-centric projects
  • Opt for MEAN when building full-stack applications with a strong focus on Angular frontend
13,199

LoopBack makes it easy to build modern applications that require complex integrations.

Pros of LoopBack

  • More extensive API development features, including built-in models and connectors
  • Better documentation and community support
  • Stronger focus on enterprise-grade applications

Cons of LoopBack

  • Steeper learning curve due to more complex architecture
  • Less flexibility in choosing frontend technologies compared to MEAN stack
  • Potentially overkill for smaller projects or simple applications

Code Comparison

MEAN stack (Express route):

app.get('/api/users', function(req, res) {
  User.find({}, function(err, users) {
    if (err) return res.status(500).send(err);
    res.json(users);
  });
});

LoopBack (Model definition):

module.exports = function(User) {
  User.remoteMethod('findUsers', {
    http: {path: '/find', verb: 'get'},
    returns: {arg: 'users', type: 'array'}
  });
  User.findUsers = function(cb) {
    User.find({}, cb);
  };
};

Both MEAN and LoopBack are powerful frameworks for building Node.js applications, but they cater to different needs. MEAN provides a full-stack solution with more frontend flexibility, while LoopBack excels in API development and enterprise applications. The choice between them depends on project requirements and team expertise.

The superpowered headless CMS for Node.js — built with GraphQL and React

Pros of Keystone

  • More flexible and customizable content management system
  • Better TypeScript support and type safety
  • Actively maintained with regular updates and improvements

Cons of Keystone

  • Steeper learning curve for beginners
  • Less opinionated structure compared to MEAN stack
  • May require more setup and configuration

Code Comparison

MEAN (Express route example):

app.get('/api/users', function(req, res) {
  User.find({}, function(err, users) {
    if (err) throw err;
    res.json(users);
  });
});

Keystone (GraphQL API example):

export const User = list({
  fields: {
    name: text(),
    email: text({ isUnique: true }),
  },
  access: {
    read: () => true,
  },
});

The MEAN stack provides a more traditional Express-based API approach, while Keystone focuses on GraphQL APIs and content management. Keystone offers more flexibility in defining data models and access control, but may require more initial setup. MEAN provides a more straightforward, full-stack JavaScript solution out of the box, but may be less adaptable for complex content management needs.

15,203

The API and real-time application framework

Pros of Feathers

  • More flexible and modular architecture, allowing for easier customization and scalability
  • Supports real-time functionality out of the box with WebSockets
  • Extensive plugin ecosystem for additional features and integrations

Cons of Feathers

  • Steeper learning curve for developers new to its concepts and architecture
  • Less opinionated structure compared to MEAN, which may require more decision-making

Code Comparison

MEAN (Express route):

app.get('/api/users', function(req, res) {
  User.find({}, function(err, users) {
    if (err) return res.status(500).send(err);
    res.json(users);
  });
});

Feathers (Service):

app.use('/users', {
  async find(params) {
    return await User.find({});
  }
});

Key Differences

  • Feathers uses a service-based architecture, while MEAN follows a more traditional MVC structure
  • Feathers provides built-in support for multiple databases and ORMs, whereas MEAN is primarily focused on MongoDB
  • MEAN includes Angular for the front-end, while Feathers is backend-agnostic and can be used with any front-end framework

Both frameworks offer full-stack JavaScript development, but Feathers provides more flexibility and real-time capabilities, while MEAN offers a more structured, opinionated approach with a complete front-end solution included.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Welcome to the mean stack

The mean stack is intended to provide a simple and fun starting point for cloud native fullstack javascript applications.
MEAN is a set of Open Source components that together, provide an end-to-end framework for building dynamic web applications; starting from the top (code running in the browser) to the bottom (database). The stack is made up of:

  • MongoDB : Document database – used by your back-end application to store its data as JSON (JavaScript Object Notation) documents
  • Express (sometimes referred to as Express.js): Back-end web application framework running on top of Node.js
  • Angular (formerly Angular.js): Front-end web app framework; runs your JavaScript code in the user's browser, allowing your application UI to be dynamic
  • Node.js : JavaScript runtime environment – lets you implement your application back-end in JavaScript

Pre-requisites

Installation

git clone https://github.com/linnovate/mean
cd mean
cp .env.example .env
yarn
yarn start (for development)

Docker based

⚠️ Make sure your Docker version is 19.03.0+.

git clone https://github.com/linnovate/mean
cd mean
cp .env.example .env
docker-compose up -d

Credits

  • The MEAN name was coined by Valeri Karpov.
  • Initial concept and development were done by Amos Haviv and sponsored by Linnovate.
  • Inspired by the great work of Madhusudhan Srinivasa.