Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/makiftutuncu/bookstore
Sample app demonstrating web backend testing in Scala
https://github.com/makiftutuncu/bookstore
sbt scala scalatest test
Last synced: 6 days ago
JSON representation
Sample app demonstrating web backend testing in Scala
- Host: GitHub
- URL: https://github.com/makiftutuncu/bookstore
- Owner: makiftutuncu
- License: mit
- Created: 2019-03-21T13:15:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:38:34.000Z (11 months ago)
- Last Synced: 2024-05-01T12:51:46.203Z (6 months ago)
- Topics: sbt, scala, scalatest, test
- Language: Scala
- Size: 81.1 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Bookstore
## Table of Contents
1. [Introduction](#introduction)
2. [Configuration](#configuration)
3. [Development](#development)
4. [Testing](#testing)
5. [Contributing](#contributing)
6. [License](#license)## Introduction
Bookstore is a backend application written in Scala. It is a dummy REST API for authors and books. Its main purpose is to showcase how a backend application can be separated into layers and how they can be tested via different types of automated tests. For more details, see [PRESENTATION.md](PRESENTATION.md).
At its core, bookstore is a [Finch]() app. To see all external dependencies, check out [build.sbt](build.sbt) file.
A detailed API documentation is in [API.md](API.md).
There is a Postman collection under [postman](postman) folder.
## Configuration
Bookstore can be configured via [application.conf](src/main/resources/application.conf) and [test.conf](src/test/resources/test.conf) files for running and testing respectively. You can also override any config with following environment variables.
| Variable Name | Data Type | Description |
| ----------------- | --------- | -------------------------- |
| BOOKSTORE_DB_HOST | String | Database host |
| BOOKSTORE_DB_PORT | Int | Database port |
| BOOKSTORE_DB_NAME | String | Database name |
| BOOKSTORE_DB_USER | String | Database user |
| BOOKSTORE_DB_PASS | String | Database user's password |
| BOOKSTORE_PORT | Int | Application's running port |## Development and Running
Bookstore is built with SBT. So, standard SBT tasks like `clean`, `compile` and `run` can be used.
In order to get the database set up, you may simply use `docker-compose` by doing
```docker-compose up -d```
This will fire up a PostgreSQL database for running the application and another one for running tests.
## Testing
To run all the tests, use `test` task of SBT.
To run specific test(s), use `testOnly fullyQualifiedTestClassName1 fullyQualifiedTestClassName2 ...`
## Contributing
Perhaps there is not much to develop here but all contributions are more than welcome. Please feel free to send a pull request for your contributions. Thank you.
## License
Bookstore is licensed with MIT License. See [LICENSE.md](LICENSE.md) for details.