Skip to content

MJZ-Templates/poll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Š Real-time Polling App with Spring Boot & React

  • Built with Spring Boot 3.4.4 and Amazon Corretto 21
  • Create and share polls easily – votes are reflected in real-time with bar charts!
  • ✨ Real-time vote updates – Live synchronization using WebSocket (STOMP)
  • πŸ“Š Bar chart visualization – Instantly see vote results as dynamic charts
  • πŸ”— Sharable poll links – Each poll generates a unique URL for easy sharing
  • ⚑ Quick-start project structure – Clean domain/service/controller setup

πŸ“‚ Project Structure

front

.
|-- eslint.config.js
|-- index.html
|-- package-lock.json
|-- package.json
|-- public
|   `-- vite.svg
|-- src
|   |-- App.css
|   |-- App.jsx
|   |-- assets
|   |   `-- react.svg
|   |-- components
|   |   |-- PollBarChart.jsx
|   |   `-- PollViewer.jsx
|   |-- constants
|   |   `-- chartColors.js
|   |-- hooks
|   |   `-- useLocalStorage.js
|   |-- index.css
|   |-- main.jsx
|   |-- pages
|   |   |-- CreatePollPage.jsx
|   |   `-- PollDetailPage.jsx
|   `-- services
|       |-- api.js
|       `-- socket.js
`-- vite.config.js

back

.
|-- build.gradle
|-- gradle
|   `-- wrapper
|       |-- gradle-wrapper.jar
|       `-- gradle-wrapper.properties
|-- gradlew
|-- gradlew.bat
|-- settings.gradle
`-- src
    `-- main
        `-- java
            `-- arkain
                `-- dev
                    `-- back
                        |-- BackApplication.java
                        |-- config
                        |   |-- CorsConfig.java
                        |   `-- WebSocketConfig.java
                        `-- poll
                            |-- app
                            |   `-- PollService.java
                            |-- common
                            |   `-- controller
                            |       `-- HealthCheckController.java
                            |-- controller
                            |   |-- PollController.java
                            |   `-- VoteController.java
                            |-- domain
                            |   |-- Option.java
                            |   `-- Poll.java
                            |-- dto
                            |   |-- CreatePollRequest.java
                            |   |-- CreatePollResponse.java
                            |   |-- PollResponse.java
                            |   `-- VoteMessage.java
                            `-- repository
                                `-- PollRepository.java

πŸ”§ Tip & Guide

  1. Get URL and Port

    • You can get the default URL/Port and add URL/Port in the top right.
    • Hover on the [Preview]->[Running URL and Port] button in menu bar.
  2. Command feature

    • You can simply run your script using the shortcut icons on the top right.
    • Hover on the [Run]->[Add run command] button in menu bar.
  3. SSH Configuration

    • This feature is only available for membership users.
    • You can SSH to the Arkain container from the outside via the [Menu]->[SSH Configuration] in menu bar.
  4. CORS config

    • cors config in back/src/.../config/CorsConfig.java file
    • add your front domain in allowedOrigins
    • for example:
    @Bean
     public WebMvcConfigurer corsConfigurer() {
         return new WebMvcConfigurer() {
             @Override
             public void addCorsMappings(CorsRegistry registry) {
                 registry.addMapping("/**")
                         .allowedOrigins("http://localhost:5173", "https://arkain.io") // Add your custom domain except port
                         .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
                         .allowedHeaders("*")
                         .allowCredentials(true);
             }
         };
     }

πŸ’¬ Support & Documentation

Visit https://arkain.io to support and learn more about using arkain.

To watch usage guides, visit https://docs.arkain.io.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published