{"id":16946639,"url":"https://github.com/bharat-rajani/polls-rest-api","last_synced_at":"2026-04-29T23:04:57.700Z","repository":{"id":175220535,"uuid":"192329434","full_name":"bharat-rajani/Polls-REST-API","owner":"bharat-rajani","description":"A polling application REST API for gathering live responses on various topic from users.","archived":false,"fork":false,"pushed_at":"2020-11-04T11:16:29.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T06:02:52.567Z","etag":null,"topics":["java","polls-application","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bharat-rajani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-17T10:59:03.000Z","updated_at":"2020-11-04T11:16:32.000Z","dependencies_parsed_at":"2023-10-03T06:27:56.962Z","dependency_job_id":null,"html_url":"https://github.com/bharat-rajani/Polls-REST-API","commit_stats":null,"previous_names":["bharat-rajani/polls-rest-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bharat-rajani/Polls-REST-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bharat-rajani%2FPolls-REST-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bharat-rajani%2FPolls-REST-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bharat-rajani%2FPolls-REST-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bharat-rajani%2FPolls-REST-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bharat-rajani","download_url":"https://codeload.github.com/bharat-rajani/Polls-REST-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bharat-rajani%2FPolls-REST-API/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262545029,"owners_count":23326655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","polls-application","rest-api","spring-boot"],"created_at":"2024-10-13T21:44:28.147Z","updated_at":"2026-04-29T23:04:54.758Z","avatar_url":"https://github.com/bharat-rajani.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polls API\n\nUser polls for gathering live responses on various topic.\n\n\u003e #### Why polls application was created?\n\n\u003eThis application is created to:\n\u003e - Serve the objective of learning and building REST API with Java and Spring Boot.\n\u003e - Understand and employ TDD and SOLID principles.\n\u003e - Develop quality API by keeping OWASP REST Api Security Principles in mind.\n \n### Steps to Setup the Spring Boot Backend API\n\n 1. **Clone the application**\n \n \t```bash\n \tgit clone https://github.com/bharat-rajani/Polls-REST-API.git\n \t```\n \n 2. **Create MySQL database**\n \n \t```bash\n \tcreate database polls_db\n \t```\n \n 3. **Change MySQL username and password as per your MySQL installation**\n \n \t+ open `src/main/resources/application.properties` file.\n \n \t+ change `spring.datasource.username` and `spring.datasource.password` properties as per your mysql installation\n \n 4. **Run the app**\n \n \tYou can run the spring boot app by typing the following command -\n \n \t```bash\n \tmvn spring-boot:run\n \t```\n \n \tThe server will start on port 8080.\n \n \tYou can also package the application in the form of a `jar` file and then run it like so -\n \n \t```bash\n \tmvn package\n \tjava -jar target/polls-0.0.1-SNAPSHOT.jar\n \t```\n 5. **Default Roles**\n \t\n \tThe spring boot app uses role based authorization powered by spring security. To add the default roles in the database, I have added the following sql queries in `src/main/resources/data.sql` file. Spring boot will automatically execute this script on startup -\n \n \t```sql\n \tINSERT IGNORE INTO roles(name) VALUES('ROLE_USER');\n \tINSERT IGNORE INTO roles(name) VALUES('ROLE_ADMIN');\n \t```\n \n \tAny new user who signs up to the app is assigned the `ROLE_USER` by default.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbharat-rajani%2Fpolls-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbharat-rajani%2Fpolls-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbharat-rajani%2Fpolls-rest-api/lists"}