Bad to hear about your ambience in you're company, but stay professional!
Disclaimer: I do not always follow directly what's written bellow, because every case is different and not everything always apply. And sometimes you're bosses do not follow common sense :) Sometimes it's just quick call (actually it's always should be face-to-face call-first )
This is my perfect way to leave smoothly, if I am forced to do so. This works well when you don't have to start new job immediately.
1. Find out when next stage of project you're involved in ends: for example new release, working feature etc. In case it's not specified directly or job is done "very" agile - other convenient date for company and your colleagues/boss. It doesn't have to be far away, month or two is max (also have to be compatible with agreement, of course), but make sure it would be sufficient for you to close your major planned tasks and share knowledge with others. Don't talk about this with anyone you're working with.
2. Grab a coffee with your direct manager (or if it's start-up the CEO or other guy you report to) and have a talk about what you have done for project/company, what was good and what was not so great. Being honest (but nice!) is professional, because it gives company opportunity to fix things. I always tell what I learned in the place. Second step is telling that current opportunities and challenges does not seem so bright as when you started. Make clear that you're expecting to change job, if they cannot fulfill what you expect. Don't focus on money/benefits, but highlight what your work gives a company. Normally, after that this guy will talk with management or ask for few days to think about this. This is perfectly okay - go back to your things and act normally. Soon someone (probably same guy or his boss will offer your (if you're valuble) or tell you that's okay (if not so great). In both case make sure that they know about your conclusions from point and ask them if it's okay. They probably agree if you sound reasonable (in other case go you're way anyway, if it's legally okay)
3. Then it's your turn to take some time. Close the deal with new company and say aloud your decision. I think that all-team (with boss) stand-up is best time. Avoid informing some folks you like and other not, or other half-clear solutions. Again, share your thoughts from point 1 and ask if it works for your colleagues and how can you help them to smoothly take over your responsibilities and all howtos.
4. Do your job as always + share everything you know and do with as many connected with you guys as it's possible.
5. In last week invite whoever your want for a beer or buy some pizzas to the office. Or make a cake. Just have few hours for informal meeting with those great folks you worked with. Connect with all of them on the linked-in or exchange non-enterprise emails' addresses. I do not connect with colleagues (even ex) on private social medias, but it' s good to have way to reach them.
6. Do not hold personal conflicts or allow them to reflect your relations with not involved. Someday, that other silent junior you loved to work with will be hiring for his startup :)
Good luck!