Fortune ai
Fortune ai is a Java spring boot api connected to chatgpt with a 'category' prompt. It returns a possitive message based on the topic
Java Spring Boot Collection
- Bookit
- [fortune-ai] fortune-ai
- happy2be
- calendar
- lazy-image-loader
Fortune-ai is a preliminary test of Java Spring Boot API development. The idea to represent a chatbot using chatgpt to provide prompting. It is simple to use and implement. A test model is associated with pintmento.com as the front end display and integration with an AWS EC2 instance and an RDS database storage system. Use to kickstart an app or tutorial.
Visit the repo and kick start your project!

User Journey of the fortune-ai model, spring boot api.

Backend journey of the system.



On the left, an Entity Relationship Diagram (ERD). Middle, class model for the system methods. Right, tbd.
To illustrate the concepts and theory behind this Spring Boot Rest api mind mapping diagrams to illustrate the concepts and features.


On the left, Mind map and on the right class model.
Here’s the code for the rest controller endpoints:
@RestController
@RequestMapping("/api")
class FortuneController {
private final OpenAIService openAIService;
@GetMapping("/lucky-number")
public int getLuckyNumber() {
return random.nextInt(100) + 1;
}
@GetMapping("/daily-advice")
public String getDailyAdvice() {
return ADVICE[random.nextInt(ADVICE.length)];
}
@GetMapping("/fortune-ai")
public Mono<String> getAIFortune(@RequestParam(value = "category", defaultValue = "general") String category) {
return openAIService.getAiFortune(category);
}
}