Coder Social home page Coder Social logo

mean-apispark-beer's Introduction

Build Status

๐Ÿบ Beer app ๐Ÿบ

I really want to learn MEAN Stack. But I want to do this step by step. So I've decided to proceed in 3 steps:

  1. AngularJS with a json file
  2. AngularJs + Web API (by using APISpark)
  3. MEAN Stack (Mongodb, Express, AngularJs & Node.js)

I also decide do work with beer, because it's funniest than contact, products, todo-task, ... Thanks to @lostinbrittany for his json file and images.

I also use twitter Bootstrap because I won't spend time to code css.

If you found a typo or a mistake somewhere, please fork and edit this post. Thank you :)

Installation

  1. Download the code
  2. Install the npm modules: npm install
    Use the --no-bin-links argument if it fails.

Step 1: AngularJs - json file

Here, you can manage your beers with CRUD operations.
Note that all fields are mandatory (except description).

Step 2: AngularJs + Web API (APISpark)

APISpark logo

In a nutshell, APISpark is a Platform-as-a-Service dedicated to web API. You can manage, host, consume API for free (if you use less than "10 Concurrent Clients").

Here, my Web API is public. So you can access to my dashboard.

If data are empty, or if you find errors, please reinitialize the database (Reinitialize button).

Note: Further reading about JS Promise (because it's a so powerful feature ;-))

Step 3: MEAN Stack (Mongodb, Express, AngularJs & Node.js)

  1. Initialize database (2 ways):
  • Import data with json file: mongoimport --db beers --collection beers --jsonArray step1/beer-list.json
  • Or : Use the reinitialize button
  1. In the server/server.js file, change the endpoint according to your configuration (replace scotch.local:3000 to something like localhost:3000).
  2. Start the server: npm start.
    You will need nodemon : npm install -g nodemon
  3. Visit the application in your browser at http://localhost:3000/ (you will see "Hello beer!")
  4. Enjoy beer ๐Ÿบ

Tests:

  1. Install mocha: npm install -g mocha
  2. Run tests: npm test

mean-apispark-beer's People

Contributors

maxpou avatar

Watchers

 avatar  avatar  avatar

Forkers

jemenard27

mean-apispark-beer's Issues

Fix CI tests

See: https://travis-ci.org/maxpou/mean-apispark-beer/jobs/130588081

  Beers
  โœ“ should see ALL beers on /beers GET (75ms)
  โœ“ should list a SINGLE beer on /blob/<id> GET
  โœ“ should FAIL when trying to add a single error beer on /beers POST (41ms)
  โœ“ should add a single beer on /beers POST
  1) should update a SINGLE beer on /beer/<id> PUT
  โœ“ should delete a SINGLE beer on /beer/<id> DELETE
  Home
  โœ“ should see homepage
  6 passing (315ms)
  1 failing
  1) Beers should update a SINGLE beer on /beer/<id> PUT:
     Uncaught MongoError: exception: Mod on _id not allowed
      at Function.MongoError.create (node_modules/mongodb-core/lib/error.js:31:11)
      at commandCallback (node_modules/mongodb-core/lib/topologies/server.js:1187:66)
      at Callbacks.emit (node_modules/mongodb-core/lib/topologies/server.js:119:3)
      at null.messageHandler (node_modules/mongodb-core/lib/topologies/server.js:358:23)
      at Socket.<anonymous> (node_modules/mongodb-core/lib/connection/connection.js:292:22)
      at readableAddChunk (_stream_readable.js:146:16)
      at Socket.Readable.push (_stream_readable.js:110:10)
      at TCP.onread (net.js:523:20)

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.