Coder Social home page Coder Social logo

opentutor's People

Contributors

sszuev avatar svok avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

opentutor's Issues

complete the learning functionality

  • finalize learning functionality (front)
  • improve business logic: move calculations from db to core (back)
  • preparing deck and learning logic should be in core, not in repositories

refactoring DB and repositories

  • remove table users and DbUserRepository; keycloak will manage users, we need only user's UUID in dictionaries table
  • add :db-api; move repositories to that module
  • now repositories use :common DTO's; need to make their own DTO's

download & upload json data

now we can download & upload lingvo-xml, this functionality almost useless (who uses lingvo desktop? I think no one).
on the other hand, export & import full data must be useful

[blocker] keycloak authorization stopped working

it was fine, but now after successful login, calling the API results a 401 error

image

Keycloak logs:

2024-06-15 15:17:23 2024-06-15 12:17:23,870 WARN  [org.keycloak.protocol.oidc.utils.OAuth2CodeParser] (executor-thread-3) Code 'b079eece-82b8-41ef-a062-77100e1f9f1e' already used for userSession 'fe070419-2860-42ca-a376-6c55c3eaf1ca' and client 'dd87e434-f444-44af-84ef-46c57801ad5a'.
2024-06-15 15:17:23 2024-06-15 12:17:23,871 WARN  [org.keycloak.events] (executor-thread-3) type="CODE_TO_TOKEN_ERROR", realmId="flashcards-realm", clientId="flashcards-client", userId="null", sessionId="fe070419-2860-42ca-a376-6c55c3eaf1ca", ipAddress="172.20.0.1", error="invalid_code", grant_type="authorization_code", code_id="fe070419-2860-42ca-a376-6c55c3eaf1ca", client_auth_method="client-secret"

How to reproduce

  1. Go to tutor-deploy and run docker-compose -f docker-compose-app.yml up flashcards-db flashcards-keycloak flashcards-app (or just docker-compose -f docker-compose-app.yml up)
  2. open http://localhost:8080 and log-in with credentials demo:demo
  3. in browser open dev-tools (F12), see error
    or
    get token:
curl --location 'http://localhost:8081/realms/flashcards-realm/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=flashcards-client' \
--data-urlencode 'username=demo' \
--data-urlencode 'password=demo' \
--data-urlencode 'grant_type=password'

send POST to server:

curl --location 'http://localhost:8080/v1/api/dictionaries/get-all' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{"requestId":"9BEBD87D-A41B-724A-D4C9-42A83432A5E4","requestType":"getAllDictionaries"}'

Additional details

keycloak admin console: localhost:8081 dev:dev
realm: https://github.com/crowdproj/opentutor/blob/main/tutor-deploy/data/keycloak/flashcards-realm.json
Dockerfile: https://github.com/crowdproj/opentutor/blob/main/tutor-deploy/keycloak.Dockerfile
Web-client: https://github.com/crowdproj/opentutor/blob/main/frontend/src/main/resources/static/api.js#L35
Web-server: https://github.com/crowdproj/opentutor/blob/main/app-ktor/src/main/kotlin/AppMain.kt#L92
App-settings: https://github.com/crowdproj/opentutor/blob/main/app-ktor/src/main/resources/application.conf#L30

flash-cards client:

image

database refactoring

  • db-mem: for internal file storage use json files instead of lingvo-xmls
  • db-pg: remove languages table: it can be replaced by local data, e.g. using java.util.Locale.getAvailableLocales()
  • db-pg: remove examples and translations tables: add corresponding columns to cards table, i.e. cards#examples (json), cards#translations (jsonb)
  • db-pg: additional cards columns: forms (jsonb), statistics (json), details (json) (+ created (datetime), updated (datetime) ?)
  • db-pg: additional dictionaries columns: settings (+ created (datetime), updated (datetime) ?)
  • db-pg: additional users columns: settings

pre-built dictionaries

for new users it would be convenient to have some ready dictionaries (irregular verbs, weather)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.