This is the main backend part of a large group project we were tasked with in Module 3 at Turing School of Software & Design. The main project is meant to all the consuming of several API endpoints, integration with Sinatra and Travis CI as well as deploying to Heroku
As a student user,
When I visit '/dashboard'
and click on a specific courses link
I should be taken to that courses show page '/courses/{course_id}'
where I see....
A button to 'Redeem' next to each specific prize
When I click 'Redeem,' I receive a notification that says 'Congratulations on your prize! Please contact your teacher to discuss the retrieval of your prize'
A 'Classroom Wars' section that shows all of the classrooms that your classroom is competing against along with each classes total points
Each classroom is a link to the Classroom Wars show page
When I click a Classroom Wars link, I'm taken to '/profile/wars/:id'
As a teacher, when I click on a classroom link from my profile page, I am redirected to that classroom's show page, and I see the following:
'#{classroom.name} Dashboard'
an 'Individual Class Leaderboard' section
a 'Class Total' section that displays the total point count
a Choose POM section,
that includes a blank field next to the following options: either select a random POM, or select a random pom from 'favorites'. Once chosen, there is a 'POM Break' button to be clicked. Once clicking that button, the selected pom gets added to the 'Pom Section'
the 'POM Section' is a list of the 20 most recent poms used. Each pom name is a link, and each listed pom has the option to 'favorite' it. When favorited, a flash message appears notifying the teacher that they've added that pom to their favorites list. Lastly, there is a button for 'Favorite POMS', and once clicked, they are redirected to the favorite poms index page
a 'Prizes' section, that lists available prizes, along with how many points those prizes cost. There is also a button to 'Add a New Prize'
a 'Classroom Wars' section, that lists each classroom, and how many points that class currently has
BE exposes api endpoint for individual course information
BE course data should include name, course-code (see below), and whatever else belongs to a course (maybe course length)
When FE requests course create
BE POSTS to StudentCourses Model
BE will need to verify by the course code and then create the association in that JOINS table
Add the project to your repositories. You can do this from the main dashboard page by clicking the plus button next to My Repositories.
Configure your API keys that are environment variables for the travis environment. You can find configuration for environment variables by selecting your repository from the Travis dashboard and clicking More Options -> Settings. Configure deployment to Heroku by filling in the api_key and app variables in the .travis.yml file.
You can test that your Travis set up is working by pushing a commit to your repository. You should see a build triggered by the Travis dashboard. When the build is complete, you should see the change automatically deployed to Heroku.
Needs a create action in API controller for student and teacher that calls method described below
Needs a model method for student and teacher that either confirms they are in the database or adds them to the database
When I visit '/dashboard'
And I click the settings button in top right corner
I'm taken to settings ('/settings')
where I can...
Click 'Change Name' or 'Change Password'
When button is clicked change name or password, a text field appears along with a 'Submit Changes' button. When that button is clicked, I see a flash message that changes have been saved.
I also see....
A link under a profile picture to change avatar
When I click the link, I am able to choose a new avatar. When I choose a new avatar, it will be updated immediately.
Dione>>>> Since we are using OAuth there will be no password option.
When FE requests (student user) /dashboard
BE responds with exposed api endpoint for student information (seems like a show)
BE responds with exposed api endpoint for student courses (this comes from joins, how will you expose this endpoint?)
When FE requests (student user) "New Course"
BE routes to Student API controller to update Student model (and joins) with more course codes
###update
BE exposes api endpoint for individual course information
If unenrolling - we delete the association between the student and this course in our StudentCourse joins table.
delete
When FE requests course delete
BE DESTROY to Course Model
the Joins table relationship should no longer exists in the database.
Please remember to test and code for the sad path.
As a teacher,
When I visit '/dashboard'
and click on a specific courses link
I should be taken to that courses show page '/courses/{course_id}'
where I see....
A 'List of Most Recent Poms' section that displays the last 3 POM descriptions/links
Within 'List of Most Recent Poms, I see..
A button to 'Favorite POM' next to each POM
When I click the button, the POM is added to a favorite poms list
and I see a flash message confirming that the POM was added
A button to visit 'Favorite POMS'
When I click the button I'm taken to '/poms/favorites'
A 'List of Last 20 POMs' button
When I click the button, I'm taken the 'Most Recent POM Breaks' page '/poms/recent'
As a student user,
When I visit '/dashboard'
and click on a specific courses link
I should be taken to that courses show page '/courses/{course_id}'
where I see....
A 'List of Most Recent Poms' section that displays the last 3 POM descriptions/links
Within 'List of Most Recent Poms, I see..
A button to 'Favorite POM' next to each POM
When I click the button, the POM is added to a favorite poms list
and I see a flash message confirming that the POM was added
A button to visit 'Favorite POMS'
When I click the button I'm taken to '/poms/favorites'
A 'List of Last 20 POMs' button
When I click the button, I'm taken the 'Most Recent POM Breaks' page '/poms/recent'
When FE requests (teacher user) /dashboard
BE responds with exposed api endpoint for teacher information (seems like a show)
BE responds with exposed api endpoint for teacher courses (this comes from joins, how will you expose this endpoint?)
When FE requests (teacher user) "Add a new Course"
BE routes to Teacher API controller to update Teacher model (and joins) with more course codes
BE Teacher model (maybe this is a Course model actually) has a method which allows for autogeneration of an alphanumeric 8 digit code (research callbacks on rails for how to before_create)
When I visit a courses show page ('/courses/:id), the 'Select a POM' section needs to have field tags where a teacher can check either 'select a random pom', or 'select a random pom from favorites'
they should not be able to select both
to make an API call and receive a pom, the fields can not be left blank
the 'POM Break' button should be able to be clicked, and once it has, the random pom should be added to the 'POM' section below
BE exposes api endpoint for individual course information
BE course data should include name, course-code (see below), and whatever else belongs to a course (maybe course length)
BE course data (for teachers) should list all students in course
When FE requests course create
BE POSTS to Course Model
BE course-code generation (lives on Course model, auto generates random alphanumeric 8 digit and is linked to course creation - research callback in rails for before_create)
Please remember to test and code for the sad path.
###update
BE exposes api endpoint for individual course information
BE course data should include name, course-code (see below), and whatever else belongs to a course (maybe course length)
BE course data (for teachers) should list all students in course
BE sends a response to update that information in our database.
delete
When FE requests course delete
BE POSTS to Course Model
It should no longer exists in the database.
Please remember to test and code for the sad path.