{"action":"closed","number":71,"pull_request":{"url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71","id":116040036,"html_url":"https://github.com/bounswe/bounswe2017group3/pull/71","diff_url":"https://github.com/bounswe/bounswe2017group3/pull/71.diff","patch_url":"https://github.com/bounswe/bounswe2017group3/pull/71.patch","issue_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/71","number":71,"state":"closed","locked":false,"title":"Initial configuration for our events application and basic user endpoints","user":{"login":"smddzcy","id":13895224,"avatar_url":"https://avatars0.githubusercontent.com/u/13895224?v=3","gravatar_id":"","url":"https://api.github.com/users/smddzcy","html_url":"https://github.com/smddzcy","followers_url":"https://api.github.com/users/smddzcy/followers","following_url":"https://api.github.com/users/smddzcy/following{/other_user}","gists_url":"https://api.github.com/users/smddzcy/gists{/gist_id}","starred_url":"https://api.github.com/users/smddzcy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smddzcy/subscriptions","organizations_url":"https://api.github.com/users/smddzcy/orgs","repos_url":"https://api.github.com/users/smddzcy/repos","events_url":"https://api.github.com/users/smddzcy/events{/privacy}","received_events_url":"https://api.github.com/users/smddzcy/received_events","type":"User","site_admin":false},"body":"## About\r\n\r\n* **Related Issues:** https://github.com/bounswe/bounswe2017group3/issues/62\r\n* **Other Related Links:**\r\n  - Spring documentation: https://docs.spring.io/spring/docs/current/spring-framework-reference/html/\r\n  - PostgreSQL documentation: https://www.postgresql.org/docs/\r\n  - LiquiBase documentation: http://www.liquibase.org/documentation/index.html\r\n  - Writing tests for Spring applications: http://www.lucassaldanha.com/unit-and-integration-tests-in-spring-boot/\r\n  - What is Heroku?: https://www.heroku.com/what\r\n  - What is a database migration?: http://www.iheavy.com/2011/06/15/database-migration-what-is-it-and-why-is-it-important/\r\n\r\nSomeone had to do the heavy work and create an application from scratch. I've created and configured our events application REST API using **Spring** framework (which we've agreed on), configured our deployment environment using **Heroku**, configured our database using **PostgreSQL** and **LiquiBase** and created the basic user endpoints which are `GET /user` and `POST /user`. I think it'll be easier for others to continue since they now have a code example.\r\n\r\nCurrently, tests and documentation of our API are missing. I think we can finish them after creating a skeleton application which works as expected 😄\r\n\r\nAlso, note that after adding the `Event` model, we have to implement a many-to-one dependency between `User` and `Event`s 👍 \r\n\r\n### Changes\r\n\r\n- Created a basic Spring Boot application.\r\n- Made the necessary configurations in the application to run it as a REST API instead of a full MVC application.\r\n- Configured our deployment environment in Heroku. **You can see our application live on https://bounswe2017group3.herokuapp.com/.**\r\n- Decided to use PostgreSQL as our database and made its configurations.\r\n- Decided to use LiquiBase for the database migrations and made the first migration to create a `User` model. I strongly suggest you to check out the documentation of LiquiBase from here: http://www.liquibase.org/documentation/index.html . If you don't know what a database migration is, please read this too: http://www.iheavy.com/2011/06/15/database-migration-what-is-it-and-why-is-it-important/\r\n- Configured our Spring application so that adding `@ResponseBody` annotation to a method makes it return JSON. Example:\r\n```java\r\n@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\r\n    public @ResponseBody List<User> user(ModelMap model) {\r\n        return repository.findAll();\r\n    }\r\n```\r\n- Created 2 endpoints for `User`:\r\n  - `GET /user`: Returns all the users in an array.\r\n  - `POST /user`: Creates a user from the given form data parameters.\r\n- Implemented a basic encryption method to store (it's implicitly done in the `User` class) and check (by `checkPassword` method on `User`) user passwords safely.\r\n\r\n## Visuals\r\n\r\nFields and methods of `User` model:\r\n<img width=\"561\" alt=\"screen shot 2017-04-16 at 00 27 00\" src=\"https://cloud.githubusercontent.com/assets/13895224/25066876/75148ff0-223b-11e7-8312-78523e943d02.png\">\r\n\r\nExample queries made on Postman:\r\n![screen shot 2017-04-15 at 23 08 36](https://cloud.githubusercontent.com/assets/13895224/25066843/bc18e49c-223a-11e7-962a-f2085d722ed0.png)\r\n![screen shot 2017-04-15 at 23 08 39](https://cloud.githubusercontent.com/assets/13895224/25066844/bc1ddb82-223a-11e7-99ed-f9b1a532967f.png)\r\n\r\n## Testing\r\n\r\n- To test `GET /user` endpoint:\r\n  1. Go to `https://bounswe2017group3.herokuapp.com/user` URL in your browser or send a `GET` request by a tool like Postman.  \r\n  2. Server should respond with the `application/json;charset=UTF-8` content type. <img width=\"338\" alt=\"screen shot 2017-04-16 at 00 33 04\" src=\"https://cloud.githubusercontent.com/assets/13895224/25066915/83583d7c-223c-11e7-95f9-803ac82d37bd.png\">  \r\n  3. Server should render a JSON array which contains the current users in our database.  \r\n- To test `POST /user` endpoint:\r\n  1. Send a `POST` request to `https://bounswe2017group3.herokuapp.com/user` endpoint with a valid set of user parameters. An example query should look something like this: <img width=\"986\" alt=\"screen shot 2017-04-16 at 00 35 23\" src=\"https://cloud.githubusercontent.com/assets/13895224/25066950/4e6eb702-223d-11e7-9cf5-abed75cfe402.png\">  \r\n  2. Server should respond with the `application/json;charset=UTF-8` content type.  \r\n  3. Server should not give any errors and render the newly created user object in the JSON format.\r\n    - If you also want to test our database, send a `GET` request to `https://bounswe2017group3.herokuapp.com/user` endpoint after creating the user. It should render the newly created user in the array.\r\n","created_at":"2017-04-15T21:43:37Z","updated_at":"2017-04-17T19:11:31Z","closed_at":"2017-04-17T19:11:31Z","merged_at":"2017-04-17T19:11:31Z","merge_commit_sha":"71f0496e764ca42f6938be2a1978ebd99268aea9","assignee":{"login":"esra-aydemir","id":9717121,"avatar_url":"https://avatars1.githubusercontent.com/u/9717121?v=3","gravatar_id":"","url":"https://api.github.com/users/esra-aydemir","html_url":"https://github.com/esra-aydemir","followers_url":"https://api.github.com/users/esra-aydemir/followers","following_url":"https://api.github.com/users/esra-aydemir/following{/other_user}","gists_url":"https://api.github.com/users/esra-aydemir/gists{/gist_id}","starred_url":"https://api.github.com/users/esra-aydemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esra-aydemir/subscriptions","organizations_url":"https://api.github.com/users/esra-aydemir/orgs","repos_url":"https://api.github.com/users/esra-aydemir/repos","events_url":"https://api.github.com/users/esra-aydemir/events{/privacy}","received_events_url":"https://api.github.com/users/esra-aydemir/received_events","type":"User","site_admin":false},"assignees":[{"login":"esra-aydemir","id":9717121,"avatar_url":"https://avatars1.githubusercontent.com/u/9717121?v=3","gravatar_id":"","url":"https://api.github.com/users/esra-aydemir","html_url":"https://github.com/esra-aydemir","followers_url":"https://api.github.com/users/esra-aydemir/followers","following_url":"https://api.github.com/users/esra-aydemir/following{/other_user}","gists_url":"https://api.github.com/users/esra-aydemir/gists{/gist_id}","starred_url":"https://api.github.com/users/esra-aydemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esra-aydemir/subscriptions","organizations_url":"https://api.github.com/users/esra-aydemir/orgs","repos_url":"https://api.github.com/users/esra-aydemir/repos","events_url":"https://api.github.com/users/esra-aydemir/events{/privacy}","received_events_url":"https://api.github.com/users/esra-aydemir/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71/commits","review_comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71/comments","review_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/71/comments","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/810d7b2764dcf703fefd29209d21c1f967c14177","head":{"label":"bounswe:feature/initial-app-config-and-basic-user-endpoints","ref":"feature/initial-app-config-and-basic-user-endpoints","sha":"810d7b2764dcf703fefd29209d21c1f967c14177","user":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":81464391,"name":"bounswe2017group3","full_name":"bounswe/bounswe2017group3","owner":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bounswe/bounswe2017group3","description":"This is a course project repository for the courses CmpE352/451 at Boğaziçi University.","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2017group3","forks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2017group3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2017group3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2017group3/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2017group3/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2017group3/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2017group3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2017group3/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2017group3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2017group3/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2017group3/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2017group3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2017group3/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2017group3/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/deployments","created_at":"2017-02-09T15:26:53Z","updated_at":"2017-04-08T19:02:40Z","pushed_at":"2017-04-17T19:11:31Z","git_url":"git://github.com/bounswe/bounswe2017group3.git","ssh_url":"git@github.com:bounswe/bounswe2017group3.git","clone_url":"https://github.com/bounswe/bounswe2017group3.git","svn_url":"https://github.com/bounswe/bounswe2017group3","homepage":"","size":361,"stargazers_count":7,"watchers_count":7,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":7,"default_branch":"master"}},"base":{"label":"bounswe:master","ref":"master","sha":"35c2a90a06153fd2467af6d610069fb3a9781801","user":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"repo":{"id":81464391,"name":"bounswe2017group3","full_name":"bounswe/bounswe2017group3","owner":{"login":"bounswe","id":12229719,"avatar_url":"https://avatars3.githubusercontent.com/u/12229719?v=3","gravatar_id":"","url":"https://api.github.com/users/bounswe","html_url":"https://github.com/bounswe","followers_url":"https://api.github.com/users/bounswe/followers","following_url":"https://api.github.com/users/bounswe/following{/other_user}","gists_url":"https://api.github.com/users/bounswe/gists{/gist_id}","starred_url":"https://api.github.com/users/bounswe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bounswe/subscriptions","organizations_url":"https://api.github.com/users/bounswe/orgs","repos_url":"https://api.github.com/users/bounswe/repos","events_url":"https://api.github.com/users/bounswe/events{/privacy}","received_events_url":"https://api.github.com/users/bounswe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bounswe/bounswe2017group3","description":"This is a course project repository for the courses CmpE352/451 at Boğaziçi University.","fork":false,"url":"https://api.github.com/repos/bounswe/bounswe2017group3","forks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/forks","keys_url":"https://api.github.com/repos/bounswe/bounswe2017group3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bounswe/bounswe2017group3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bounswe/bounswe2017group3/teams","hooks_url":"https://api.github.com/repos/bounswe/bounswe2017group3/hooks","issue_events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/events{/number}","events_url":"https://api.github.com/repos/bounswe/bounswe2017group3/events","assignees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/assignees{/user}","branches_url":"https://api.github.com/repos/bounswe/bounswe2017group3/branches{/branch}","tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/tags","blobs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/refs{/sha}","trees_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/{sha}","languages_url":"https://api.github.com/repos/bounswe/bounswe2017group3/languages","stargazers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/stargazers","contributors_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contributors","subscribers_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscribers","subscription_url":"https://api.github.com/repos/bounswe/bounswe2017group3/subscription","commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/commits{/sha}","git_commits_url":"https://api.github.com/repos/bounswe/bounswe2017group3/git/commits{/sha}","comments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/comments{/number}","issue_comment_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/comments{/number}","contents_url":"https://api.github.com/repos/bounswe/bounswe2017group3/contents/{+path}","compare_url":"https://api.github.com/repos/bounswe/bounswe2017group3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bounswe/bounswe2017group3/merges","archive_url":"https://api.github.com/repos/bounswe/bounswe2017group3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bounswe/bounswe2017group3/downloads","issues_url":"https://api.github.com/repos/bounswe/bounswe2017group3/issues{/number}","pulls_url":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls{/number}","milestones_url":"https://api.github.com/repos/bounswe/bounswe2017group3/milestones{/number}","notifications_url":"https://api.github.com/repos/bounswe/bounswe2017group3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bounswe/bounswe2017group3/labels{/name}","releases_url":"https://api.github.com/repos/bounswe/bounswe2017group3/releases{/id}","deployments_url":"https://api.github.com/repos/bounswe/bounswe2017group3/deployments","created_at":"2017-02-09T15:26:53Z","updated_at":"2017-04-08T19:02:40Z","pushed_at":"2017-04-17T19:11:31Z","git_url":"git://github.com/bounswe/bounswe2017group3.git","ssh_url":"git@github.com:bounswe/bounswe2017group3.git","clone_url":"https://github.com/bounswe/bounswe2017group3.git","svn_url":"https://github.com/bounswe/bounswe2017group3","homepage":"","size":361,"stargazers_count":7,"watchers_count":7,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71"},"html":{"href":"https://github.com/bounswe/bounswe2017group3/pull/71"},"issue":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/71"},"comments":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/bounswe/bounswe2017group3/statuses/810d7b2764dcf703fefd29209d21c1f967c14177"}},"merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"gokceuludogan","id":9639399,"avatar_url":"https://avatars0.githubusercontent.com/u/9639399?v=3","gravatar_id":"","url":"https://api.github.com/users/gokceuludogan","html_url":"https://github.com/gokceuludogan","followers_url":"https://api.github.com/users/gokceuludogan/followers","following_url":"https://api.github.com/users/gokceuludogan/following{/other_user}","gists_url":"https://api.github.com/users/gokceuludogan/gists{/gist_id}","starred_url":"https://api.github.com/users/gokceuludogan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokceuludogan/subscriptions","organizations_url":"https://api.github.com/users/gokceuludogan/orgs","repos_url":"https://api.github.com/users/gokceuludogan/repos","events_url":"https://api.github.com/users/gokceuludogan/events{/privacy}","received_events_url":"https://api.github.com/users/gokceuludogan/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"maintainer_can_modify":false,"commits":12,"additions":465,"deletions":0,"changed_files":22}}
{"actor":{"display_login":"gokceuludogan"}}