A full-stack customer management application with JWT authentication, built with Spring Boot, React, and PostgreSQL — all containerized with Docker.
Backend
- Java 21 + Spring Boot 3.5
- Spring Security + JWT
- Spring Data JPA + Hibernate
- PostgreSQL
Frontend
- React + TypeScript
- Tailwind CSS
- Axios
- React Router
Infrastructure
- Docker + Docker Compose
- Nginx
- Admin login with JWT authentication
- Protected routes
- Add, view, edit and delete customers
- Persistent database storage
- Fully containerized
- Docker Desktop
- Java 21
- Node.js 20+
- Maven
- Clone the repository:
git clone <your-repo-url>
cd customer-management- Create a
.envfile in the root folder:
SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/customerManagement
SPRING_DATASOURCE_USERNAME=user
SPRING_DATASOURCE_PASSWORD=password
JWT_SECRET=your-super-secret-key-that-is-long-enough
JWT_EXPIRATION=86400000
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin123
- Start everything:
docker compose up --build- Open the app:
- Frontend: http://localhost:3000
- Backend: http://localhost:8080
- Start the database:
docker compose up db -d- Run the backend:
cd backend
mvn spring-boot:run- Run the frontend:
cd frontend
npm install
npm run dev- Open the app:
- Frontend: http://localhost:5173
- Backend: http://localhost:8080
Username: admin
Password: admin123
customer-management/
├── backend/
│ ├── src/main/java/com/customermanagement/backend/
│ │ ├── config/
│ │ ├── controller/
│ │ ├── dto/
│ │ ├── entity/
│ │ ├── exception/
│ │ ├── filter/
│ │ ├── repository/
│ │ ├── service/
│ │ └── util/
│ └── Dockerfile
├── frontend/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ └── pages/
│ ├── nginx.conf
│ └── Dockerfile
└── docker-compose.yml
| Method | Endpoint | Access | Description |
|---|---|---|---|
| POST | /api/auth/login | Public | Login and get JWT token |
| GET | /api/customers | Protected | Get all customers |
| GET | /api/customers/{id} | Protected | Get one customer |
| POST | /api/customers | Protected | Create customer |
| PUT | /api/customers/{id} | Protected | Update customer |
| DELETE | /api/customers/{id} | Protected | Delete customer |
# Start everything
docker compose up --build
# Start in background
docker compose up -d
# Stop everything
docker compose down
# Stop and wipe database
docker compose down -v
# View logs
docker compose logs backend
docker compose logs frontend