Skip to content

percyosag/pokemon-evaluation-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# pokemon-evaluation-api

Spring Boot REST API for managing Pokémon and reviews, secured with JWT authentication.

## Tech Stack

- Java 17

- Spring Boot

- Spring Security + JWT (jjwt)

- Spring Data JPA

- H2 Database (in-memory)

- Maven

## Features

- User registration and login (JWT token)

- CRUD endpoints for Pokémon

- Create, view, update, and delete reviews for a Pokémon

- Global exception handling

## Run Locally

### Prerequisites

- Java 17+

### Start the app

mvn spring-boot:run


## The API runs at:

- http://localhost:8080

## Database (H2 Console)

H2 is configured as an in-memory database:

JDBC URL: jdbc:h2:mem:pokemonapi

Username: sa

Password: (empty)

Enable H2 console is already set in application.properties.

## Authentication Flow (JWT)

Register:

POST /api/auth/register

Login:

POST /api/auth/login

Use the returned JWT token in requests:

Authorization: Bearer

## API Endpoints

### Auth

POST /api/auth/register

POST /api/auth/login

### Pokémon

GET /api/pokemon

GET /api/pokemon/{id}

POST /api/pokemon/create

PUT /api/pokemon/{id}/update

DELETE /api/pokemon/{id}/delete

### Reviews

POST /api/pokemon/{pokemonId}/reviews

GET /api/pokemon/{pokemonId}/reviews

GET /api/pokemon/{pokemonId}/reviews/{id}

PUT /api/pokemon/{pokemonId}/reviews/{id}

DELETE /api/pokemon/{pokemonId}/reviews/{id}

## Testing Requests

This repo includes api-tests.http (IntelliJ HTTP Client) to quickly test endpoints.

About

Spring Boot REST API with JWT authentication for Pokémon evaluation and reviews.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages