Code Monkey home page Code Monkey logo

sails_angular_app's Introduction

socialfleet

2 tier enterprise app Node and Anglular

  • manually added sails.bat in Windows/System32 to generate sails scaffolding

  • 'Invalid or expired token' error message

  • Tweet Scheduler App

Running

  • /frontend > gulp
  • /backend > sails lift (or node app)

Scaffold and Launch Sails

  • sails new --no-frontend

  • sails lift

Angular Setup

  • new backend folder, move all files into it
  • Bower + Gulp
  • new frontend folder + > npm init + > npm install bower --save-dev
  • bower init + > bower install angular --save

  • npm install gulp --save-dev

  • npm install gulp-webserver --save (launches webserver on port 8000)

  • npm install main-bower-files --save-dev (copies bower files)

  • npm install gulp-inject --save-dev (Specify where to include JS/CSS files in index.html)

  • Creating gulp tasks to inject JS/CSS files and add to /temp folder
  • add vendorInject:js and :cs to pull from bower
  • setup gulp watch task to rebuild on any changes made to directories + livereload

Authorization - Satellizer

  • bower install satellizer --save

  • set up a PROXY (alt to CORS)
    • anything started with /api will trigger proxy so frontend server will bounce request to backend domain
    • set up in gulpfile.js in 'serve' - 'webserver' object
  • backend/api/controllers -- add login function to UserController
  • paste in satellizer Twitter node auth example
  • new config file inside /service
  • npm install request jwt-simple moment --save
  • copy over Model attributes and adjust for 'waterline' ORM
    • adjust step 5a in UserController and add createToken function
  • new PostController and 'tweet' function
  • npm install twit --save -> add to tweet function
  • add twitterSecret, twitterToken to model and update UserController + authenticateUrl
  • backend/config/policies - uncomment Line 29 change to false to protect routes
  • api/policies/ - jwtAuth.js - decrypting JWT and extracting the userId -- add functions to policies

Styling

  • Bootstrap, DateTime, Create a Post, Post List
  • using Sandstone from Bootswatch CSS
  • add 'message' object to $scope.tweet and log this in PostController

sails_angular_app's People

Contributors

jakblak avatar

Watchers

eeshwar 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.