Code Monkey home page Code Monkey logo

schutzstreifen's Introduction

Schutzstreifen

A web application that displays a map with user-contributed hazards for cyclists. Built with the Buffalo framework.

What's the meaning of the project name?

"Schutzstreifen" is German for "protective strip". In legal terminology, it describes the kind of cheap bicycle path that gets painted on the road, often leading to conflicts between drivers and cyclists due to cars parking on or too close next to the strip, close passes on the road, among others. Many of these contraptions are inherently unsafe for cyclists, which has earned them the nickname of "Gefährdungsstreifen" (literally "hazard strip").

⛔️ Attention: Work in progress ⛔️

This application is not feature ready yet (as in: pre-alpha status):

  • Several routes are only implemented in the most basic way possible
  • Validation and error handling require work to improve security and user experience
  • The frontend is pretty bare-bones right now and needs a lot of love and polish to be presentable
  • Every single user has access to all POST endpoints, which is not desirable - there should be an admin user e.g. for managing available hazard types, removing users etc.

When the first alpha is ready, the app will be made available online. You can always download the code and run it on your local machine, of course.

Installation

If you are setting up the application for the first time, use the following make target:

make setup

Run locally

For development, having Go and Go dev tools installed on your machine is extremely helpful.

Instead of also installing Buffalo and PostgresSQL, you can simply run the app with Docker. Otherwise, please refer to the Buffalo documentation on how to run the framework natively.

Use the following make commands to start/stop the containers:

make start
make stop

When all containers are up, the application is available at http://localhost:22080/

To see debug output (logs) during development, use the following start command instead:

make start-dev

Display container log output

With the default start target, containers are started in detached mode. If you prefer running them in the foreground, use the make start-dev target instead.

Run tests

make test

Buffalo CLI

Use this shortcut to open a shell inside the dev container. You can then use the full Buffalo CLI, including Pop for setting up the database and running migrations:

make cli

Force rebuilding containers

This will skip the Docker build cache.

make build-containers

Compile CSS

Create CSS files from Sass sources:

make css

Run database migrations

Execute all migrations (only works if the database already exists).

make migrate

schutzstreifen's People

Contributors

dependabot[bot] avatar tardog avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

schutzstreifen's Issues

existance of running instance

First things first: I love the idea of the project!
Another thing: is there an instance running somewhere? Or is it supposed to be running for each campaign on its own? Please expand the question as you see fit to elaborate :)

Improve validation of user input

Validation needs to be concise, clear, and prevent unexpected or malicious input whenever possible. Types are enforced during request model binding - maybe validation should happen before that to prevent the application from running into an error.

In addition, the errors should to be presented nicely on the frontend.

Clean up duplicated code and comments

During experimenting and learning the Gobuffalo framework, a lot of duplicate boilerplate code has been introduced, along with a huge amount of single-line comments explaining what the code does (as if that wasn't obvious).

The comments should be cleaned up, and code duplication should be reduced where it seems sensible to do so.

Add more tests. A LOT more tests.

The app needs better test coverage. Every important route should at least be covered by integration tests (using a test database), including happy cases and error cases.

Since there is very little business logic - as opposed to framework code - testing isolated units should be considered only when integration testing doesn't cover everything.

Make sure all errors are handled properly

There is still debug output (stack traces) happening on several occasions. That kind of sensitive information should be logged somewhere, but not exposed to the user by the frontend.

Implement admin user with special permissions

Currently, every user has access to everything, including the CRUD for models such as HazardType or User, which should not be manageable by regular users.

The goal is to have a dedicated admin user account for this kind of higher access level. Everyone else should just be able to register, add new hazards, and edit their own hazard entries.

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.