Giter VIP home page Giter VIP logo

hotshowers.org's Introduction

hotshowers.org Travis Coveralls Gitter License MIT

A complete re-write of warmshowers.org.

Why?

I love warmshowers.org, but I feel the technical choices made during development were made out of convenience, not because they were the right choices.

I would love to see more contributions to warmshowers.org, but was frustrated myself with having to learn out-dated frameworks, having very little documentation and pretty much nothing in the way of quality assurance.

How?

  • PHP7 backend (which is pretty much only an API)
  • TypeScript/JavaScript frontend (all website related stuff, templating etc.)

Features

  • a user has a username, email, address, phone number, latitude and longitude and password
  • an address consists of a city, zip code, country, street and house number
  • a user can find other users by username, name, email and city
  • a user can write messages to other users
  • a user can write a request to other users
  • a user has a profile
  • a user can reply to a message
  • a new user has to sign up

Design Decisions

Immutability

All value objects have to be immutable. If a setter or add method is required, it shall return a new instance.

__toString() and toString() on value objects

All value objects have to implement __toString() and toString(). The implementation of __toString() shall call toString(). __toString() should never be called from the code (magic method). Instead use toString() for consistency with other scalar getters.

Exposing scalar values on value objects

Value objects which wrap a scalar value (e.g. string as the internal representation of Username) shall expose (i.e. only if necessary) them using a toX() method (e.g. toString(), toInt(), ...).

Type hints

Using type hints for return values and parameters is mandatory.

Git commit messages

Messages have to meet the following requirements:

  1. Separate subject from body with a blank line
  2. Limit the subject line to 50 characters
  3. Capitalize the subject line
  4. Do not end the subject line with a period
  5. Use the imperative mood in the subject line
  6. Wrap the body at 72 characters
  7. Use the body to explain what and why vs. how

For more info check out Chris Beams excellent post on How to write a Git Commit Message

Code Quality

  • Line Coverage has to be at least 95%, but usually there shouldn't be any reason to drop below 100%
  • All tests have to add @covers and @uses annotations to the test class (not the methods)
  • Code has to pass PSR-2 style guidelines (see style task in the Makefile)

hotshowers.org's People

Contributors

markusrodler avatar mihaeu avatar

Watchers

 avatar  avatar

Forkers

gitter-badger

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.