Archived
1
0
Fork
You've already forked csm-server
0
Crowd-Sourcing Manager - server side
This repository has been archived on 2025年12月20日. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 88.8%
  • Gherkin 11.2%
2019年09月13日 00:00:07 +02:00
csm Activate admin doc 2019年09月13日 00:00:07 +02:00
features Add unimplemented gherkin features 2019年09月08日 19:10:05 +02:00
plugins Create a simple Rest API to GET/POST plugins and users 2019年09月12日 23:41:47 +02:00
.gitignore Create a simple Rest API to GET/POST plugins and users 2019年09月12日 23:41:47 +02:00
CONTRIBUTING.md Create basic Plugin model and run first database migration 2019年09月12日 21:43:53 +02:00
LICENSE Fix license 2019年09月12日 20:23:26 +02:00
manage.py django-admin startproject csm . 2019年09月12日 20:24:15 +02:00
README.md Create a simple Rest API to GET/POST plugins and users 2019年09月12日 23:41:47 +02:00
requirements.txt Create a simple Rest API to GET/POST plugins and users 2019年09月12日 23:41:47 +02:00

CSM server

This is the CSM backend repository that hosts plugins metadata, typically used by project developers.

CSM clients, typically used by end-users, are not implemented yet, come later!

A word about CSM

CSM (Crowd-Sourcing Manager) is a generic plugin manager that helps developers to write plugin-based softwares, while keeping focus on their project. It aims to make plugin management easier for both developers and users.

API

The CSM server (this repository) doesn't provide a user interface: it only communicates with external CSM clients through the CSM Rest API.

The CSM web UI (not included in this repository) is just an CSM client among others (like the CLI client).

graph LR
 server[CSM server]
 web_client[CSM web client]
 other_client[other CSM client: GUI, CLI, etc.]
 server-- CSM API ---web_client
 server-- CSM API ---other_client

Installation

Prerequisites

You will need git and python3 to install CSM. For instance, on Debian-based you can install them with:

sudo apt install git python3

Download sources

First, get latest CSM-server sources with git:

git clone https://framagit.org/roipoussiere/csm-server.git
cd csm-server

You are now on the CSM-server sources root. All commands in the next instructions must be executed from this path.

Create a virtual environment

This project depends on various Python modules that you probably don't want to mix with Python modules already installed on your system, that can be, moreover, on other versions.

Therefore you should create an isolated environment with python venv before installing modules:

python3 -m venv .venv
source venv/bin/activate

Note that the environment name starts with a . in order to prevent shells to display it by default, which is handy when using some commands like tree.

Install Python modules

You can now use pip to install all necessary Python modules that are listed the requirements file:

pip install -r requirements.txt

Initialize database

CSM-server uses Django's migration tool to deal with SQL migrations. To initialise a new CSM database, run:

python manage.py migrate

Test your installation

CSM development is behavior-driven, using the Gherkin syntax to write the features in a natural language.

You can take a quick look at these features files in order to understand the CSM behavior, then execute these tests with Behave, a module used to run Gherkin test on Python projects:

python manage.py behave

Green everywhere? Hurrah!

Start CSM server for development

Now each time you want to run the CSM server, from the repository root, run:

source .venv/bin/activate # if not already done
python manage.py runserver

A message similar to this should appear, informing you that your local CSM server is currently running:

 * Serving Flask app "app/main.py" (lazy loading)
 * Environment: development
 * Debug mode: on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 233-545-365

Try your CSM server

You can open up a new prompt to test out the CSM API using curl:

curl http://127.0.0.1:5000/plugins

You can also use the API documentation's sandbox (see below).

What's next? You may want to install a real CSM client to easily test your new CSM server in more details, and start managing plugins!

API documentation

You may probably want to know more about available API routes. Good news: you can now take a look at the generated API documentation at http://localhost:5000/ with you favorite web browser.

This API documentation includes a sandbox that allows you to directly test the whole API from your browser, instead of using curl commands, by clicking on th Try it out button.

Contributing

Thank you for you interest! ️You can contribute to CSM in several ways, including ways without writing code. The contribution guide is waiting for you.

License

MIT