Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thribeiro8/courses-api
A courses simple API.
https://github.com/thribeiro8/courses-api
Last synced: 21 days ago
JSON representation
A courses simple API.
- Host: GitHub
- URL: https://github.com/thribeiro8/courses-api
- Owner: thribeiro8
- Created: 2024-02-24T20:42:01.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T22:44:13.000Z (10 months ago)
- Last Synced: 2024-02-26T23:39:38.820Z (10 months ago)
- Language: Java
- Size: 68.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Courses API
## Rocketseat Backend Challenge
![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white)
![Spring](https://img.shields.io/badge/spring-%236DB33F.svg?style=for-the-badge&logo=spring&logoColor=white)
[![Licence](https://img.shields.io/github/license/Ileriayo/markdown-badges?style=for-the-badge)](./LICENSE)This project is an API built using **Java, Java Spring, JPA, Docker, PostgreSQL.**
## Table of Contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [Database](#database)
- [Contributing](#contributing)## Installation
1. Clone the repository:
```bash
git clone https://github.com/thribeiro8/courses-api
```2. Install dependencies with Maven
3. Create a configuration with your runtime environment variables with your PostgreeSQL Credentials that are used in `application.properties`
```yml
spring.datasource.url=jdbc:postgresql://localhost:5432/courses_api
spring.datasource.username=admin
spring.datasource.password=admin
spring.jpa.hibernate.ddl-auto=update
```**Docker**
```yml
version: "3.8"services:
postgres:
container_name: courses_api_postgres
image: postgres
ports:
- 5432:5432
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=courses_api
```**Postgres**
1. Run in terminal:
```bash
docker compose up -d
```2. Create a DB for postgres using docker compose: http://localhost:5432.
3. Log with admin:admin and create a database called 'course'.
## Usage
1. Start the application with Maven
2. The API will be accessible at http://localhost:5432## API Endpoints
The API provides the following endpoints:
**API COURSE**
```markdown
POST /courses - Create a new course
GET /courses - Retrieve all courses
GET /courses/{id} - Retrieve a course
PUT /courses/{id} - Updates a course
DELETE /courses/{id} - Delete a course
```**BODY**
```json
{
"name": "Curso a ser postado",
"category": "Categoria a ser postada"
}
```## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.
When contributing to this project, please follow the existing code style, [commit conventions](https://www.conventionalcommits.org/en/v1.0.0/), and submit your changes in a separate branch.