Welcome to the Treehouse Community
Looking to learn something new?
Andrew Finn2,193 Points
Custom member only login feature.
I joined Treehouse after having an idea for a website, and as I have no previous programming experience I am unsure about a lot of website functionality, and terminology.
If I wanted to design a website, with the home page being a simple screen containing a log in area in the centre, below the company logo, what would I need to do design this from scratch?
The log in box would prompt for a user name and password, and also offer the option for sign up to new users.
Log in info entered would need to correspond with a database (I have already signed with a web hosting service), with any new user sign ups being added to the database.
This might be really straight forward, but I am really in the dark with the basics. Any advice would be appreciated, Team Treehouse!
Jennifer NordellTreehouse Teacher
But my best suggestion to you is to get started on the Front End Web development track here on Treehouse. It's fun and will give you a good basis for starting your own project using best practices.
What is this Login form's purpose? Where should your users be logged in to? What do they sign up to? Do you want to provide access to certain sites to those members only? What kind of sites? Do you want to provide access to downloadable files?
The list of questions can go on on and on :))
So my best guess is that you want to provide some kind of access to some kind of content. Have you heard of WordPress? Check it out! It might be a very simple solution to what your are trying to accomplish.
While using WordPress you can start the Frontend Webdevelopment Course, Basic php course as well as Basic WordPress courses also available here on teamtreehouse.com to get a basic understanding of what's going on :)
Kevin Korte28,109 Points
This is starting to become a pretty big project. Wordpress can do this, but you just need to know how to bend it's arm. However I wouldn't recommend wordpress here.
Likely, you are at a big enough point you will probably want to look at MVC frameworks. Just on the log in and new user registration page there is a ton of logic and security that you should account for, some things to consider
- Salting the password in the database
- Protect against spam sign ups
- What if the user already exists
- Protect is CSF attacks (cross script forgery) - Pass and check a CSF token
- Password reset
- Email confirmation?
That's just off the top of my head. Wordpress, and many good MVC's will address most or all of these things for you.
For two sites to communicate, the site that is hosting the actual data, which sounds like it's the other site will need to have an API that you can request information from, and send information too. By default, two sites can't really just "communicate" for obvisous security reasons. So API's allow your site, to pass authenticated tokens to the other site, and information and calls to "do something", which the other site can do, and respond back to with the results. It works the same in reverse. If the other site's API supports webhooks, you can receive a call to do something, do it, and than return the call letting the other server know whatever it asked your server to do, worked.
This is definitely a bigger, custom project, and I'd highly recommend a MVC framework for this. My favorite is Ruby on Rails. Although Node.js is cool, and I'm personally working on Node, and the Meteor.js framwork built off of Node, I still like Ruby on Rails.
But, Meteor does real time data updates really well, where it's a lot of work on Rails, or any other server side language, as they do not default to live updates by default. All of these technologies are still HTTP request based, and so it takes a bit more work to establish a socket, or connection between browser and server to receive real time data updates.
Good luck, it sounds like a fun project
Kevin Korte28,109 Points
And than make sure the site you are pulling data from has a developer api available. If they don't you're basically out of luck.