Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target
.idea
/ISM-Rust/target
realm.json
11 changes: 0 additions & 11 deletions .idea/ISM.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/vcs.xml

This file was deleted.

866 changes: 0 additions & 866 deletions .idea/workspace.xml

This file was deleted.

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,14 @@ Here's a summary of the available API endpoints:
## Development:

**Compiling the Project:** If you modify any SQL queries managed by sqlx, you must run `cargo sqlx prepare` before compiling the project to update the offline query data. This ensures compile-time checks for your SQL.

### Migrations
This project uses the sqlx-cli to handle migrations.

```
# Migrate up
sqlx migrate run

# Migrate down
sqlx migrate revert
```
106 changes: 82 additions & 24 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,47 +47,105 @@ services:
volumes:
- redpanda-0:/var/lib/redpanda/data
networks:
- redpanda_network
- local
ports:
- 18081:18081
- 18082:18082
- 19092:19092
- 19644:9644

console:
container_name: redpanda-console
image: docker.redpanda.com/redpandadata/console:v3.0.0
networks:
- redpanda_network
entrypoint: /bin/sh
command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
environment:
CONFIG_FILEPATH: /tmp/config.yml
CONSOLE_CONFIG_FILE: |
kafka:
brokers: ["redpanda-0:9092"]
schemaRegistry:
enabled: true
urls: ["http://redpanda-0:8081"]
redpanda:
adminApi:
enabled: true
urls: ["http://redpanda-0:9644"]
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio-data:/data
command: server --address ":9000" --console-address ":9001" /data

KeycloakDB:
container_name: KeycloakDB
image: "postgres:17.2"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ]
timeout: 45s
interval: 10s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: keycloak
POSTGRES_HOST: postgres
networks:
- local
ports:
- "18080:8080"
depends_on:
- redpanda-0
- "5432:5432"

keycloak:
container_name: keycloak
image: keycloak/keycloak:26.4
depends_on:
- "KeycloakDB"
environment:
#JAVA_TOOL_OPTIONS: -XX:UseSVE=0 #workaround for macOS 15.2
JAVA_OPTS_APPEND: -Dkeycloak.profile.feature.upload_scripts=enabled
KC_DB: postgres
KC_DB_PASSWORD: postgres
KC_DB_URL: jdbc:postgresql://KeycloakDB:5432/keycloak
KC_DB_USERNAME: postgres
KC_HTTP_ENABLED: true
KC_HOSTNAME_STRICT_HTTPS: false
KC_HOSTNAME: http://localhost:8180
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: admin
ports:
- "8180:8080"
- "8787:8787" # debug port
networks:
- local
volumes:
- ./realm.json:/opt/keycloak/data/import/realm.json
entrypoint:
- /opt/keycloak/bin/kc.sh
- start
- --import-realm

RoomDB:
container_name: RoomDB
image: postgres:17.2
volumes:
- room_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: meventure1234
networks:
- local
ports:
- "32768:5432"

volumes:
cassandra-data:
driver: local
redpanda-0:
minio-data:
driver: local
keycloak_data:
driver: local
postgres_data:
driver: local
redis_data:
driver: local
room_data:
driver: local
redpanda-0:
driver: local


networks:
redpanda_network:
local:
name: local
driver: bridge
3 changes: 3 additions & 0 deletions migrations/20251026141354_create_initial_tables.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE chat_room_participant;
DROP TABLE chat_room;
DROP TABLE app_user;
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ create index idx_participants_user_room_id
on chat_room_participant (user_id, room_id);

create index idx_participants_room_id_membership
on chat_room_participant (room_id, participant_state);
on chat_room_participant (room_id, participant_state);
Loading