A modern web application for managing printers and tracking their usage counters. Built with Spring Boot backend and React + TypeScript + Chakra UI frontend, fully containerized with Docker.
- View all printers in a beautiful grid layout
- Add new printers with detailed information
- Edit existing printer information
- Delete printers
- Track printer counters
- Responsive design with light/dark mode support
- RESTful API backend
- Fully containerized with Docker
- Java 20
- Spring Boot 3.3.2
- Spring Data JPA
- MySQL 8.0
- SNMP4J (for printer communication)
- Spring Actuator (for monitoring)
- React 18
- TypeScript
- Chakra UI
- Vite
- Axios
- React Router
- Docker
- Docker Compose
- Nginx (for serving React app)
- Docker and Docker Compose installed
- Ports 80, 8080, and 3306 available
- Clone the repository:
git clone <repository-url>
cd printer-tool- Start all services with Docker Compose:
docker-compose up -d-
Wait for all services to be healthy (about 1-2 minutes)
-
Access the application:
- Frontend: http://localhost
- Backend API: http://localhost:8080/api
- Backend Health: http://localhost:8080/actuator/health
- Navigate to the project root:
cd printer-tool- Run with Maven:
./mvnw spring-boot:runThe backend will start on http://localhost:8080
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will start on http://localhost:3000
- Build for production:
npm run buildGET /api/printers- Get all printersGET /api/printers/{id}- Get printer by IDPOST /api/printers- Create new printerPUT /api/printers/{id}- Update printerDELETE /api/printers/{id}- Delete printer
GET /api/counters- Get all countersGET /api/counters/ip/{ip}- Get counters by IPPOST /api/counters- Create new counter
docker-compose up -ddocker-compose downdocker-compose logs -fdocker-compose up -d --builddocker-compose down -vConfigure in src/main/resources/application.properties:
- Database connection settings
- Server port
- JPA/Hibernate settings
- Logging levels
Create a .env file in the frontend directory:
VITE_API_URL=http://localhost:8080/api
The application uses MySQL 8.0. The database schema is automatically created and updated by Hibernate.
- Database:
printer_manager - User:
printer_user - Password:
printer_password - Root password:
root_password
printer-tool/
├── src/ # Backend source code
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/printer_manager/
│ │ │ ├── controller/ # REST controllers
│ │ │ ├── model/ # JPA entities
│ │ │ ├── repository/ # Data repositories
│ │ │ ├── service/ # Business logic
│ │ │ └── config/ # Configuration classes
│ │ └── resources/
│ │ ├── application.properties
│ │ ├── static/
│ │ └── templates/
│ └── test/ # Backend tests
├── frontend/ # Frontend React app
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ ├── types/ # TypeScript types
│ │ ├── App.tsx
│ │ └── main.tsx
│ ├── Dockerfile
│ ├── nginx.conf
│ ├── package.json
│ └── vite.config.ts
├── Dockerfile # Backend Dockerfile
├── docker-compose.yml
├── pom.xml
└── README.md
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
For issues and questions, please open an issue on GitHub.