Code Monkey home page Code Monkey logo

ng5-startup's Introduction

Ng5plusStartup

Angular 5 project startup with builtin NodeJS web server and API. Quickly build and deploy any ng5 project.

Installation

// frontend
$ git clone [email protected]:smikodanic/ng5-startup.git
$ cd ./ng5-startup
$ npm install
$ ng serve --aot -o

// backend
$ cd ./ng5-plus/server
$ npm install
$ cd ..
$ export MONGODB_URI="mongodb://ng5plus_user:[email protected]:27017/ng5plus-server"
$ nodemon server  (or just $ node server)

Features

  • integrated login
  • integrated API endpoints
  • API routes
  • API error handlers: 404 bad API URL, error sender (console, mongodb, 3rd party), uncaught errors
  • SPA (single page app) routes (Angular Router)

Server Environment variables

  • $ export NODE_ENV=development | production (default env is development)
  • $ export MONGODB_URI="mongodb://ng5plus_user:[email protected]:27017/ng5plus-server" (enter mongodb URI)
  • $ export NODE_RIND=true (rebuild mongodb indexes)

API Endpoints

Basic API endpoints for user registration and login. See file /server/app/routes/_api.js

- GET / (API Info)
- POST /users/register {first_name: , last_name: , username: , password: , role: 'admin | customer'}
- POST /users/login {credentials admin:test123 OR customer:test123}
- GET /users/loggedinfo (get logged user info)
- GET /admin/test  (test admin role)
- GET /customer/test  (test customer role)

API Test Users

  • username: 'admin' , password: 'test123' , role: 'admin'
  • username: 'customer' , password: 'test123' , role: 'customer'

Licence

Created by Saša Mikodanić under MIT licence.

Contact

Contact for mongodb://ng5plus_user:[email protected]:27017/ng5plus-server MongoDB password www.mikosoft.info in oreder API to work properly.

ng5-startup's People

Contributors

angular-cli avatar smikodanic avatar

Watchers

 avatar  avatar

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.