https://github.com/hexagontk/contact_application
Sample backend application that provides a simple REST API for managing contacts.
https://github.com/hexagontk/contact_application
example gradle hacktoberfest jvm kotlin
Last synced: 11 months ago
JSON representation
Sample backend application that provides a simple REST API for managing contacts.
- Host: GitHub
- URL: https://github.com/hexagontk/contact_application
- Owner: hexagontk
- Created: 2019-10-02T05:44:05.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-02T16:24:35.000Z (almost 2 years ago)
- Last Synced: 2025-01-22T05:43:05.621Z (about 1 year ago)
- Topics: example, gradle, hacktoberfest, jvm, kotlin
- Language: Kotlin
- Homepage: https://hexagontk.com
- Size: 236 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Contact Application
This is a sample backend application, written using [Hexagon](https://hexagontk.com) toolkit. It provides simple REST API for managing contacts. Contacts are managed on a per-user basis. So the contacts operations are available after user login.
## Usage
This project uses gradle as it's build tool. The `test` task requires mongodb instance to run on `27018 (non-default)` port. You can run this container in docker before running tests, using this command:
```
docker run --name contacts-db --rm -d -p 27018:27017 mongo:4.2.0
```
Or you can skip tests with `-x test` arguments to corresponding build command.
Usefull commands:
* Build: `./gradlew build`
* Rebuild: `./gradlew clean build`
* Assemble: `./gradlew installDist`
* Run: `./gradlew run`
* Test: `./gradlew test`
## Interaction
As this project only exposes REST API, you need some external tool to interact with it. You can use `curl`, `HTTPie`, `Postman`, etc...
## Endpoints
Register user:
```
POST `/user`
```
Login user:
```
POST `/user/login`
```
Delete user:
```
DELETE `/user`
```
List contacts:
```
GET `/contacts`
```
Create contact:
```
POST `/contacts`
```
Get contact:
```
GET `/contacts/{contactId}`
```
Update contact:
```
PUT `/contacts/{contactId}`
```
Delete contact:
```
DELETE `/contacts/{contactId}`
```