Giter VIP home page Giter VIP logo

zoonk's Introduction

Zoonk Banner

WARNING: This software is still in development and not ready for production. I'm making several changes to it. DO NOT USE IT IN PRODUCTION YET. The current version will break when v1.0 is released. I'll update this README when it's ready for production.


Open-source alternative to create interactive courses like Duolingo.
Learn more »

Roadmap . Community

About this project

Interactive learning is more effective than traditional methods. Learners remember 10% of what they hear, 20% of what they read but 80% of what they see and do. That's why 34 hours of Duolingo are equivalent to a full university semester of language education.

We love Duolingo. We think those kind of interactive experiences should be used in more fields. That's why we're building Zoonk, an open-source platform to create interactive courses like Duolingo.

Tech stack

We're deploying our cloud products to Fly and Neon.

Getting started

Follow the instructions below to get Zoonk up and running on your local machine. We have a Dockerfile but that's used for deploying our demo app to Fly. We don't have a Docker setup for local development yet. PRs are welcome!

Requirements

  • You need Elixir 1.15 or later and Erlang 26 or later. Run elixir -v to find your current version for Elixir and Erlang.
  • Install Hex: mix local.hex.
  • Install Phoenix: mix archive.install hex phx_new.
  • PostgreSQL 15+.
  • (Linux users only): inotify-tools.

Local development

  • Run mix setup to install both dependencies and set up both the database and assets.
  • Run mix seed to fetch some initial data to the database (See options).
  • Run mix phx.server to start a development server.
  • Run mix test to run tests.
  • Run mix ci to run our code quality checks.
  • Run mix locale to update translation files.

SSL on localhost

Prefer to do local development using SSL to resemble production as much as possible. You can use mkcert to generate a certificate. After you install mkcert, follow the steps below:

  • Create a cert directory under priv: mkdir priv/cert.

  • Generate a new certificate: mkcert -key-file priv/cert/selfsigned_key.pem -cert-file priv/cert/selfsigned.pem localhost zoonk.test "*.zoonk.test" apple.test.

  • Run mkcert -install to install the certificate in the system trust store.

  • You may also need to enable Allow invalid certificates for resources loaded from localhost on Google Chrome flags.

  • Restart your local server: mix phx.server. You may also need to restart your browser.

    You also need to make sure your machine maps localhost to a test domain (we're using zoonk.test for this guide). dnsmasq allows you to resolve domains to your local machine without having to change your /etc/hosts file. To install dnsmasq:

brew install dnsmasq

# Create a configuration directory
mkdir -pv $(brew --prefix)/etc/

# Set up your domains
echo 'address=/zoonk.test/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf
echo 'address=/.zoonk.test/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf
echo 'address=/apple.test/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf

# Add dnsmasq to your resolver
sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/zoonk.test'
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/apple.test'

# Start dnsmasq
sudo brew services start dnsmasq

That's it! You can now start your local server (mix phx.server) and test your domains using:

Mailer

We're using Resend to send emails. To make it work in production, you need to set the following environment variables on your server:

  • RESEND_API_KEY: Your Resend API key.

Storage

By default, we upload files to your local server and store them in the priv/static/uploads directory. However, we also support uploading files to Cloudflare Images. To use Cloudflare Images, you'll need to set the following environment variables on your server:

  • CLOUDFLARE_ACCOUNT_ID: Your Cloudflare account ID. You can find it on Cloudflare Dashboard > Images > Overview.
  • CLOUDFLARE_ACCOUNT_HASH: Your Cloudflare account hash. You can find it on Cloudflare Dashboard > Images > Overview.
  • CLOUDFLARE_API_TOKEN: Your Cloudflare API token. You can create a token on Cloudflare Dashboard > My Profile > API Tokens.

Stripe

We use Stripe for processing payments. If you want to enable subscriptions, you need to set the following environment variables on your server:

  • STRIPE_API_KEY: Your Stripe API key.
  • STRIPE_WEBHOOK_SECRET: Your Stripe webhook secret.

Plus, you need to create a product for your subscription. We call this plan flexible and you can't customize plans at the moment. We fetch the price from the Stripe API, so make sure you add the zoonk_flexible lookup key to your price.

Stripe can only be enabled for saas and marketplace apps. Make sure to choose one of those options when you first run this app.

Sponsors

zoonk's People

Contributors

abdulsami455 avatar dependabot[bot] avatar peterdavehello avatar teslima02 avatar udoncodes avatar wceolin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

zoonk's Issues

Dashboard: List schools

Main school: SaaS

Main school: White Label

Lessons: Allow open-ended steps

Users can write the answer instead of choosing options. Then, we connect to a LLM to evaluate the answer. Teacher needs to input what would be the acceptable answer and why.

LLM returns a feedback to say if it's correct or not and why.

What's the correct answer and why?

What would be wrong answers and why?

no function clause matching in UneebeeWeb.Live.UserSettings.get_page_title/1

Sentry Issue: UNEEBEE-9

FunctionClauseError: no function clause matching in UneebeeWeb.Live.UserSettings.get_page_title/1
  File "lib/accounts/user_live/user_settings.ex", line 151, in UneebeeWeb.Live.UserSettings.get_page_title/1
  File "lib/accounts/user_live/user_settings.ex", line 30, in UneebeeWeb.Live.UserSettings.mount/3
  File "lib/phoenix_live_view/utils.ex", line 394, in anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
  File "/app/deps/telemetry/src/telemetry.erl", line 321, in :telemetry.span/3
  File "lib/phoenix_live_view/channel.ex", line 1127, in Phoenix.LiveView.Channel.verified_mount/8
...
(3 additional frame(s) were not displayed)

Marketplace: Add course price

Schools are billed per user for free courses with commercial purposes. Free courses for educational purposes are exempt. Allow to apply for an exemption.

SEO: Allow public pages for public schools

UneeBee requires users to be logged in at the moment. This means no pages are indexed by search engines, hurting SEO. For public schools, we should allow content pages to be indexed.

### Public pages
- [ ] Home
- [ ] Course list
- [ ] Course view
- [ ] Lesson view
- [ ] For private schools, all pages should be private

Notes

  • We display two different lesson views: for logged in users, they can start playing the lesson. If the user isn't logged in, then we display some basic information about the lesson and a play button.
  • Make sure to add a description and social tags to all public pages.

MatchError: no match of right hand side value: %{host: "app.uneebee.com", current_user: #Uneebee.Accounts.Use...

Sentry Issue: UNEEBEE-8

MatchError: no match of right hand side value:
  File "lib/content/course_live/lesson_play.ex", line 14, in UneebeeWeb.Live.LessonPlay.mount/3
  File "lib/phoenix_live_view/utils.ex", line 394, in anonymous fn/6 in Phoenix.LiveView.Utils.maybe_call_live_view_mount!/5
  File "/app/deps/telemetry/src/telemetry.erl", line 321, in :telemetry.span/3
  File "lib/phoenix_live_view/channel.ex", line 1127, in Phoenix.LiveView.Channel.verified_mount/8
  File "lib/phoenix_live_view/channel.ex", line 84, in Phoenix.LiveView.Channel.handle_info/2
...
(3 additional frame(s) were not displayed)

Billing: Display usage and next payment

Tasks

Sidebar: Home link is active when opening a course

Feedback from the demo app:

When I open a course, the home link in the sidebar is shown as active. Seems like a bug.

Context

This is happening because the home loads the most recent course. So, the home is considering the course view as an active page.

Proposal

We should probably change this logic to make the home link active only when the user is actually at the home page (or the most recent course).

If the user just clicked on a course link, then the courses menu should be active instead.

Store how long a user took to complete a lesson and each step

This is going to be useful to check where students are struggling and how we can improve certain areas of the learning experience. It can also be useful to us internally because if users are spending too much time on a step, then we might need to make that step simpler.

Billing: Allow school manager to connect to Stripe

Main school

Child school

Stripe

Billing: Require paid plan for child schools if they have more than 5 users

Tasks

Setup: Allow to create a white label app

UneeBee only allows us to create one school at the moment. For Wikaro, we're going to be able to have multiple schools that can work as white-label. We need a setup that allows new schools to have a subdomain or custom domain. For example:

  • apple.wikaro.test
  • learning.apple.com

This issue should map the required work to provide a minimal version of this functionality. We should make it as simple as possible. Payments and automatically configuring custom domains are out of the scope. For now, users should only be able to set their custom domain in the school settings (and send us an email to configure their custom domain). If people start using this functionality, then we can automate it.

Create school

Menu

Notes

  • A child school is a school whose school_id is not nil.

Courses: Use app's library

If a school has a library subscription, then it can import lessons from the app's library. It can import individual lessons to build custom courses - or import the entire course.

Users: Handle registration for child schools on white label apps

Allow duplicated users as long as the school_id is different. This way users can have different credentials for each school.

Tasks

no match of right hand side value: {:error, %Resend.Error{}}

Sentry caught the following error:

MatchError: no match of right hand side value: {:error, %Resend.Error{name: "validation_error", message: "Invalid `to` field. The email address needs to follow the `[email protected]` or `Name <[email protected]>` format.", status_code: 422}}
  File "lib/accounts/user_live/registration.ex", line 29, in UneebeeWeb.Live.Registration.handle_event/3
  File "lib/phoenix_live_view/channel.ex", line 487, in anonymous fn/3 in Phoenix.LiveView.Channel.view_handle_event/3
  File "/app/deps/telemetry/src/telemetry.erl", line 321, in :telemetry.span/3
  File "lib/phoenix_live_view/channel.ex", line 246, in Phoenix.LiveView.Channel.handle_info/2
  File "gen_server.erl", line 1077, in :gen_server.try_handle_info/3
  File "gen_server.erl", line 1165, in :gen_server.handle_msg/6
  File "proc_lib.erl", line 241, in :proc_lib.init_p_do_apply/3

There are two issues here:

  1. We're not catching errors when sending registration emails.
  2. Our email validation isn't working properly. In that case, a user registered with an test@test email, which is invalid. We should fix that validation.

School: Support library option

Add a setting to schools that allow them to have a library. When this option is enabled, child schools may be able to use courses from the host school on their own school.

Users: Allow to search by name, username or email

Allow to search users both on the school and course user lists.

School users

Course user

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.