ERD table design - mysql

I'm developing a website and need to create an ERD for the website. I've never created one before but will be using MySQL to design it once I figure out the tables necessary. All I am asking for is for ideas on what tables might be necessary for this website. Here is a link to an image of the website:
!
Obviously there needs to be a user table. I have that created already with all pertinent info. Do I need to create a login, register, home, elite login, photos, events, newsletter, and contact us tables? The photo link will bring the user to a page where there are folders for each event, if you click on the folder it then opens up another page with the actual photos, but you need to be a registered user to view these. Is the login hyperlink going to be the user table? Would the register link be to another table or would that add to the user table? The events page is only going to be a list of hyperlinks that take you to a new page with dates and descriptions of the events, does this need it's own table? And lastly does the newsletter and contact us pages need separate tables as well?
Like I stated, I am not looking for anyone to help create the dERD but only to let me know if all these tables would be necessary. From there I can build the ERD and create the appropriate relationships and so forth.

You would probably benefit from learning about MVC- Model, View, Controller systems.
Views (in a webapp) map pretty well to the HTML pages you display.
Models map pretty well to the "Nouns" in your system- these are the things in your database; Users, Photos, Newsletters are examples of things that go here.
Controllers map to the "Verbs" in your system- Register, Subscribe, Upload, Save, Login are all actions that a controller might provide.
Only the Model layer lives in the database in most frameworks.
I'd suggest that you think about your problem in a more holistic fashion, rather than diving into diagramming a bunch of unrelated ideas. ERD's really only map to the stuff you need to be persistent.

I would recommend that you first draw paper prototypes of most of the user interfaces, at least at a high level. Then do usability tests on those prototypes to make sure your interface designs make sense to someone other than you. (User Interface Design by Soren Lausen is a good book for that.)
Then, once you have a decent idea of how your interfaces are going to work, think of the models necessary to make those interfaces work. Obviously, a login form with a username and password will require a User entity with username and password (or, actually, encrypted_password) attributes. Getting all these models nailed down may take some skill that I sense you may not have yet, but this task will be much easier and clearer to you if you have your interfaces drawn out than if you're just trying to sit there and think about it. Your first pass will probably be wrong, but that's okay. Start with the smallest subset of the program that could be useful on its own, build that to the point where it's completely working, and then expand from there.
Good luck!

After looking this over I have come to realize that I have jumped the gun quite a bit and need to do a lot more work on the design of the site before even thinking about the ERD. The client has only approved the mock up of the "home" page and the other pages have yet to be discussed at any length. Nothing is set in stone as it were. Therefor, creating an ERD is very premature. Many thing, from now until the database needs to be looked at, can change.
Please excuse this topic as I was overly excited about my first project. I need to focus on the agile development process and slow down. Focus on the individual steps and let things develop from that.

Related

updating the content of another webpage

I am a beginner web developer and working on a school project. My apologies for asking this basic question.
I am trying to create an online shopping store. What I am trying to do is when the user clicks on the checkout button, the shopping cart page gets updated with that element.
I don't know how to accomplish that. I really appreciate if someone can point me to a tutorial or provides some tips.
Your question is really abstract, however you will have to find the right way to communicate with a database...it might be php/MySQL with laravel or some other framework or preferably C# asp.net with entity framework(that's what I will go with its not mandatory some people like php) Then you need to learn some lambda or sql depending on which approach you would like to take (php/C#). You will probably need to get some kind of grid control for the cart asp.net has default one personally I find it confusing and hard to work with( there are many controls that can be downloaded freely without charge for non commercial products search google) then you would need to fill that grid with the List of objects that you will get from your database. If you get that far alone the next steps would be easy you will probably need some javascript for ajax calls to a webservice or either your backend so you can submit the orders. For the right tutorial there is none actually since your question covers several topics regarding database modeling, data fetching, backend development and front end development. You can start by getting yourself some kind of server (look for mssql for asp.net) and MySQL for php, then you should look for some kind of database modeling tutorial basic tables relationships 1-1 1-* *-1, after that you would need to do your design (from the question I assume that you already have one downloaded). Then if you got down to this step you should google the way for the right way of communicating with your database from the backend of your website (I advise entity framework its clean and easy) you can generally bind the list of objects directly do the grid that would represent your cart (I say grid but you can give it data template to look like html, not to be confused with regular tables). If you really get here I see no reason to keep coding for a school project in most places you can use all this to bachelor degree exam and pass with straight A. But if you want more details look into these videos they explain quite well what you want to do.
https://www.youtube.com/watch?v=s91pPLx_T3Q
https://www.youtube.com/watch?v=yYr0seXj7qA
https://www.youtube.com/watch?v=lFkXk5gHjSs
I am not great at JavaScript but I think your page would need to update a cookie then read that value from said cookie. I hope that's a good place to start!
You might also find "Creating a Shopping Cart using only HTML/JavaScript" helpful.

Why are static pages kept in a database for CMSes like Drupal or WordPress?

A bunch of work is done for static pages that will not contain dynamic data, such as, contact, about us, home, etc. that can be updated fairly easily if the designer/developer has access to a site. Why is it a better practice to keep that information in a database that must construct the data on the regular?
If one thinks in terms of templates and a website administrator who is a lay person, then the database format in Content Management System makes more sense, because all the person has to do, for example, in order to change contact details on the Contact page, or change some updates on the Homepage, is to go into the CMS. It will be set-up in a Form type of look, that only needs filling in and submitting. The initial cost for a small static website with a CMS setup will be higher of course. However, if your homepage needs regular updates, it might be worth having a CMS. If there are very little changes throughout the year, one may opt to hire designer/developer services.
Rather than best practices, I would see it as cost and demand.
Because putting the content in the database and dynamic generation a the pages for each requests solve a lot of other issues. Cache invalidation is a hard problem. A static site where every page is build with different pieces of content from multiple sources (in Drupal: blocks, users, nodes, taxonomy terms, etc.) is like a gigantic cache.
But if you don't need the flexibility and the features of the CMS (like letting nearly non-technical users edit pieces of content), then don't go with CMS.
"A bunch of work is done for static pages that will not contain dynamic data, such as, contact, about us, home, etc. that can be updated fairly easily if the designer/developer has access to a site. Why is it a better practice to keep that information in a database that must construct the data on the regular?"
There are probably 3-4 key points to consider here.
First, why do people use WordPress? In many cases it's because they aren't web developers themselves and they don't want to have to hire one every time their board of directors (say) changes. I have several clients in this category. By putting the content in the database and rendering it in a template, non-technical users can manage their own pages as well.
Second, consider how easy it is for someone like you to create several static pages and simply use WordPress to power the blog. There are no shortage of startups and small businesses (especially in the tech space) that do that. Use something like Wappaylzer to see what folks are using.
Third, it's not a best practice to keep static information in the database. That's why page caches exist (along with static asset and opcode caches... no one recommends recomputing things unnecessarily as a performance best practice)
Fourth, consider the implication of removing the ability to edit pages from users. Or requiring them to know HTML. And if we start dealing with revision management as well, they might also need to learn Git. I for one hate having to help clients solve problems that they really should be able to solve themselves. I'm much happier if they can manage the simple things on their own. They tend to be happier with their websites, and I tend to get more interesting projects... good all the way around.
In sum, it's not a best practice for some people. Which is why some people don't do it that way. It's not a best practice to return to the database for static assets either, which is why folks who are reasonably aware of caching don't do it that way. But it is a good practice, at least, to let folks have greater control over their websites. It comes at a cost, and it's not right for everyone. But it certainly is right for a lot of people.... and maybe a lot more than simply "right." I think you could go so far as to say it's empowering, and one of the best things about WordPress in general

Multi-user image editing

I'm pretty new to HTML5, and want to know if this is possible.
I want to be able to create a canvas in which I can load an image in it, and then draw on it for other people to see, and allow them to make changes to it as well.
It doesn't have to be super complicated with lots of different tools, just basic stuff. I just want to be able to change the image every now and again.
Is this possible, and if so, can someone point me towards a tutorial of some sort?
Do you already know how to do non-image collaboration?
The way you do collaborative editing of any medium is pretty much the same.
The main difference between one medium and the next is the content of the updates (DOM elements vs. paint events). The other big thing you'll run into has nothing to do with the medium, but whether you want to use AJAX or WebSockets or what have you - this is a question more about the method through which you accomplish the collaboration.
The essential concept is (from the user's perspective):
Submit my own changes
Check periodically via AJAX to see if anyone else has made changes, or use WebSockets/long polling to be notified immediately of changes from others
Update each person's view with the changes from other users
Figure out a way to resolve conflicts if two changes are incompatible, if this applies to your problem
Provide some way for users to "undo" things
Not to blow my own horn, but last year I wrote a collaborative scratch paper/brainstorming app called cortex, and I blogged about each commit and how I figured out how to do the realtime collaboration. I did it in Rails using an AJAX approach, but the concepts I used for real-time collaboration are applicable to most any app that wants to take a similar approach. This post includes a video simulating two users collaborating on the same page, and how soon/how often updates from one client are shown on the other client browswer.
cortex isn't the prettiest or most advanced thing in the world, but I think it's a good intro app to get the concepts down. It may not even be the best designed (it was my first collaboration app), but I use it nearly every day and it seems to work well enough.

Analyzing tones for a website

First of all, hello! I am new to... everything basically.
Is there a way to use any web coding (maybe HTML5?), to analyze the tones of a song, specifically a piano song, and give out some kind of code every time a specific tone, or a note is hit, which can then be further used for other stuff?
If not, do you know of any other methods of getting something like this done? I want a webpage to be able to analyze a song by the different notes, and then have something happen when the different notes are getting played.
I myself only picked up coding recently but now know html and php. I just thought I'd say that doing what you want is definitely not possible for someone that is new to everything. HTML is a markup language, it just organises everything on the page.
To achieve what you want you would need a lot of coding knowledge. Tone recognition is the kind of thing you see on extremely expensive production software such as cubase. I wish it were simple to do such a task as it would come in very handy for the site I have built. However it is not. If you are really set on this idea google something like tone recognition software although I doubt there will be anything suitable that can be easily implemented into a website.
My advice would be either spend a lot of time learning and mastering many front and backed coding platforms or spend a lot of money hiring someone to do it for you.
If you want to accomplish the same task but in a simpler but still intricate way I would scrap the notion of tone recognition. If you had an onscreen keyboard where each key was a form submit button you could then attach some PHP code to each key with an if(isset([''])) function. When a certain key is pressed something is outputted by the code or in PHP words echoed. This would require extensive knowledge of HTML, CSS, PHP and jquery. Probably some others thrown in their too.
You probably won't be able to execute that yourself but it is a much easier and viable approach if you want to get someone to do it for you.
Since you are new to coding world I would like to recommend you to do these free online courses from Udacity which is an awesome initiative from one of the top teachers of coding world to democratize education.
Udacity is a digital university on a mission to democratize education
Course material is excellent and you can follow subjects on your own pace and many other benefits for free and they will provide you with signed certificated too when you clear final exam of a subject.
I am not connected to Udacity in any way. :) I am myself following some courses even after I have a CS degree.
Now on to your answer your questions :
HTML is a markup language which displays structured data to webpage. It takes data input via forms and pass it on to the backend system and displays the data it receives from the backend system.
There are two major divisions of any website or webapplication :
1. Frontend
2. Backend
Frontend is what you see on the webpage and how you interact with the webpage.
Backend is actually responsible for providing data for frontend to display. Both of them are nothing without each other.
So what you are trying to achieve can be done on backend only but the input will be taken through HTML. Only HTML is not enough to do this. You need a powerful programming language to do this stuff on the backend.
I would like to tell you this project is very advanced and it takes years of programming experience (and CS degree too but its not mandatory if you are determined enough) to create such project. If its a business idea you better higher someone or some company in software and web development field to build this for you.
If you have any question then simple comment and ask me.
Welcome to the world of softwares and SO too. :)

web site development best practices, design or code by first?

I'm using an MVC framework to develop a web site, I've to care about the design in the sense of look and feel (views) and the code (models, controllers).
I don't know what is the best way to proceed:
code and design iteratively by small chunks?
design first ?
you've got the point
I suggest you design first - it can be a rough design with a pencil/paper but it will give you an idea of what information should go on the page in what manner. This will help you with your views and controller logic. Dont' worry too much about colours at this point.
I always feel it is better to do things iteratively. Design a page or two, construct the model and controller relative to that page, and repeat for other pages.
Sometimes if you spend too long in your models and controllers and neglect your views, you'll end up doing way more or way less than what you need.
The 37 Signals (the source or Ruby on Rails and some really cool web apps) book Getting Real advocates working from the interface down. It gives you a better sense of how the site will be used before you do too much back end implementation.
Here is the specific chapter: From ideas to implementation.
PS: Read the whole book, it's brief and a really good overall philosophy for building things the way they should be build. And no I am not affiliated with them in any way.
One small, but very good tip I got, was to work out what kind of 'friendly' URL's you would like to see in your site. This in turn leads you to what routes your require, which in turn gives you an idea of the controllers and actions you will have to create.
It depends but there are several rules of thumb:
the bigger the project the more it benefits from the design first, design well approach.
if there's inter-dependence between the elements of the project - such as lots of foreign keys in the database - you are better off at the very least designing everything around those inter-dependencies, or you're gonna regret it later
MVC frameworks enforce some design decisions by their very nature, so use that to help you
beyond a certain size - say more than a week's work - it's an absolute necessity. Same goes if it's a team effort
In your particular case, since I'm not sure about the project size, I'd suggest having your schema designed ahead based on your needs, which will tell you about dependencies, and then do the iterative thing, starting with the dependencies.
If you have specific APIs you have in mind, it's a good idea to design around those as well
The beauty of MVC frameworks is it simply does not matter.
Obviously you'll need some vision to work to, but it's up to yourself. I'm a strong believer in iterative development. In this case you'd create a section of the site, views, models and so forth. Once that was working, move to the next section/feature of the site.
The both ways are OK but it would be better if you have a designed view (even a mock up) so you can know what data to get how to format it when you develop you model and controllers
My suggestion which will save you a lot of time and headache is start off with design.
You have two designs here. One is the UI (interface) design. All the visuals etc.
When you have a UI design you will know how to create your mark-up from the get go without having to do the work twice after you've completed a design.
The other is the software design. the MVC framework helps a lot with this but you also don't want to just start coding without having a plan. You'll find yourself back tracking a lot and recoding stuff you've already done that way.
An iterative approach is the way to go. I might suggest spending time on the model and getting it solidified first. Then, iterate through your controllers and views. This will help validate what you've done in the model, and bring up any glaring issues that need to be addressed sooner vs. later.
I, as most here would say design (at least to a extent) first.
I would wireframe interactions (these can, and should be be refined later) and, perhaps most important, (at least if it's a traditional web site you're working on) plan the architecture, map the structure of the site you're working on (the Information Architecture part). In order to get an overview of the site and know map out user paths through the content.
That's at least my 'modus operandi' for web sites if I'm working alone on them.
(I mostly work in a UX team so my professional workflow is more in the design part than production coding nowadays)
Understanding the Requirements
Database Design
User Interface Design
Business Logic Design
From my experience I would say you should always plan first. (I even plan my planning phase).
I assume you’re doing something like a GUI wired up via .aspx using the MVC model, maybe even the Entity Framework?
Web development like this can very easily get complicated once you start to build it up.
It is important that before you do anything you know exactly what it is that you are trying to do, this way you know when you are undershooting or overshooting your goals and whether or not the code you are writing actually fulfils the requirements.
There are many models which you can base your project development on, all of which loosely follow a sensible System Development Life Cycle in one way or another.
If you haven’t read up on the different development methodologies, here’s a site that will give you a good overview : http://www.itinfo.am/eng/software-development-methodologies/