GithubHelp home page GithubHelp logo

purplepalette / sp-api-v2 Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 555 KB

SweetPotato backend version 2 (sonolus-express)

License: GNU General Public License v3.0

TypeScript 68.70% JavaScript 1.77% Dockerfile 2.67% Python 24.78% HTML 2.08%
sonolus pppt-sp

sp-api-v2's Introduction

sonolus-uploader-core2 (backend for sonolus)

Another public sonolus server api to manage user generated levels. Other contents can be added by directly put into db/source folder and sonolus-packing.

Objectives

I made sonolus-uploader-core before. But it was highly depended on firebase, and hard to change sonolus resources. Also when we run it on production, it was easy to make bandwidth cost too much. So I isolated firebase as possible as I can. Now it just requires firebase-admin to authorization. Biggest change is now resources are just placed as files. Wow, it's really simple!

Note: As I and burrito said, this is not recommended to big community. Just for starting a new sonolus server.

Features

  • Users can upload files from API.
  • Users can upload new level, update level, and delete level. (sure it needs authorization)
  • Admins can add/edit/remove engines, backgrounds, effects, particles, and skins with just put to folder (also need sonolus-pack)

Strategy

  • Database is folder-structure based on this server.
  • Easy maintainable to newbies.

Running Requirements

  • Node.js
    • This project targets Node.js 14. Not tested in other versions.
  • Firebase Authorization
    • This api depends it to verify the user.
  • Memory
    • This api keeps the whole database on memory.
    • I recommend bigger memory, if you try to make big community.
  • Storage
    • This api saves entire files in db folder.
    • I recommend bigger storage, if you try to make big community.

Installation

(Install node.js 14.X)
npm install -g yarn
git clone -b main https://github.com/PurplePalette/sonolus-uploader-core2
cd sonolus-uploader-core2
yarn install
(Open config.ts and change config to your own)
(Remove examples and add your own files to db/source)
yarn run pack
yarn run start
(Now you can access your server from sonolus client!)

Sonolus Links

License

GPL

Powered by OpenAPI

The client requests to this server is validated with by the express-openapi-validator project. By using the OpenAPI-Spec from a remote server, you can easily generate a client. To see how to make this your own, look these: README / ServerSpec

sp-api-v2's People

Contributors

dosugamea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sevenc-nanashi

sp-api-v2's Issues

[FEATURE] サービス終了のため ユーザーのアップロードしたファイルのダウンロード機能を追加する

概要 / Overview

サービス終了にあたり、データをエクスポートする機能を追加する。

機能の詳細 / Feature details

  • エンドポイント: GET /levels/:levelName/download
    • 指定されたlevelNameのフォルダをまるごと読み出し、ZIP化して返す
    • ユーザー認証を必須とする
    • 一括ダウンロードは Webフロントエンド側で実装する
  • 懸念
    • 読み取り負荷
      • 一斉にDLリクエストが来ることはないと判断し、許容する。

関連Issue

PurplePalette/sp-front-v1#332

参考文献 / References

このファイルにエンドポイントを足す
https://github.com/PurplePalette/sp-api-v2/blob/dev/potato/levels.ts

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.