https://github.com/servb/e-shop
A project to learn modern web technologies. MIT licence
https://github.com/servb/e-shop
Last synced: 9 months ago
JSON representation
A project to learn modern web technologies. MIT licence
- Host: GitHub
- URL: https://github.com/servb/e-shop
- Owner: SerVB
- Created: 2020-02-28T20:42:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T11:12:58.000Z (about 6 years ago)
- Last Synced: 2025-03-30T22:32:30.731Z (about 1 year ago)
- Language: Kotlin
- Homepage:
- Size: 264 KB
- Stars: 24
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/SerVB/e-shop/actions)
[](https://github.com/SerVB/e-shop/actions)
[](https://docs.docker.com/compose/)


[](https://kotlinlang.org/)
[](https://github.com/papsign/Ktor-OpenAPI-Generator)
[](https://grpc.io/)
[](https://github.com/kotest/kotest)
[](https://ktor.io/)
[](https://github.com/papsign/Ktor-OpenAPI-Generator)
[](https://www.testcontainers.org/)
# e-shop
A project to learn modern web technologies – backend for an online shop.
## Running in Docker
You can run the project easily using Docker:
```shell script
docker-compose up
```
After that, you can check Swagger UI at and for the API description.
## Running locally
If you want to check it out locally, you should provide database like this:
```shell script
docker run -it -e POSTGRES_PASSWORD=123 -e POSTGRES_USER=user -e POSTGRES_DB=mydb -p 5432:5432 postgres:9.6
```
After this, you can run `./gradlew :product:run` and `./gradlew :auth:run`. Don't forget about setting env like in docker-compose: `DB_USER=user;DB_HOST=localhost;DB_PORT=5432;DB_DB=mydb;DB_PASSWORD=123;AUTH_PORT=8081;AUTH_HOST=localhost`.
## How does it work

## Rules
- [x] Public repo.
- [x] Description.
- [x] Architecture graph.
- [x] Swagger UI.
- [x] Docker-compose.
## Stages
### 1. 2020.02.08
Rest API:
- [x] Create a product.
- [x] Remove a product.
- [x] Return a list of products.
- [x] Return a product.
- [x] Edit a product.
"Product" entity:
* Name.
* ID.
* Type.
Extra points:
- [x] Pagination in list of products.
- [x] Data storage in DB.
- [x] Versioning.
- [x] Logging.
### 2. 2020.02.15
- [x] Data storage in DB.
### 3. 2020.03.01
- [x] Docker-compose.
### 4. 2020.03.01
- [x] Registration (via login+password).
- [x] Auth (change login+password to access+refresh tokens).
- [x] A way to change a refresh token to new access+refresh tokens.
- [x] Validation endpoint.
- [x] Products changing endpoints must be available only with auth tokens.
### 7. 2020.04.14
- [x] Replace token validation to gRPC variant.
- [x] Make protobuf files shared (extract to a module).
- [x] Hash passwords in storage.
- [x] Add roles: admin and user.
- Admin can create, edit, remove, and view products. Also, they can create a new administrator (however, first admin can be created without admin rights).
- User can view products.