I really don't want to be in a situation where the people who are doing less stuff and are less invested than me are more rewarded. What should I do to be sure my work and efforts are noticed?
Those are two completely different things, so step one: stop conflating them.
I really don't want to be in a situation where the people who are doing less stuff and are less invested than me are more rewarded.
No one wants to be in that situation. Everyone is in that situation. So step two: Get used to it, and stop caring. The question that should be on your mind is not "do my undeserving no good slacker coworkers deserve their bonuses?" The question on your mind should be "am I getting an adequate compensation for the amount of work I'm putting in?" The answers to those two questions have nothing to do with each other.
Put another way: the only way to control what bonuses your slacker coworkers get is to sabotage and badmouth them. Do you want to work at a company that encourages that kind of behaviour? Worry about what you're getting, not what anyone else is getting. Make yourself look good by enabling everyone around you to share in your success.
I'm not really good at communicating and asserting myself
Step three: get better at both. Once you are past entry level, software engineering is about communication, not writing code. You will not rise in your profession until you are able to communicate clearly with everyone in the organization.
Write more emails. Write more design documents. Write a blog. Answer questions on StackOverflow. Volunteer to give talks internally or to the public. There are lots of ways to practice communications.
What should I do to be sure my work and efforts are noticed?
Start at the technical level. Are your tasks tracked in a change management system? Are your code changes tracked in a source code management system? If not, you have bigger problems than recognition. If they are, then you can use these as the basis of a weekly report on what you've accomplished this week and what you plan to accomplish next week.
Do you have code reviews? If not, again, you have bigger problems; start encouraging a culture of code reviews. Code reviews are a great way to showcase your work to your management and peers.
Do you have status meetings? Talk about what you've done in those meetings, where you're stuck, and how you can help other people get themselves unstuck. Do you have skip-level meetings with management? If not, start taking your manager's manager out to lunch a few times a year. Ask them if you are on track for your career goals, and if not, what you can do to improve. This effort will be noticed.