Coder Social home page Coder Social logo

astroplant / astroplant-server Goto Github PK

View Code? Open in Web Editor NEW
11.0 13.0 6.0 496 KB

This project is being deprecated, see https://github.com/astroplant/astroplant-api

Home Page: http://astroplant.io

License: BSD 2-Clause "Simplified" License

Python 51.80% CSS 3.01% HTML 42.91% JavaScript 1.93% Nix 0.35%

astroplant-server's Introduction

AstroPlant server

This repository contains the code for the back-end and website of the AstroPlant system.

The AstroPlant kits communicate with the back-end to push data. The website allows users to view the data.

The server is built using the Django framework.

Documentation

Full documentation can be found here.

Getting started

Clone the repository and cd into it.

This project has runtime dependencies on Python 3.6 and an accessible MySQL connection. Node 8 is used at build-time to prepare static resources. Required Python dependencies are listed in requirements.txt and can be installed with pip:

$ pip install -r requirements.txt

Nix

Optionally, you can use Nix to emulate a virtual environment (see shell.nix):

$ nix-shell

this installs Python 3.6 and Node 8 and makes them available in your shell environment for the duration of the shell session. It also creates a _build subdirectory and uses it as a virtual Python environment for packages.

Database

The server requires a database to function. It has only been tested with MySQL/MariaDB.

Creating a database:

To create a development database and a local user able to login without a password perform e.g.:

$ sudo mysql
> CREATE DATABASE astroplant;
> CREATE USER 'astroplant'@'localhost';
> GRANT ALL PRIVILEGES ON astroplant.* TO 'astroplant'@'localhost';

Configure AstroPlant

If you set a password, or are using a name for the database or user other than astroplant, open server/settings.py and configure the DATABASES key.

Prepare the database

There have been no releases yet and as such migrations are not yet kept track of.

Create the initial migration yourself:

$ python manage.py makemigrations

Prepare the database by running:

$ python manage.py migrate

If you would like to include some default data provided by AstroPlant, such as measurement types and official peripheral device definitions, load the AstroPlant fixture.

$ python manage.py loaddata astroplant

Prepare static resources

The static JavaScript and CSS resources have to be compiled prior to running the server.

To do this, ensure Node 8 and npm are installed. Now install the project dependencies--in the root directory of the project, run:

$ npm install

Next, build the assets to static files:

$ npm run-script build

Run the server

It is recommended to host the server through a webserver using server/WSGI.py, such as Nginx with uWGSI. See also the AstroPlant server deployment repository.

Alternatively, for development, run the server using:

$ python manage.py runserver

astroplant-server's People

Contributors

dgdekoning avatar sidneyniccolson avatar tomcur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.