Giter Site home page Giter Site logo

activityoverlord's Introduction

activityOverlord

For an updated version of this Series check out activityOverlordv2.0.

a Sails application

This is a part of a series of screencasts which build a sails application from scratch. You can follow the progress over at my github sailscasts page.

A live version of the project is available at: (http://activityoverlord.herokuapp.com/)

  • Episode 1: goes over installing sails and creating the initial sails project.

  • Episode 2: Creating a Sign-up Page, ‘First-look’ at Routes, and Adding Twitter Bootstrap

  • Episode 2a: Added jquery, showed ya how to load jquery.js before bootstrap.js by changing Gruntfile.js, minor changes to layout.ejs and added a custom.less file to styles.

  • Episode 3[Updated]: Creating a user model and controller, creating a sign-up page, 'first-look' at sails blueprints.

  • Episode 4: Creating a user account and enabling csrf protection.

  • Episode 5: Handling validation errors, creating a flash message and injecting it into the sign-up page.

  • Episode 6: Creating a policy and adding client-side validation to the sign-up page.

  • Episode 7: Create a show action which will be our very humble profile page.

  • Episode 8: You'll prevent html from being run on user generated content, create a user administrative page as well as flesh out the index, edit, and update action.

  • Episode 9: In episode 9 you'll create a delete action and implement a best practices methodolgy using a form with a hidden input field for deleting a user account.

  • Episode 10: In episode 10 you'll quickly switch out the application's underlying database to mongoDB with a few changes to the adapter configuration files.

Special Note: I moved the adapter configuration to local.js which is ignored by .gitignore, therefore, you'll have to make the changes specified on the video on your own.

  • Episode 11: In episode 11 you start encrypting passwords with bcrypt.

  • Episode 12: In episode 12 learn how to clone the activityOverlord project, install the necessary dependencies as well as tasks to get the application up and running from the github repository.

  • Episode 13: In episode 13 learn how to create a sign-in page, create a session controller with a new action and take a relatively deep dive into understanding sessions.

  • Episode 14: In episode 14 learn more about user authentication, creating the create and destroy actions of the session controller as well as restricting access to the application through the use of policies.

Special Note: There's an issue in this episode that requires one to be authenticated to create an account...oops. This issue was described in episode 16 and fixed in the Episode 16-17 commit.

  • Episode 15: In episode 15 you’ll change the layout page to greatly improve post authentication navigation.

  • Episode 16: In episode 16 you'll make a change to the policies and sign a user in when an account is created. This will fix some stuff I forgot to do back in episode 14.

  • Episode 17: In episode 17 you'll add a distinction between a regular user and an admin user through the use of additional policies.

  • Episode 17a: In episode 17a you'll fix an issue by marshalling request parameters, that allowed a user to inject html to create an admin user.

  • Episode 18: In episode 18 you'll get a better understanding of how web sockets and socket.io works using a chat example incorporating the concept of rooms.

Special Note: The repository for files used in this episode can be found at: (https://github.com/irlnathan/nodeChatSocket)

  • Episode 19: In episode 19 you'll create the necessary ui and mechanics for sign-in and sign-out in preparation for using web sockets.

  • Episode 20: In episode 20 you'll use an app to explore and understand how socket.io works within sails using a client side app that renders the majority of its views via ajax. With four lines of code, the app monitors the user model and alerts any subscribing sockets with changes to the model.

  • Episode 21: In episode 21 you'll learn how to integrate socket.io and sails with custom controller actions using Real Time Model Events.

Special Note: Starting with Episode 21, you should be on sails v.0.9.7 are greater.

  • Episode 22: In episode 22 you'll learn how to manipulate the DOM within server rendered views based upon Real Time Model Events.

  • Episode 23: In episode 23 you'll learn how to create real-time flash messages based upon real-time model events.

  • Episode 24: In episode 24 you'll correct and issue with passing user.name to the publishUpdate method and add a policy to subscribe action of user controller.

  • Episode 25: In episode 25 you'll learn what CommonJS is, what it does, and how to use it.

  • Episode 26: In episode 25 you'll learn how to deploy a sails app to heroku.

Special Note: A live version of the site is available at (http://activityoverlord.herokuapp.com/)

activityoverlord's People

Contributors

irlnathan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activityoverlord's Issues

encrypted password is served to user

I've looked into this, and the toJSON function is not automatically called by sails. What this means is that the user list page http://localhost:1337/user serves all encrypted passwords as does each individual user page.
screen shot 2015-08-08 at 1 27 48 am

screen shot 2015-08-08 at 1 28 33 am

All instances of User objects served to a view come with their encrypted password attribute intact.

It appears that the toJSON() method must be called explicitly for each view, as well as on the entire collection for the show controller method.
The fix is individually using toJSON on individual views and

index: function (req, res, next) {
    User.find(function foundUsers (err, users) {
        if (err) { return next(err); }
        var cleanUsers = [];
        _.forEach(users, function(user) {
            cleanUsers.push(user.toJSON());
        });
        return res.view({
            users: cleanUsers
        });
    });

Revoking admin permission

Hello,

I might be missing something but it seems that if an admin(A) removes user(U)'s admin permission while U was logged in as an admin then he can still restore his admin status.

What would be the right approach to avoid this situation where the session object becomes outdated?

Stop being so awesome

So I've powered through all 20 episodes of Sailscasts in a day following along with all the work on Activity Overlord and two things keep bothering me....

  1. Sails is incredible and all of this seems too good to be true

  2. You are way too awesome for life for putting together such a clear and concise tutorial. Its been an incredible experience and I'll definitely be using Sails and the concepts I've learned from your videos moving forward.

Thanks for all the work you've put into this to help other people learn! The internet needs more of that!

No adapter.js created with sails

Hello Irl,

I love everything about sails, and the sails casts, and you. Thank you SO much for the work you've done, it's been very helpful for my growth as a coding noob.

So, I'm on the part where we switch over to mongo and you use the adapter.js file to set it up. Sails doesn't make an adapter.js, I read that you moved the adapter to local.js but things are set up a little differently than what is shown in your video.

Is there an update on the github that I'm missing or is this supposed to work the same way?

Unique: true validation rule

Hey there,

Thanks for the tutorials. I learned a lot about sails.js because of you.

Anyway, I'm confused with the unique: true model attribute for validation. It returns a different format than other validators like maxLength etc.. this is the error being returned by unique:true - MongoError: E11000 duplicate key error index: sails_twitter.user.$username_1 dup key: { : "ken" } while maxLength etc.. returns - { ValidationError: { password: [ [Object], [Object] ] } } . Because of that I can easily render the error messages for maxLength, minLength etc.. but having a hard time on how to display the error message for unique: true; rule because the error message is a different format.

Also, I can't see the unique rule in anchor.js w/c is used by waterline.js for validation - https://github.com/balderdashy/anchor/blob/master/lib/rules.js

is unique rule really supported? 

Ep7 "show action" error

Hi,
going through your sails episode.Show,edit and delete action dont work..server waits and crash giving "FATAL ERROR: JS Allocation failed - process out of memory".
My sails version 0.10.5.

Are you still maintaining this??

there is a version change to 0.10 that breaks in ep 19,20,21 ...
Everything that has to do with socket.io is broken.. looking
for a fix. any help??

Bootstrap fails to load?

Hi, just finished watching the videos and I'm impressed. I cloned this project to my local machine and installed the necessary additions via npm, sails lift and I am able to load it in my browser, but there's no styling at all, just bare HTML. I checked and double checked that bootstrap.css is loaded in the browser and within the app, and it seems to reference the file just fine, but displaying the page shows no styling at all. Any help?

Fatal Error in sessionController.js, can't continue with the Tutorials!

**/Users/fred/Sails-Projects/activityOverlord/api/controllers/SessionController.js:102
res.redirect('/user/show/' + user.id);
^

TypeError: Cannot read property 'id' of undefined
at /Users/fred/Sails-Projects/activityOverlord/api/controllers/SessionController.js:102:39**

Something wrong here that you did not cover and cannot find any comments on SailsCast that address this.

This was just after completing: Building a Sails Application: Ep14 - User Authentication and Restricting Access Through Policies.

Any help is much appreciated.

Kind Regards,

Fred Shequine
Web Developer

Error installing / running app.

Having a problem "lifting the sails" on this demo. I have installed sails (0.9.8) just fine globally, but getting warning regarding sails version and the demo's dependency on 0.9.7. Also getting failures on undefined connection in the /sails-mongo/lib/adapter.js:77.

Are there dependency errors with the latest Sails and/or MongoDB versions? Tried reinstalling both to latest, to no avail.

What is the best process for installing and running the app to overcome these errors?

Thanks for any help with this...

YouTube playlist

@irlnathan Thank you so much for this tutorial. It's been a huge learning opportunity for me.

I wanted to play all the videos in order but neither the playlist on youtube nor the blog allowed me to do it easily. The playlist was in the backwards order and the blog requires i click on the next episode manually.

I created a playlist of the videos in correct order, [url]http://www.youtube.com/playlist?list=PLWsZeJCry-F4K4iRImeB3-i0S5mw9Ak-W[/url], but of course that will get out of date if you add any more vids. You are free to publicize my playlist or you can create you're own in that order.

Thanks for the awesome work!

Branches per episode

Would be great to have branches per episode so we can follow along and diff the changes

sails 0.10 support?

thanks very much for the tuts!
since sails 0.10 has lots of changes , i wonder if there is a "0.10 version" of activityoverlord?

Uncaught TypeError: socket.get is not a function

I am using your app.js file and i have an error like a Uncaught TypeError: socket.get is not a function when i am trying to make a requet socket.get("/user/subscribe");
but in browser console sails.io is connected .
this is what i see in console

Connecting to Sails.js...

app.js:20 Uncaught TypeError: socket.get is not a function

|>    Now connected to Sails.

___/ For help, see: http://bit.ly/1DmTvgK
(using browser SDK @v0.11.0)

activityoverlord1.herokuapp.com Source

Hi, looks like assets in activityoverlord1.herokuapp.com already concated and minified, can you open sourced the activityoverlord1.herokuapp.com ?

Btw, your SailsCasts is awesome!

'userCanSeeProfile.js' redirect kinda limited...

While low priority, I'd like some help wrapping my head around this.

In /config/policies , 'UserCanSeeProfile is being called when accessing the User model. This works when accessing localhost:1337/user - we get redirected to /session/new to login. But if one accesses /user/show (or /edit/ /update) - a type error is thrown.

      500: TypeError: Cannot read property 'id' of undefined

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.