How dks044/wordwave works
Main Components
• Frontend Client:
• The React application lives under the src/main/frontend folder and is built with modules, containers, and components. This module handles the UI, API communication, routing (React Router), state management (Redux and Redux Saga), and interacts with presentation libraries (styled-components, Bootstrap, etc.).
• Backend Server:
• The backend code is found in src/main/java/com/wordwave, using Spring Boot for REST services. Different modules such as grammar, voca, myvoca, myvocabook, and user (with JWT token handling, Spring Security, and email authentication) exist, organized by domain.
• Database & Caching:
• The application uses a MySQL RDBMS (as indicated by JPA and MySQL badges) and Redis for caching or session-related purposes (e.g., email authentication or refresh token management).
• External/Cloud Components:
• AWS S3 and CloudFront distribute the static frontend build.
• Docker is used to containerize the application (Dockerfile provided) and the CI/CD flow is orchestrated via GitHub Actions (.github/workflows).
• EC2 instances are used to host the backend container, with automated deployment steps (pulling new Docker images and running Docker Compose).
Relationships and Data Flow
• The backend validates JWTs and processes these requests by interacting with the MySQL database via JPA, and caching or auxiliary operations are handled via Redis.
• During authentication, the backend distinguishes between saving the refresh token on the server and issuing an access token stored in cookies on the frontend.
• The CI/CD pipeline (GitHub Actions) integrates with Docker to build images, push them to Docker Hub, and deploy to EC2.
• HTTPS is enforced throughout, and the entire communication (especially the API calls) is secured.
• The external build/deployment process shows a clear interaction where the Dockerfile and Gradle scripts compile and package the Java application, while the Node-based build tools work for the frontend.
Key Architectural Patterns
• Separation of Concerns: There is a clear division between frontend and backend.
• Modular Design: Both the frontend and backend are well segmented into components (e.g., grammar, myvoca, voca) and layers (controllers, services, repositories).
• CI/CD and Containerization: Automated integration, testing, and deployment pipelines, with containerized deployment ensuring consistency across environments.
• Security with JWT and Spring Security: Focus on secure authentication/authorization flows.
Technologies and Their Roles
• Frontend: React, Redux, Redux Saga, Axios, React Router.
• Backend: Java, Spring Boot, Spring Security, JPA, MySQL, Redis.
• Deployment and Infrastructure: Docker, AWS (EC2, S3, CloudFront), GitHub Actions.
• Additional: Swagger for API documentation, and Git for version control.