Giter Site home page Giter Site logo

migarl / smartbeans Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smartbeansgoe/smartbeans

0.0 0.0 0.0 1.95 MB

Programming learning platform for C and Python

License: MIT License

JavaScript 7.62% TypeScript 37.13% CSS 0.69% HTML 0.19% Svelte 54.38%

smartbeans's Introduction

SmartBeans v3

What is SmartBeans?

SmartBeans is a gamified learning platform for programming languages. More screenshots here!

Installation instructions

Prerequisites

  • Install npm nodejs.
  • Install postgres

Installation

  1. Clone the repository.
  2. Create a database and database user:
    • mysql
    CREATE DATABASE smartbeans;
    CREATE USER 'user'@'localhost' IDENTIFIED BY 'change-this-password';
    GRANT ALL PRIVILEGES ON smartbeans . * TO 'user'@'localhost';
    • Configure knexfile.js
      • change db url
      • change probably the port number
      • add database name
      • add database user
      • add database user password
  3. Configure the following on src/config.ts:
export default {
  sessionDuration: 43200,
  staticAchievementPath: '/achievements',
  staticAssetPath: '/assets',
  padUrl: 'url-to-hedgedoc',
  sandboxUrl: 'url-to-sandbox',
  achievementUrl: 'url-to-achievement-checker',
  registrationKeys: ['change-me'],
  apiKeys: ['change-me'],
  TOKEN_LENGTH: 36,
  ltiConsumerSecret: 'secret',
  leaderboardUsersLastSubmissionTimeout: 1000 * 60 * 60 * 24 * 30
};
  1. Initialize the node_modules via running:
npm install
  1. Install knex-cli
npm install knex -g
  1. Run migrations
knex --esm migrate:latest
  1. Add assets
  • Clone the smartbeans-content repository.
  • Run:
    1. cd smartbeans-content
    2. python src/generate-output.py
    3. `cp out/assets smartbeans/static/assets
  1. Build smartbeans
npm run build
  1. Create a systemd service smartbeans.service:
[Unit]
Description=The SmartBeans Backend
After=network.target

[Service]
Type=simple
User=change-me
Group=change-me
WorkingDirectory=path-to-smartbeans-build-folder
ExecStart=PORT=8080 node index.js
Restart=on-failure
# Other restart options: always, on-abort, etc

[Install]
WantedBy=multi-user.target
  1. Start the service:
systemctl start smartbeans.service
  1. Insert asset ids into smartbeans Go in the smartbeans-content repository and run the following:
python pipeline.py --url https://smartbeans-domain.tld/api/admin/asset --admin-api-key apikey --data out/assets-backend.json

Updates

For updates call git pull, build smartbeans and restart the service.

License

Copyright (c) 2021 Ole Umlauft and other contributors

All contents of this repository are provided under the MIT License. See LICENSE for the full text.

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.