/senopi

Spring-empowered Notes API

Primary LanguageJava

Senopi

Dicoding notes app the backend project, but it's powered by Spring Boot.

Overview

This project was made using Spring Boot. Like general backend applications, it can process a request and send a response, store into a database, authenticate request & authorize resource (we use JWT), process queue job, send emails, store images, etc.

For the application feature, we build it according to the original project.

Usage

We have documented the OpenAPI spec of the app. You can check here.

Installation

Prerequisite:

  • JRE version 17 or later
  • Apache Maven
  1. Database setup You can use PostgreSQL as database of this application. Make sure to set up the database name, username, and password. Once finished, configure this app by filling these keys in application configuration:
spring.datasource.url=jdbc:postgresql://<yourpgserverhost>:<port>/<dbname>
spring.datasource.username=
spring.datasource.password=
spring.datasource.driver-class-name=org.postgresql.Driver

You can follow the example file in application.yaml.example file inside resource classpath

And migrate the database. You can find the sql sample file here

  1. AMQP server setup Senopi has a feature to exporting notes using queue job so it will require an AMQP server to fulfill this functionality. We have used RabbitMQ as AMQP server because it is easy to use. To configure AMQP server, fill these keys in application configuration:
spring.rabbitmq.host=
spring.rabbitmq.port=
spring.rabbitmq.username=
spring.rabbitmq.password=

You can follow the example file in application.yaml.example file inside resource classpath

And set up the consumer app that you can find here

  1. JWT Secret For security purpose this app need private and public key for generating JWT tokens. You can generate two .pem file as private and public key. And configure the app to locate the files location in application configuration:
rsa.private-key=
rsa.public-key=

You can follow the example file in application.yaml.example file inside resource classpath

  1. Running the app

Once those setups above is finished. You can start the application: mvn spring-boot:run

Frontend Service

To install the frontend service, clone this repository and follow the instructions inside it.