Sharing Top Content from the Angular-sphere.

How to Build a Portfolio Platform App Using AngularJS

How to Build a Portfolio Platform App Using AngularJS

  • js”, “engines”: { “node”: “4.1.2”, “npm”: “3.5.2” }, “description”: “”, “dependencies”: { “body-parser”: “^1.17.2”, “bower”: “^1.7.7”, “buffer-to-vinyl”: “^1.1.0”, “express”: “^4.13.3”, “gulp”: “^3.9.1”, “gulp-autoprefixer”: “^3.1.0”, “gulp-concat”: “^2.6.0”, “gulp-concat-css”: “^2.2.0”, “gulp-env”: “^0.4.0”, “gulp-minify-css”: “^1.2.4”, “gulp-ng-config”: “^1.4.0”, “gulp-npm-script-sync”: “^1.1.0”, “gulp-webserver”: “^0.9.1”, “http-server”: “^0.9.0”, “stripe”: “^4.22.0”, “wiredep”: “^3.0.0” }, “scripts”: { “postinstall”: “bower install gulp config gulp js”, “start”: “npm run production”, “production”: “node app-server.
  • js”, “gulp”: “gulp” }, “author”: “”, “license”: “ISC”, “devDependencies”: { “gulp-npm-script-sync”: “^1.1.0”, “gulp-remote-src”: “^0.4.2” }}Second, let’s make a bower.json file.cosmicapp-porfolio$ touch bower.jsonNow, in your bower.json, copy and paste the code “name”: “photography-portfolio-app”, “description”: “Photography Portfolio App”, “version”: “0.0.0”, “homepage”: “license”: “MIT”, “private”: true, “dependencies”: { “angular”: “~1.5.
  • x” }, “devDependencies”: { “cr-acl”: “^0.5.0” }}Config app server:cosmicapp-porfolio$ touch express = require(‘express’);var bodyParser = require(‘body-parser’);var app = express();app.set(‘port’, process.env.PORT || http = require(‘http’).
  • Server(app)// Routeapp.get(‘/’, (req, res) = { res.sendFile(__dirname + () = { console.log(‘Photography Portfolio App listening on ‘ + app.get(‘port’))})What we’re installing and why:We’re going to use the AngularJS framework to build Single-page applicationWe’re installing angular-ui-router for create multi views.We are going to use gulp for build all js and css files into one file.Building our app:Now we’re going to build out our file structure a bit more so that we can organize our angular modules and js files.
  • pipe(concat(‘main.js’)) function () { const json = JSON.stringify({ BUCKET_SLUG: process.env.COSMIC_BUCKET, MEDIA_URL: ‘https://api.cosmicjs.com/v1/’ + process.env.COSMIC_BUCKET + ‘/media’, URL: READ_KEY: process.env.COSMIC_READ_KEY || ”, WRITE_KEY: process.env.COSMIC_WRITE_KEY || ”, DEFAULT_IMAGE: process.env.DEFAULT_IMAGE || ” }); return b2v.stream(new Buffer(json), ‘config.js’) .

In this tutorial I’m going to show you how to create a “Portfolio Platform” app using AngularJS, a little bit of Node, and Cosmic JS. At the end of the tutorial we will have a platform that enables…

@ngnewsletter: How to Build a Portfolio Platform App Using AngularJS

In this tutorial I’m going to show you how to create a “Portfolio Platform” app using AngularJS, a little bit of Node, and Cosmic JS. At the end of the tutorial we will have a platform that enables management of multiple portfolio websites. Users can login and manage their portfolio website. The admin can manage multiple users from the Cosmic JS Dashboard. Let’s get started.

Check out the demo.

First, let’s make a new directory to build our project in and lets also make a package.json file.

Now, in your package.json, copy and paste the code below:

“version”: “1.0.0”,

“main”: “app-server.js”,

“node”: “4.1.2”,

“npm”: “3.5.2”

“description”: “”,

“body-parser”: “^1.17.2”,

“bower”: “^1.7.7”,

“buffer-to-vinyl”: “^1.1.0”,

“express”: “^4.13.3”,

“gulp”: “^3.9.1”,

“gulp-autoprefixer”: “^3.1.0”,

“gulp-concat”: “^2.6.0”,

“gulp-concat-css”: “^2.2.0”,

“gulp-env”: “^0.4.0”,

“gulp-minify-css”: “^1.2.4”,

“gulp-ng-config”: “^1.4.0”,

“gulp-npm-script-sync”: “^1.1.0”,

“gulp-webserver”: “^0.9.1”,

“http-server”: “^0.9.0”,

“stripe”: “^4.22.0”,

“wiredep”: “^3.0.0”

“postinstall”: “bower install && gulp config && gulp js”,

“start”: “npm run production”,

“production”: “node app-server.js”,

“gulp”: “gulp”

“author”: “”,

“license”: “ISC”,

“gulp-npm-script-sync”: “^1.1.0”,

Second, let’s make a bower.json file.

Now, in your bower.json, copy and paste the code below:

“name”: “photography-portfolio-app”,

“description”: “Photography Portfolio App”,

“version”: “0.0.0”,

“homepage”: “https://github.com/kutsaniuk/cosmicapp-porfolio”,

“license”: “MIT”,

“private”: true,

“dependencies”: {

“angular”: “~1.5.x”,

“angular-mocks”: “~1.5.x”,

“angular-bootstrap”: “~1.1.x”,

“angular-cookies”: “~1.5.x”,

“angular-route”: “~1.5.x”,

“angular-ui-router”: “0.2.x”,

“angular-resource”: “1.5.x”,

“angular-animate”: “~1.5.x”,

“ng-dialog”: “0.6.1”,

“bootstrap”: “3.3.x”,

“cr-acl”: “”,

“angular-chosen-localytics”: “*”,

“bootstrap-chosen”: “*”,

“ng-flow”: “^2.7.4”,

“angular-mask”: “*”,

“checklist-model”: “0.9.0”,

“angular-ui-notification”: “^0.2.0”,

“angular-ui-calendar”: “^1.0.2”,

“angular-ui-switch”: “^0.1.1”,

“ng-scrollbars”: “^0.0.11”,

“jquery.scrollbar”: “*”,

“angular-flash-alert”: “^2.4.0”,

“components-font-awesome”: “^4.7.0”,

“angular-loading-bar”: “^0.9.0”,

“angular-environment”: “^1.0.8”,

“angular-dragdrop”: “”,

“angular-sanitize”: “1.5.*”,

“angular-drag-and-drop-directives”: “”,

“jquery-ui-touch-punch”: “”,

“angular-touch”:”1.5.*”,

“textAngular”:”1.5.*”

“resolutions”: {

“angular”: “~1.5.x”

“devDependencies”: {

“cr-acl”: “^0.5.0”

Config app server:

Now we’re going to build out our file structure a bit more so that we can organize our angular modules and js files. This is what our cosmicapp-porfolio directory should look like:

Now we we will set up our index.html. Copy and paste the following code into your index.html file:

Here, we are going to target our “root” view to place our angular modules in later. The main.js file located in our dist directory is what our gulpfile.js file will spit out after bundling all of our angular modules Now, set up our gulpfile.js file to bundle all of our js files and export that bundle file to our dist directory. Copy the following code into your gulpfile.js file:

After that we can create main module. Copy and paste the following code into your main.mdl.js file:

url: ‘/blog’,

templateUrl: ‘../blog.html’

url: ‘/login’,

controller: ‘AuthCtrl as auth’,

is_granted: [‘ROLE_GUEST’]

url: ‘/register’,

controller: ‘AuthCtrl as auth’,

Create Auth Service, copy and paste the code below:

metafield_key: ’email’,

metafield_value_has: credentials.email,

limit: 1,

ignoreLoadingBar: true,

metafield_key: ‘password’,

metafield_value: credentials.password,

limit: 1,

type_slug: ‘users’,

slug: user.username,

key: “first_name”,

type: “text”,

key: “last_name”,

type: “text”,

key: “email”,

type: “text”,

key: “password”,

type: “text”,

key: “intro”,

type: “html-textarea”,

key: “about”,

type: “html-textarea”,

key: “contact”,

type: “html-textarea”,

key: “projects”,

type: “objects”,

object_type: “projects”,

Create User Service for get and update User, copy and paste the code below:

Create Portfolio Service for get and update, copy and paste the code below:

Create Portfolio Controller for update and add, edit projects, copy and paste the code below:

Create Portfolio Module, copy and paste the code below:

Create Author Controller for getting information of author, copy and paste the code below:

We were able to consume the Cosmic JS API with our actions and dispatcher functions. I hope you enjoyed this tutorial as much as I did, if you have any questions reach out to us on Twitter and join our community on Slack.

How to Build a Portfolio Platform App Using AngularJS

Comments are closed, but trackbacks and pingbacks are open.