vote_widget's People
vote_widget's Issues
write query to get the most favorite movie of users
write unit test for API endpoints
build view to display vote result and statistics
Requirements
- what I'd chosen.
- vote percentage of each movies
- it should be keep up to date without refresh
API Specification
This issue is proposal about API specifications.
API
This describes the resources that make up vote widget API v1
Table of Contents
1. Common
Protocol
All API must have to access is over HTTPS.
also, All data is sent and recieved as JSON
Most of API methods take optional parameters
For GET requests, any parameters not specificed as a segment in the path
can be passed as an HTTP query string parameter
For POST, PATCH, PUT and DELETE requests, parameters not included in the URL
should be encoded as JSON with a Content-Type of "application/json"
Version
By default, all requests receive the v1 version of the API.
You can request specific version via 'Accept' field on the request header
Accept: application/vnd.votewidget.v1+json
Currently, These versions are available.
- application/vnd.votewidget.v1+json
Cross Origin Resource Sharing
The API supports Cross Origin Resource Sharing (CORS) for AJAX requests
from any origin.
Client Errors
There are three possible types of client errors
on API calls that receive request body
-
Sending invalid JSON will result in a
400 Bad Request
response
with message{ "message": "Problems parsing JSON" }
-
Sending invalid fields will result in a
422 Unprocessable Entity
response
with message and errors{ "message": "Invalid parameter", "errors": [ { "resource": "Like", "field": "movieId", "code": "missing_field" } ] }
All error objects have resource and field properties so that your client
can tell what the problem is.
There's also an error code to let you know what is wrong with the field.
These are the possible validation error codesCode Description not_exist This means a resource does not exist missing_field This means a required field on aresource has not been set invalid This means the formatting of a field is invalid Most of errors will provide a message field describing the error
Movie
the Movie APIs provide access to movie information, vote, and vote results
List all movies
GET /movies
Parameters
Name | Type | Description | min | max | default |
---|---|---|---|---|---|
offset | unsigned | skip offset items |
0 | 0 | |
limit | unsigned | get limit items |
1 | 100 | 30 |
Response
{
"movies": [
{
"id": 1,
"title": "Sample A",
"director_name": "Sample A's Director",
"summary": "This is summary of Sample A"
},
{
"id": 2,
"title": "Sample B",
"director_name": "Sample B's Director",
"summary": "This is summary of Sample B"
}
],
offset: 0,
limit: 2,
total: 3,
}
Name | Type | Description |
---|---|---|
movies | array | Retrieved movie informations |
total | unsigned | Total number of stored movie informations |
id | unsigned | The key value of movie information |
title | string | Title of movie |
director_name | string | Director of movie |
summary | string | Summary of movie |
Vote a movie
PUT /movies/:movie/votes
Parameters
Name | Type | Description |
---|---|---|
movie | unsigned | Required key value of specific Movie |
name | string | Required Username (at least two-character) |
Response
{
"title": "Sample A",
"votes": 3383
}
Name | Type | Description |
---|---|---|
title | string | Title of movie |
votes | unsigned | Number of votes |
Get vote result
GET /movies/:movie/votes
Parameters
Name | Type | Description |
---|---|---|
movie | unsigned | Required key value of specific Movie |
Response
{
"title": "Sample A",
"votes": 3383
}
Name | Type | Description |
---|---|---|
title | string | Title of movie |
votes | unsigned | Number of votes |
write query to show up title and number of peoples who like that movie for every records of Movies table
build view to vote movies
Requirements
- Showing 3 Movies and their information (title, director name, summary)
- User can vote in realtime
- User can choose among of them
- When User select a movie, It should be stored in Users table
- When User select a movie, It should be show vote results
build endpoint to save users favorite movie
create 'Movies' table and insert records
id : PK
title : 영화 제목
director_name : 감독 이름
summary : 영화 줄거리
위 구조를 갖는 테이블을 생성하고 임의로 레코드를 3개 추가하는 쿼리 작성
build endpoint to get movie information
write webpack configure
use optimization plugins to reduce bundle output size
write unit test for each views
create 'Users' table and insert records
id : PK
name : 사용자 이름
movie_id : FK (Movies.id)
위 구조를 갖는 테이블을 생성하고 임의의 레코드를 추가
prepare server-side rendering
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.