Skip to content
Snippets Groups Projects
Commit b2038cc1 authored by Filip Piták's avatar Filip Piták
Browse files

Create database container with data initialization

parent 62fd15f1
No related branches found
No related tags found
No related merge requests found
CREATE SCHEMA IF NOT EXISTS bank_user;
CREATE USER "ACC_USER" WITH PASSWORD 'userAccPasswd';
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM "ACC_USER";
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM "ACC_USER";
ALTER ROLE "ACC_USER" SET SEARCH_PATH TO bank_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA bank_user TO "ACC_USER";
CREATE SCHEMA IF NOT EXISTS bank_account;
CREATE USER "ACC_ACCOUNT" WITH PASSWORD 'accountAccPasswd';
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM "ACC_ACCOUNT";
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM "ACC_ACCOUNT";
ALTER ROLE "ACC_ACCOUNT" SET SEARCH_PATH TO bank_account;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA bank_account TO "ACC_ACCOUNT";
CREATE SCHEMA IF NOT EXISTS bank_transaction;
CREATE USER "ACC_TRANSACTION" WITH PASSWORD 'transactionAccPasswd';
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM "ACC_TRANSACTION";
REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM "ACC_TRANSACTION";
ALTER ROLE "ACC_TRANSACTION" SET SEARCH_PATH TO bank_transaction;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA bank_transaction TO "ACC_TRANSACTION";
created just to commit the '.docker' directory.
Remove after other files have been added into the directory.
\ No newline at end of file
......@@ -13,7 +13,7 @@ which can report total and average (per account) transactions (deposits, withdra
## Use case diagram
<img src="./useCaseDiagram.png" width="800">
## Artefact Structure
## Artifact Structure
| Service | Specification |
|-----------------------------|-----------------------------------------------------------------------------------------------------------------------|
......@@ -25,7 +25,7 @@ which can report total and average (per account) transactions (deposits, withdra
## Module Architecture
Each service is implemented as a separate maven artifact consisting of a Spring-boot application. Within each project
we used the principles of `Hexagonal architecture` and `DDD`, where the domain itself consists of only pure Java classes,
we used the principles of `Hexagonal architecture`, where the domain itself consists of only pure Java classes,
with no technological dependencies. By using such separation, we nicely created an extra separated layer on top of the
traditional `Controller, Facade, Service and Repository` layers. The main benefit of such separation is visible mainly when
extending new features, implementation of tests and usage of custom abstractions with ease.
......
version: "3.8"
version: "3.9"
name: online-banking
services:
banking-db:
image: "postgres:16.2"
ports:
- "5432:5432"
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=passwd
- POSTGRES_DB=banking
volumes:
- ./.docker/db/scripts:/docker-entrypoint-initdb.d
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment