Giter Site home page Giter Site logo

classroom-wars / back-end Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 5.0 275 KB

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

Ruby 93.22% JavaScript 1.06% CSS 0.65% HTML 5.08%
continuous-integration travis-ci heroku heroku-deployment rails ruby api api-rest crud sinatra mvc oop tdd

back-end's Issues

Setup Travis CI

Go to https://travis-ci.org/ and set up the account, if you haven’t already before.

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.

Create Classroom War Functionality

On the "Create Classroom War" Page,

When I click "Search", we

  • search through the DB to compare name or district email
  • results are returned below

When I click "Start a New War"

  • the classroom war is added to the ongoing wars section

Navigation

  • a button to return to my teacher home page ('/dashboard')
  • a button to return to a course's show page ('/courses/:id')

Student Registration - BE Response

If FE requests a REGISTRATION (aka new user to database)
Our Student API controller will use a model method which adds them to our database

Please remember to code for the sad path.

Student Course Update/Delete - BE Response

When FE requests course update

###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.

Teacher - Course Page

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

Teacher - Course Roster Functionality - Card 3

As a teacher,
when I visit '/course/{id}/roster'

I see a form to add students by their name and email
When I fill in one student’s name and/or email, and I click on submit

  • I see a flash notice that the student has successfully been added
  • And I see the name of that student added to my current classroom.

Teacher - Course Roster Functionality - Card 1

As a teacher,
when I visit '/course/{id}/roster'

I see a button to go to this Course’s Show Page

  • When I click on this button I am taken to the Teacher's Course Show Page that we are currently working on.

Teacher Dashboard - BE Response

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)

Please remember to code for the sad path.

Teacher - Course Page Functionality (Extension)

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'

Presentation

Craft presentation for our project that will include:

  • Group Member Intros
  • Explanation of the app
  • Video of the app working in production
  • Brief explanation of the app's architecture
  • Challenges we encountered and how we overcame them
  • Plans for future iterations

Teacher - POM Favorites Functionality

As a teacher user,
when I visit
when I visit '/poms/favorites'
I can see...

A button to remove a favorited pom from the POM Favorites.

  • When I click this button, the POM is no longer visible on my list.

Deploy to Heroku

In addition to the normal deployment, we will also need to manually set up any API keys for the Heroku production environment.

Teacher Course Create/Read - BE Response

When FE requests course show

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.

Teacher Course Update/Delete - BE Response

When FE requests course update

###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.

Student Course Create/Read - BE Response

When FE requests course show

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

Please remember to design your sad path.

Classroom War - Show Page Functionality

As a teacher, when I visit a classroom war's show page, I should see:

  • a button to return to my teacher home page ('/dashboard')
  • a button to return to a course's show page ('/courses/:id')

Teacher Registration - BE Response

If FE requests a REGISTRATION (aka new user to database)
Our Teacher API controller will use a model method which adds them to our database

Please remember to code for the sad path.

Login/Logout - BE Response

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

Please remember to code for the sad path.

Teachers’s Favorite - Backend

  • As a teacher, on my teacher’s dashboard I click one of the favorite buttons on my List of Most Recent Poms
  • 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
  • On this page I see all my favorited POMS

Student Dashboard - BE Response

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

Please remember to code for the sad path.

Student - Course Page Functionality

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'

Users - Dashboard Functionality (Extension)

Extension:

As a user
When I login or visit '/dashboard'
I can see...

Settings button in top right corner

  • When I click the setting button, I'm redirected to '/settings'

Customize Background Button

  • When I click the button, I see a display that allows me to customize background (default backgrounds, add picture, etc.)

Teacher - Course Page Functionality

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

Teacher - Prizes Functionality

View - https://github.com/orgs/Classroom-Wars/projects/1#card-48347933

When on the 'Class Prizes' View page,

When I Add a Prize

  • It is added to the prizes table
  • It is saved as "status: active" and moved to the "Active Class Prizes" section

When I click to 'Deactivate' a prize

  • the status within the DB is changed to "inactive"
  • It is moved to the "Prize Pool" and out of the "Active Class Prizes"

When I click to 'Activate' a prize

  • [ ] the status within the DB is changed to "active"
  • It is moved to the "Active Class Prizes" and out of the "Prize Pool"

Navigation

  • a button to return to my teacher home page ('/dashboard')
  • a button to return to a course's show page ('/courses/:id')

Student - Course Page Functionality (Extension)

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'

Users - Settings Functionality (Extension)

As a user,

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.