A simple Todo application built with Spring Boot and MongoDB, designed for practicing Jenkins pipelines.
- Create, read, update, and delete todos
- MongoDB integration for data persistence
- RESTful API endpoints
- Docker support for easy deployment
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/todos | Get all todos |
| GET | /api/todos/{id} | Get a specific todo |
| POST | /api/todos | Create a new todo |
| PUT | /api/todos/{id} | Update a todo |
| DELETE | /api/todos/{id} | Delete a todo |
curl http://localhost:8080/api/todoscurl http://localhost:8080/api/todos/{id}curl -X POST http://localhost:8080/api/todos \
-H "Content-Type: application/json" \
-d '{"title": "Learn Spring Boot", "description": "Complete the tutorial"}'curl -X PUT http://localhost:8080/api/todos/{id} \
-H "Content-Type: application/json" \
-d '{"title": "Learn Spring Boot", "description": "Tutorial completed", "completed": true}'curl -X DELETE http://localhost:8080/api/todos/{id}- Make sure Docker and Docker Compose are installed
- Run the following command:
docker-compose up --buildThe application will be available at http://localhost:8080
The application includes a Jenkins pipeline with the following stages:
- Install Dependencies
- Test
- Lint
- Build
- Docker
To use the pipeline:
- Create a new Pipeline job in Jenkins
- Configure it to use the Jenkinsfile from your repository
- Make sure Jenkins has Docker installed and configured
- Ensure the Jenkins user has permissions to run Docker commands