Skip to content
/ osop-api Public

The REST API of OSOP, an open source software for conducting polls and surveys with a special focus on data minimization and user privacy 📊

License

Notifications You must be signed in to change notification settings

DROSL/osop-api

Repository files navigation

OSOP API

Our Simple Open Poll (OSOP) is an open source web application for conducting polls and surveys with a special focus on data minimization and user privacy. It does not collect personal data, does not set tracking cookies, and does not outsource the service to third-party solutions, but runs entirely on your own server.

Install

  1. Clone the repository:
git clone https://github.com/DROSL/openpoll-api
  1. Install required modules:
npm install
  1. Install the MongoDB server.

  2. Create an upload folder for user files, like uploads/.

Configuration

Environment variables

Set the following environment variables:

Name Type Description
NODE_ENV string Indicates whether the server is running in development or production mode.
PORT or API_PORT number The port on which the server listens.
MONGODB_URI string The URI of the MongoDB instance to connect to. (Read more)
SESSION_SECRET string The secret used to sign the session ID cookie. Sould be a random set of characters. (Read more)

Note: You can use a .env file to set the environment variables. See .env.sample as example.

Config files

The config files are located in the config/ directory and are loaded depending on the NODE_ENV environment variable. default.json is always used as fallback. The following parameters can be configured:

{
	"path": "/",
	"cookie": {
		"secure": true,
		"httpOnly": true
	},
	"upload": {
		"dest": "uploads/",
		"limits": {
			"fileSize": 104857600
		}
	}
}

Usage

Run the server with:

npm start

Testing

Import postman.json to Postman.

Documentation

Please see the documentation.

License

Please see the license.

Contributing

Before you commit, run:

npx prettier --write .

About

The REST API of OSOP, an open source software for conducting polls and surveys with a special focus on data minimization and user privacy 📊

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published