Skip to main content

An open-source Swing chart repository server

Project description

# Swing Server Swing Server is an open-source Swing Chart repository written in Python language.

## Installation

The application can be installed from the PyPI repository using the next command.

`shell pip install swing-server `

## Requirements

To run the application, you have to provide a connection to the PostgreSQL database and some folder, where uploaded archives will be stored. You also need to install the Flask framework from the PyPI repository.

`shell pip install flask `

## Configuration

You can configure the application using environment variables.

  • SECRET_KEY Secret token for storing of the user’s session. (required)

  • DATABASE_URI PostgreSQL database URI. (required)

  • PUBLIC_URL Public address where the application will be accessible. (default: http://localhost:5000)

  • STORAGE_TYPE There is currently only single type of the storage. (default: local)

  • STORAGE_LOCAL_DIR Directory where uploaded charts will be stored. (required)

  • INIT_USER_EMAIL E-mail of the initial user that will be created after server start-up. (default: none)

  • INIT_USER_PASSWORD Password of the initial user. (required)

## Server Startup

The application can be started as a Flask server using the next command.

`shell FLASK_APP=swing_server flask run `

## Server API

  • GET /status Return current server status, and a number of created charts.

  • GET /chart?query=<keyword> Return list of all charts. If the query is specified, then filter charts by their name or description.

  • GET /release?chart=<chart_name> Return list of all releases for the specific chart. Releases are ordered by the version.

  • GET /release/<chart_name>-<version>.zip Download specific release of the chart. The filename can be for example redis-1.0.0.zip.

  • POST /release Upload a new release of the chart. If the chart does not exist, then a new one is created. The archive has to be sent as a multipart form under the chart key with the Content-Type header set to multipart/form-data.

  • DELETE /chart/<chart_name>?version=<version> Remove chart both from the database and from local storage. If the version is specified, then remove only the specific release.

  • POST /login Login user using encoded credentials sent in the Authorization header of the request. It is used the Basic type of authorization in this format <username>:<password>.

  • POST /logout Log out currently logged user.

## Project Requirements

### Functional Requirements - List all uploaded charts. - Get the detail and releases of the chart. - Download a specific version of the chart. - Upload a new version of the chart. - Retrieve server status information.

### Nonfunctional Requirements - Charts should be stored in the server filesystem. - The server can be configurable using environment variables. - Editing of charts has to be secured by user authentication. - New chart storage should be easily implementable.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swing_server-0.1.tar.gz (13.8 kB view details)

Uploaded Source

File details

Details for the file swing_server-0.1.tar.gz.

File metadata

  • Download URL: swing_server-0.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/50.3.2.post20201201 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.9

File hashes

Hashes for swing_server-0.1.tar.gz
Algorithm Hash digest
SHA256 f025d7a1cd1c51c4be49c2a5ef142cd2680b6209d851bb3f9d3d7d7b649e1cb1
MD5 496d75ff970be0e46d6c6074db25e9d9
BLAKE2b-256 4829ac2a4b4c15e588cacdec635a29e506e8afd1033bbc1c32829e7b882e15ce

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page