GithubHelp home page GithubHelp logo

teikei / teikei Goto Github PK

View Code? Open in Web Editor NEW
57.0 6.0 10.0 44.28 MB

A web application that maps out community-supported agriculture in Germany, Switzerland, and Austria, based on crowdsourced data.

Home Page: https://ernte-teilen.org/karte

License: GNU Affero General Public License v3.0

JavaScript 73.11% HTML 0.84% CSS 5.61% SCSS 13.71% Shell 0.04% Nunjucks 2.45% Dockerfile 0.02% TypeScript 4.23%
javascript leafletjs nodejs react csa crowdsourcing

teikei's Introduction

Production

Map CI API CI Admin CI

Preview

Map CI API CI Admin CI

Teikei

Teikei is a web application and API that maps out community-supported agriculture in Germany, Switzerland, and Austria, based on crowdsourced data.

It is used by

Introduction

The repository is a monorepo consisting of 3 modules:

API /api

Teikei API is a Node application written with Feathers using Express as a server. It exposes a JSON REST API, data is stored in PostgreSQL. It also includes a job queue built with node-schedule.

Map /map

Teikei Map is a Single Page Application built with React and Redux. It was generated with the default create-react-app with added Sass support. Uses leaflet to display the map, feathers-client to connect to the API backend, joi for validation, superagent as a REST client.

Admin /admin

Teikei Admin allows content moderators and administrators to update and manage stored data. It connects to the same Teikei API backend application as the frontend module, but through separate Admin API endpoints. It's built with crudl.io, an open-source admin dashboard.

The monorepo makes use of yarn workspaces and lerna and provides top-level scripts to run a complete Teikei application stack with a single command and to conveniently work with all 3 modules from a single repository.

Getting started

Requirements

Teikei requires node >= 18, yarn and PostgreSQL >= 9.5.

Get the code

Clone the repository and install dependencies

git clone https://github.com/teikei/teikei
cd teikei
yarn install

Configure project settings

You need to create an .env file in the root directory which contains the environment variables needed to run the project. The included .env.sample file lists the variables which need to be set.

Setup PostgreSQL database

Teikei rquires Post

Running API / Map in development mode

  • To start the map application in development mode run yarn dev
  • The map frontend will be started at http://localhost:3000. The frontend express server runs on port 3000 and will proxy request to the API server on port 3030.
  • The API server will run on http://localhost:3030

Or: Running API / Admin in development mode

  • To start the admin application in development mode run yarn dev-admin
  • The admin frontend will be started at http://localhost:4000. The frontend express server runs on port 3000 and will proxy request to the API server on port 3030.
  • The API server will run on http://localhost:3030

Build for production

  • Build the project for production with yarn buildeither in the root directory to build all modules or individually in module subfolders. The build output will be copied to the /build folders of modules.

Test data

  • To create initial data, run knex seed:run inside the /api folder
  • The command will create the following test users
username password roles
[email protected] admin superadmin
[email protected] admin admin
[email protected] admin user

Roadmap

We use Taiga to plan upcoming features and track bugs. If you want to participate, it's probably a good idea to look for open issues there. Before working on bigger features, however, it's advisable to get in contact with us, so that we can coordinate progress a little.

Report a bug

Bugs, Issues and Feature requests can be added as issues here on Github, they will be automatically exported to our Taiga Bug tracker.

Authors & contributors

License

teikei's People

Contributors

crijke avatar dependabot-preview[bot] avatar dependabot[bot] avatar depfu[bot] avatar johnjohndoe avatar k-nut avatar sjockers avatar tessi avatar zonque avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

teikei's Issues

Implementation of places without owners not correct, causing exceptions.

Implementation of places without owners is incorrect:

  • When a user account is deleted, the corresponding ownership-models are not deleted, which leads to exceptions and breaks the application. (10c403a fixes this)
  • Places without owners should have their contact form replaced with a message text (something like 'this place has no owner. if this is your place, contact us to claim it')

Redesign: Update header / user navigation

Currently, the navigation does not work properly across screen sizes. Especially the mobile version is broken, with some navigation items not accessible.

This should be updated to make all navigation items work properly across screen sizes.

"Melde dich an" link not working

The pop-up window named So funktioniert's has a link at the bottom of the text entitled Melde dich an.

melde-dich-an

There is nothing happening when I click the link.

Enable website URL for depots

A user asked for entering the individual website URL of their depot. The property is not available in the API nor the wizard at the moment.

Travis: Exception for Coveralls

The following error can be found in the Travis build logs ...

[Coveralls] Submitting to https://coveralls.io/api/v1
Coveralls encountered an exception:
RestClient::UnprocessableEntity
422 Unprocessable Entity

/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `block in transmit'
/home/travis/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/net/http.rb:853:in `start'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/home/travis/.rvm/gems/ruby-2.1.1/gems/rest-client-1.6.7/lib/restclient.rb:72:in `post'
/home/travis/.rvm/gems/ruby-2.1.1/gems/coveralls-0.7.0/lib/coveralls/api.rb:18:in `post_json'
/home/travis/.rvm/gems/ruby-2.1.1/gems/coveralls-0.7.0/lib/coveralls/simplecov.rb:72:in `format'
/home/travis/.rvm/gems/ruby-2.1.1/gems/simplecov-0.8.2/lib/simplecov/result.rb:46:in `format!'
/home/travis/.rvm/gems/ruby-2.1.1/gems/simplecov-0.8.2/lib/simplecov/configuration.rb:139:in `block in at_exit'
/home/travis/.rvm/gems/ruby-2.1.1/gems/simplecov-0.8.2/lib/simplecov/defaults.rb:54:in `call'
/home/travis/.rvm/gems/ruby-2.1.1/gems/simplecov-0.8.2/lib/simplecov/defaults.rb:54:in `block in <top (required)>'

{"message":"Couldn't find a repository matching this job.","error":true}

It seems to not affect the build though.

Redesign: Devise views not fully usable

Problems associated with devise views:

  • Signout route does not exist / is not linked correctly
  • Delete account route does not exist / is not linked correctly
  • Edit view is not using the updated layout

Backups don't work

[2014/07/21 02:30:07][error] CLI::Error
[2014/07/21 02:30:07][error] --- Wrapped Exception ---
[2014/07/21 02:30:07][error] Config::Error: Invalid Configuration File
[2014/07/21 02:30:07][error]   The configuration file at '/home/teikei/Backup/config.rb'
[2014/07/21 02:30:07][error]   does not appear to be a Backup v4.x configuration file.
[2014/07/21 02:30:07][error]   If you have upgraded to v4.x from a previous version,
[2014/07/21 02:30:07][error]   you need to upgrade your configuration file.
[2014/07/21 02:30:07][error]   Please see the instructions for upgrading in the Backup documentation.

The last backup is from 2014/07/07.

Render Enumerize::Set in ActiveAdmin

Currently one cannot see the values of the following attributes in ActiveAdmin:

  • Vegetable Products
  • Animal Products
  • Beverages

All attributes are of type Enumerize::Set

Hide network does not work

When a network is shown the user cannot hide the network by simply clicking onto the map base layer. The screenshot shows the state of the map when this happens.

network

This happens when the pop-up window of a place disappears after clicking on the button which shows the network.

Introduce number interval validator

There seems to be room for improvement regarding the function validateNumber(min, max) used here. Please have a look at this post - it might be worth changing the implementation for the sake of the DRY principle.

Add a way to create a "initiative"

People who want to join a network but can't any in the neighborhood should be able to create an "initiative". The idea is that such people are informed when a new farm is registered in their range. Probably such entries should also time out after a while in order to avoid orphans.

Track website activity, add metrics and monitoring

It would be useful to have a more detailed overview about recent activities on the website. One option would be to add dates to the recent activities in ActiveAdmin. I think some kind of persistant transaction log would be helpful in the long term.

Usability / layout problem with registration form in Firefox

There seems to be a minor layout problem in Firefox for the sign-in/sign-up form. When the pop-up opens the user has to click on Registrierung für neue Nutzer. Then the tab switches but the content of the form does not update (see screenshot). Also, the sign-up tab slides under the sign-in tab.

registrierung

When the user clicks a second time onto the tab the content changes.


The problem occurs in Firefox 29.0. on Ubuntu 14.04. Please check for the same problem in other browser on other operating systems.

Add support for commodities

Currently, the goods a farm offers are stored in a comma separated list in database fields. Change that so each commodity is stored and referenced as proper database object, so we can implement filters and more advanced search features.

Add image dimensions information

Please add information to the place wizard which let the user know what the image dimension should be like. Currently 400 x 300 pixels seems to be fine.

Transfer cookies via SSL only

It might be interesting to enable SSL for cookie transfer here. As an inspiration: this post ...

Teikei::Application.config.session_store :cookie_store, key: '_teikei_session', 
                                                        secure: true

or

Teikei::Application.config.session_store :cookie_store, key: '_teikei_session', 
                                                        secure: Rails.env == 'production'

ActiveAdmin: Count or link related places

For a faster support it would be nice if ActiveAdmin links the associated places to a user.

  1. The simple information would be to show a counter which indicates how many places are "owned" by a user.
  2. The extended information would be to provide a clickable link to the farms/depots view which is filtered by the user id.

Website redesign

2014-05-07_home


2014-05-07_map

This is a major task and should probably be broken apart into separate issues.


Possible sub-task (ordered by priority):

  • Implement marker clustering using Leaflet.Markercluster – extracted to #45.
  • Replace typekit font-embed with Fira font family, installed via bower – extracted to #48
  • Update general styling of map (see design comps above)
  • Use responsive design techniques to make the map work on mobile devices (to be specified)#3, #68, #69
  • Implement homepage as a separate rails view (see design comps above)

Update to devise 3

Upgrade to devise 3, and solve the authentication token used by the frontend code.

i18n

In some places different terms for UI elements appear. Also mixed languages appear.

Maybe the use of Transifex can help here.

Examples:

Autoscale images

Please automatically scale images which are uploaded to a place entry.

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.