๐ Prerequisites
- Java JDK 11 or higher
- Maven 3.6+ installed
- PostgreSQL 12+ database server
- Git for version control
- Your favorite IDE (IntelliJ IDEA recommended)
| Step | Description | Command |
|---|---|---|
| 1๏ธโฃ | Clone the repository |
git clone https://github.com/khan-sk-dev/Premier-League.gitcd Premier-League
|
| 2๏ธโฃ | Configure database |
Edit src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/pl_data spring.datasource.username=your_username spring.datasource.password=your_password |
| 3๏ธโฃ | Build the project | mvn clean install |
| 4๏ธโฃ | Run the application | mvn spring-boot:run |
| Player Management Endpoints | ||
|---|---|---|
| Operation | Endpoint | Description |
| ๐ GET | /api/v1/player |
Retrieve players with optional filtering |
| โ POST | /api/v1/player |
Add a new player to the database |
| ๐ PUT | /api/v1/player |
Update existing player information |
| โ DELETE | /api/v1/player/{playerName} |
Remove a player from the database |
๐ Get Players (with filters)
GET /api/v1/player?team=Arsenal&position=ForwardResponse (200 OK)
[
{
"id": 1,
"name": "Gabriel Jesus",
"team": "Arsenal",
"position": "Forward",
"nation": "Brazil"
},
{
"id": 2,
"name": "Gabriel Martinelli",
"team": "Arsenal",
"position": "Forward",
"nation": "Brazil"
}
]โ Add Player
POST /api/v1/player
Content-Type: application/jsonRequest Body
{
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Winger",
"nation": "England"
}Response (201 Created)
{
"id": 3,
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Winger",
"nation": "England"
}๐ Update Player
PUT /api/v1/player
Content-Type: application/jsonRequest Body
{
"id": 3,
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Right Winger",
"nation": "England"
}Response (200 OK)
{
"id": 3,
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Right Winger",
"nation": "England"
}โ Delete Player
DELETE /api/v1/player/Bukayo%20SakaResponse (204 No Content)
|
Follow these steps to contribute to the Premier League API project: |
Please note that this project follows a Code of Conduct. By participating, you are expected to uphold this code.
|
This project is licensed under the MIT License - see the LICENSE file for details. |
- JDK 11 or higher
- Maven 3.6+
- PostgreSQL 12+
-
Clone the repository
git clone https://github.com/khan-sk-dev/Premier-League.git cd Premier-League -
Configure database
Edit
src/main/resources/application.properties:spring.datasource.url=jdbc:postgresql://localhost:5432/pl_data spring.datasource.username=your_username spring.datasource.password=your_password
-
Build the project
mvn clean install
-
Run the application
mvn spring-boot:run
The API will be accessible at
http://localhost:8080
GET /api/v1/playerQuery Parameters:
team- Filter by team namename- Filter by player nameposition- Filter by positionnation- Filter by nation
Example:
GET /api/v1/player?team=Arsenal&position=StrikerPOST /api/v1/playerRequest Body:
{
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Winger",
"nation": "England"
}PUT /api/v1/playerRequest Body:
{
"name": "Bukayo Saka",
"team": "Arsenal",
"position": "Right Winger",
"nation": "England"
}DELETE /api/v1/player/{playerName}Example:
DELETE /api/v1/player/Bukayo%20SakaPremier-League/
โโโ src/
โ โโโ main/
โ โ โโโ java/
โ โ โ โโโ com/
โ โ โ โโโ premierleague/
โ โ โ โโโ controller/
โ โ โ โโโ model/
โ โ โ โโโ repository/
โ โ โ โโโ service/
โ โ โ โโโ PremierLeagueApplication.java
โ โ โโโ resources/
โ โ โโโ application.properties
โ โโโ test/
โ โโโ java/
โ โโโ com/
โ โโโ premierleague/
โ โโโ tests/
โโโ .gitignore
โโโ mvnw
โโโ mvnw.cmd
โโโ pom.xml
โโโ README.md
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- ๐ Authentication and authorization
- ๐ Statistical analysis of player performance
- ๐ Team management functionality
- โก Caching for improved performance
- ๐งช Comprehensive test coverage
Developed with โค๏ธ by khan-sk-dev

