Skip to content

nazzmul-anik/POLLING-JAVA-FULL-STACK-APP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—³οΈ Polling Application

A full-stack Polling Application built with Java, Spring Boot, MySQL, React, and Material UI, designed with clean architecture, secure authentication, and scalable REST APIs.

This project demonstrates modern backend engineering practices (JWT security, layered architecture, DTO pattern) combined with a responsive and user-friendly frontend.


image

πŸš€ Tech Stack

πŸ”§ Backend

  • Java 25
  • Spring Boot
  • Spring Security (JWT Authentication)
  • Spring Data JPA (Hibernate)
  • MySQL
  • Java Mail Sender
  • Lombok

🎨 Frontend

  • React.js
  • Material UI (MUI)
  • Axios

✨ Features

πŸ” Authentication & Authorization

  • User Registration & Login
  • JWT-based authentication
  • Secure API endpoints

πŸ—³οΈ Poll Management

  • Create a poll (authenticated users)
  • View all polls
  • View My Polls (user-specific)
  • Delete own polls

❀️ Engagement

  • Like a poll
  • Comment on polls
  • Vote on poll options

πŸ“© Email Integration

  • Automatic email notification when a poll is created (via Java Mail Sender)

πŸ—οΈ Backend Architecture

The backend follows a clean layered architecture:

Controller β†’ Service β†’ Repository β†’ Database
            ↓
           DTO

Key Design Practices

  • DTO pattern for API communication
  • Service layer abstraction
  • Exception handling (recommended to extend)
  • Stateless authentication using JWT

πŸ“‘ API Endpoints

Poll APIs

Method Endpoint Description
POST /api/user/polls/ Create a poll
GET /api/user/polls/ Get all polls
GET /api/user/polls/my-polls Get logged-in user's polls
GET /api/user/polls/{id} Get poll details
DELETE /api/user/polls/{id} Delete poll
GET /api/user/polls/like/{id} Like a poll
POST /api/user/polls/comment Add comment
POST /api/user/polls/vote Vote on poll

πŸ”‘ Authentication Flow

  1. User registers
  2. User logs in
  3. Backend generates JWT token
  4. Token is sent in headers for secured requests
Authorization: Bearer <JWT_TOKEN>

πŸ“¬ Email Notification Flow

  • When a user creates a poll:

    • Backend triggers Java Mail Sender
    • Email is sent to the logged-in user

🧩 Sample Controller (PollController)

@RestController
@RequestMapping("/api/user/polls")
@RequiredArgsConstructor
@CrossOrigin("*")
public class PollController {

    private final PollService pollService;

    @PostMapping("/")
    public ResponseEntity<?> postPoll(@RequestBody PollDTO pollDTO){
        PollDTO creatdPollDTO = pollService.postPoll(pollDTO);
        return new ResponseEntity<>(creatdPollDTO, HttpStatus.CREATED);
    }   
}

βš™οΈ Setup Instructions

πŸ”Ή Backend

git clone https://github.com/nazzmul-anik/polling-app.git
cd polling-app/backend

Run the application:

mvn spring-boot:run

πŸ”Ή Frontend UI Picture

πŸ”Ή Dashboard

image

πŸ”Ή Create Poll Page

image

πŸ”Ή Signu Up Page

image

πŸ”Ή Email Confirmation

image

πŸ”Ή Like & Comment Section

image

πŸ‘¨β€πŸ’» Author

Md Nazmul Hasan Anik

  • Backend Developer (Spring Boot)
  • Passionate about scalable system design and clean code

⭐ If you find this project useful, consider giving it a star!

About

Full-stack Polling Application built with Spring Boot, React, and MySQL. Features JWT authentication, poll creation, voting, likes, comments, and email notifications using Java Mail.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors