syncloud / platform

Run popular services on your device with one click
https://syncloud.org
GNU General Public License v3.0
400 stars 40 forks source link

Syncloud studio app #509

Closed klmhsb42 closed 4 years ago

klmhsb42 commented 4 years ago

would be nice to have an app to create easily new apps Screenshot Screenshot2 Screenshot3

klmhsb42 commented 4 years ago

If I take code from files app and I just want to change the name and subdomain newname.device.syncloud.it where do I have to do changes?

Only under https://github.com/syncloud/files/blob/master/.drone.jsonnet in the first line local name = "files"; and then create .drone.yml again?

Or somewhere else, too?

klmhsb42 commented 4 years ago

498

cyberb commented 4 years ago

If I take code from files app and I just want to change the name and subdomain newname.device.syncloud.it where do I have to do changes?

Yes, DNS is automatically mapped to an app name by platform nginx config.

would be nice to have an app to create easily new apps

Honestly I do not think it is possible as 90% of the time it is actually not selecting versions of languages/tools. It is:

  1. porting an app original deploy process (if there is any :)) to snap (isolated) deployments process. What tools and libs to use. What and when to start.
  2. making sure config a are changed in the right way.
  3. Also LDAP integration sometimes is not available so this need to be coded in the app language (usually as a pull request upstream like this: https://github.com/syncthing/syncthing/pull/5169).
  4. Also there are potentially other patches to the original app code to fix things like postfix (or diaspora) hard coded config paths.
  5. Writing a set of tests to make sure it works as an app, to make app version upgrades effortless.
  6. Writing UI tests to see how app looks and for future upgrades.
  7. Upgrade is another thing to automate.

So I do think I will ever be able to a thing like this, this is like automating a developer.

klmhsb42 commented 4 years ago

Thanks. I agree, to use it to create apps about existing projects it's not helpful. But, for completely new projects which are only developed for Syncloud OS it could be useful. Anyway, I'm playing around with it and even if I just learn something new, would be worth it. I will send you a link to have look when I've installed latest version under new name...

klmhsb42 commented 4 years ago

I adapted web UI from your platform repo. I'm completely new to nodejs. I would like to use the module express. I changed the package.json file as I added

,
    "@types/express": "^4.11.0",
    "typescript": "^2.6.2" 

to "devDependencies": { and

,
    "express": "^4.16.2"

to "dependencies": { like here https://www.muckibu.de/webpack-nodejs-express-fueled-typescript/ I did then npm install

If I use

var fs = require('fs');
const express = require('express');

in a compiled js file, I get Module not found: Error: Can't resolve 'fs'

Do I have to change anything in webpack.-.js? Do I have to export it somewhere?

Even adding

module.exports = {
node: {
  fs: 'empty',
},

to webpack.dev.js doesn't help anything https://stackoverflow.com/questions/39249237/node-cannot-find-module-fs-when-using-webpack

cyberb commented 4 years ago

Express is a project of the Node.js Foundation, it is a robust web framework for NodeJS. The Express framework allows building backend services with REST-APIs. For more detailed information, look here : https://expressjs.com/

Our backend is currently built on Flask which is a python web framework. I am slowly migrating parts of it to Go language with its default web framework. Do you want to change backend?

klmhsb42 commented 4 years ago

OK. Well, I would like to write user input to file (json, sh, jsonnet). I did it once using PHP. I thought I would send input data by POST using nodejs and then create the file. I would have to read how to get data from web to python or go. (I just used python a bit once for image processing on my desktop.)

cyberb commented 4 years ago

Sorry just realized this not inside platform but as a separate app right? Apps can use any technology, if you feel better having JS on client (web) and on backend (rest) then feel free. Files app for example uses python backend, but many other apps use all kinds of technologies. For example Rocket.Chat is pure JS.

klmhsb42 commented 4 years ago

Yes, I don't want to modify platform. I just used it as source as I'm beginner for nodejs. I just thought you would have a hint for me. I thought npm install installs all modules which are in package.json file. And that I just have to add express to that, instead of running $ npm install express --save.

cyberb commented 4 years ago

Should we close this as it gives false impression as if we are going to create such an app?

klmhsb42 commented 4 years ago

ok, let's close it for now. I can update you if I would have something working...