W06 Assignment: Additional Feature
Overview
For this assignment you will add a new feature to your site that will require everything you have learned so far during the course.
New Features
For this assignment you will add the ability for a user to volunteer for service projects they are interested in.
You will implement the following new features:
- On the service project details page, add a link for users to volunteer for the project.
- A user must be logged in to see the volunteer link.
- On the dashboard page, display a list of projects for which the user has signed up to be a volunteer.
- Allow users to remove themselves as volunteers from projects on their dashboard.
Instructions
Follow these steps to complete the assignment:
- Update your database schema to include a new table to track which users have volunteered for which projects.
- Users should be able to volunteer for more than one project and projects should be able to have multiple volunteers.
- Remember to update your setup.sql file to include this new table.
- Create the necessary model functions to add and remove volunteers from projects, as well as to retrieve the list of projects a user has volunteered for.
- Update the project details view to include a volunteer link that only appears if the user is logged in.
- When a logged-in user clicks the volunteer link, they should be added as a volunteer for that project.
- If the user has selected to volunteer for the project, the link should change to indicate that they are now a volunteer (For example, "You are volunteering for this project"). Then there should be a link to remove themselves as a volunteer.
- When a user clicks the link to remove themselves as a volunteer, they should be removed as a volunteer for that project.
- If a user is not logged in, they should not see any volunteer functionality.
- Ensure that the the routes for adding and removing volunteering projects are protected by middleware and only accessible to logged-in users.
- On the dashboard page, show a list of all the projects that the user has signed up to volunteer for. Next to each project, provide an option to remove themselves as a volunteer.
- Test all new functionality thoroughly to ensure it works as expected.
Requirements
Your assignment must implement the following requirements:
- Database: The database schema includes a new table to track which users have volunteered for which projects, supporting many-to-many relationships between users and projects.
- Model Functions: The model includes functions to add and remove volunteers from projects, as well as to retrieve the list of projects a user has volunteered for.
- Project Details: Volunteer Functionality: For logged-in users, the project details page contains links to volunteer or remove volunteering as appropriate. Working route and controller functions exist to implement this functionality.
- Dashboard: Volunteer List: The dashboard page displays the list of projects the user has volunteered for, along with options to remove themselves from each project.
- Code Organization and Standards: Files and functions follow the patterns provided in the learning activities of the previous weeks. All code standards are followed.
- Deployment and Professional style: The application is deployed and looks professional.
Score
Your assignment will receive a score according to the following criteria:
- Mastery (100%): All requirements are met at the Mastery level.
- Sufficient (85%): All requirements are met at the Sufficient or Mastery level.
- Incomplete (0%): One more more requirements is not at the sufficient level.
If your assignment is graded as Incomplete, you should fix any issues and resubmit.
Submission
When you have finished this assignment:
- Return to Canvas to submit your assignment.
- You will submit both your GitHub repo URL and the URL of your hosted site (at Render).
Other Links:
- Return to: Week Overview | Course Home