This is a Cerpen (short story) application built with Java Spring Boot for the backend. The application includes two roles: Admin and Author and implements JWT (JSON Web Tokens) for authentication and authorization. The technology stack includes Java 17, Spring Boot, PostgreSQL for the database, Elasticsearch for text search, and Docker Compose for containerization.
You can access the project here.
Here's an overview of the database schema for this project:
| Column Name | Data Type | Constraints |
|---|---|---|
| id | UUID | PRIMARY KEY |
| VARCHAR(255) | NOT NULL, UNIQUE | |
| username | VARCHAR(255) | NOT NULL, UNIQUE |
| password | VARCHAR(255) | NOT NULL |
| role | VARCHAR(255) | NOT NULL |
| is_active | BOOLEAN | NOT NULL |
| created_at | TIMESTAMP | NOT NULL |
| updated_at | TIMESTAMP |
| Column Name | Data Type | Constraints |
|---|---|---|
| id | UUID | PRIMARY KEY |
| user_id | UUID | NOT NULL, UNIQUE |
| name | VARCHAR(255) | NOT NULL |
| Column Name | Data Type | Constraints |
|---|---|---|
| id | UUID | PRIMARY KEY |
| user_id | UUID | NOT NULL, UNIQUE |
| name | VARCHAR(255) | NOT NULL |
| Column Name | Data Type | Constraints |
|---|---|---|
| id | UUID | PRIMARY KEY |
| author_id | UUID | NOT NULL |
| title | VARCHAR(255) | NOT NULL, UNIQUE |
| tema | VARCHAR(255) | NOT NULL |
| cerpen_contains | TEXT | NOT NULL, UNIQUE |
| is_active | BOOLEAN | NOT NULL |
| created_at | TIMESTAMP | NOT NULL |
| updated_at | TIMESTAMP |
To get started with this project, follow these steps:
-
Clone the repository:
git clone https://github.com/destafajri/java-springboot-cerpen-backend
-
Set up the database (PostgreSQL and Elasticsearch) and configure the application.yml.
-
Build and run the application.
You can access the Postman collection for this project