Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: problem discussion #2

Draft
wants to merge 65 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ad07ae4
todo
Jul 15, 2024
c27b908
add web form
Jul 19, 2024
39a389b
some research
Aug 17, 2024
8665914
record audio on the client
Aug 26, 2024
8b4e4fa
add an implementation description for the discussion feature
Aug 30, 2024
a61d812
fix grammar
Aug 30, 2024
fb8ba43
add authorization test
Sep 20, 2024
11c85b3
add user
Sep 20, 2024
6981698
add user authorization
Sep 20, 2024
014d9ff
authorize user
Sep 20, 2024
6372d8a
create a new meeting
Sep 21, 2024
9844e7d
fix readme
Sep 21, 2024
dfbb81c
start server on random port
Sep 21, 2024
e39b736
extract starting server
Sep 21, 2024
dc7977a
extract models
Sep 21, 2024
e7ebd56
extract http api
Sep 21, 2024
d8b1ab0
add pre-commit
Sep 21, 2024
7b1277b
add go tests
Sep 21, 2024
892dcdb
add instructions to setup dev environment
Sep 21, 2024
f897852
git ignore intelij
Sep 21, 2024
e3835b4
handle create meeting errors
Sep 21, 2024
0d80d79
dial http api
Sep 21, 2024
c8d2015
add feature tests generator
Sep 21, 2024
48ae1c6
extract user handler
Sep 21, 2024
bc6d890
more explicit naming
Sep 21, 2024
f29b91d
add new user
Sep 21, 2024
d92acd6
better naming
Sep 21, 2024
0d5d04f
better naming
Sep 21, 2024
d99ffe5
define development infrastructure
Sep 22, 2024
00294f7
extend readme
Sep 22, 2024
7bcedc4
test postgres connection
Sep 22, 2024
edd566c
wire sql db to user handler
Sep 22, 2024
c2960fb
check db
Sep 22, 2024
02f2193
change user handler initialization
Sep 22, 2024
188a80a
define cli feature
Sep 22, 2024
db771b8
define root command
Sep 22, 2024
3e42e7f
add create command
Sep 22, 2024
9e14895
add user command
Sep 22, 2024
3206995
add common command parameters
Sep 22, 2024
9a21c83
wire up db
Sep 22, 2024
c56e2a0
fix typo
Sep 22, 2024
6f1e8f8
add auth handler
Sep 22, 2024
2e9d18a
create user by cli
Sep 23, 2024
ae550e7
add auth handler
Sep 24, 2024
7a5a4a1
generate password if not specified
Sep 24, 2024
7154fc5
simplify server test
Sep 25, 2024
0d7d528
wire up auth handler
Sep 26, 2024
569fc2c
add jwt handler
Sep 27, 2024
cf9044c
add http api settings
Sep 27, 2024
446e896
add jwt secret generator
Sep 27, 2024
9b9aa1d
serve html client
Oct 11, 2024
8e6aec5
add a server
Oct 11, 2024
9cab81f
json http error
Oct 11, 2024
ce653ab
more verbose cli
Oct 11, 2024
695cc47
handle login
Oct 12, 2024
94b7bea
use html template
Oct 14, 2024
9118a06
add login form template constructor
Oct 14, 2024
c547dae
create meeting form
Oct 15, 2024
7192184
add meetings
Oct 15, 2024
fe31d65
create meeting
Oct 16, 2024
25a4316
create meeting
Oct 16, 2024
5c311d2
authorize http requests
Oct 20, 2024
f0269e9
fix make file issue
Oct 20, 2024
96c560e
create meeting form
Oct 20, 2024
b083cb5
get meetings
Oct 26, 2024
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# secrets
.env

# IDE
.idea
55 changes: 0 additions & 55 deletions .idea/workspace.xml

This file was deleted.

16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: local
hooks:
- id: test
name: Test the application
language: system
entry: make test
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"alexkrechik.cucumberautocomplete",
"hedhyw.golang-gherkingen"
]
}
}
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"name": "discussion feature",
"request": "launch",
"file": "${workspaceFolder}/feature/discussion/index.html"
}
]
}
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Prepare local environment for development.
setup-dev-environment: setup-pre-commit generate-jwt-secret

# Install git pre-commit hooks.
# See https://pre-commit.com for details.
setup-pre-commit:
@pre-commit install

# Generate tests for Gherkin feature definition.
# See https://github.com/hedhyw/gherkingen for details.
#
# Arguments:
# - path: Relative path to Gherkin feature file.
generate-feature-tests:
@docker run --rm -it --read-only --network none \
--volume "$$(pwd)":/host/:ro \
hedhyw/gherkingen:v4.0.0 \
-- /host/"$(path)"

generate-jwt-secret:
@JWT_SECRET="$$(openssl rand -base64 24)" && echo "JWT_SECRET=$$JWT_SECRET" > .env

# Start development infrastructure.
dev-infra-start:
@docker compose up --detach --wait

# Stop development infrastructure.
dev-infra-stop:
@docker compose down --remove-orphans

# Create new user.
# arguments:
# - name: User name.
# - pass: User password.
user:
@go run ./feature/discussion/server/cmd/cli/main.go create user -name="$(name)" -pass="$(pass)"

# Test the application.
test:
make dev-infra-start
go test ./... -race -count=1 -timeout 10s
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
# Democracy-Routes
Democracy Routes is a software for discussion and decision making.

Democracy Routes is software for discussion and decision-making.

## Setup

### Development Environment

To set up environment for development:

- Install [Go](https://go.dev/doc/install) programming language.
- Install [pre-commit](https://pre-commit.com/).

Then run:

```shell
make setup-dev-environment
```

### Development Infrastructure

To rise infrastructure for development:

- Install [rootless Docker](https://docs.docker.com/engine/security/rootless/).

Then use these commands to manage the infrastructure:

```shell
make dev-infra-start
```

```shell
make dev-infra-stop
```
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: dev-infra

services:
postgres:
image: postgres:16.4-alpine3.20
shm_size: 128mb
environment:
POSTGRES_PASSWORD: testing
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 3s
timeout: 5s
retries: 5
ports:
- "5432:5432"
20 changes: 20 additions & 0 deletions feature/TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Implement the "Problem discussion" feature.

- [x] Record audio on the client in browser.
- [ ] Test the client.
- [ ] Start audio recording on entering a meeteng.
- [ ] End audio recording on leaving a meeting.
- [ ] Pass audio stream from client to server.
- [ ] Test the server.
- [ ] Create a text transcript of the meeting.
- [ ] Create a summary of the meeting.

Helpful resources.

https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-ljm-api/
https://github.com/jitsi/lib-jitsi-meet
https://localai.io/features/audio-to-text/
https://github.com/alphacep/vosk-server
https://community.jitsi.org/t/important-embedding-meet-jit-si-in-your-web-app-will-no-longer-be-supported-please-use-jaas/123003/15
https://github.com/miroslavpejic85/mirotalk
https://openvidu.io/
25 changes: 25 additions & 0 deletions feature/discussion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Meeting

This feature is described in [../problem.feature](../problem.feature) file in the *Scenario: Problem discussion*.
Below are some implementation details of how we want this work.

## Client

People log into our system using a web browser.

They start a meeting by calling each other.
Right now the tool for setting up the call is Jitsi Meet,
but we might change it later or provide several options.

When a person starts the call our client app starts
streaming their audio to our server.

## Server

The server authenticates users.

It receives and processes audio streams from user calls.

The server groups received audio streams into meetings.
It creates a transcript for each meeting.
It also creates a summary of each meeting.
Loading