Code Monkey home page Code Monkey logo

elewant's Introduction

THIS PROJECT HAS BEEN DISCONTINUED.

Please see https://github.com/jgrossi/elephpant.me for a similar initiative.

Elewant

What is it?

Elewant is a project based on the PHP mascotte: the ElePHPant.

The idea is that we make it easier in the community to swap and share these lovely plush pachyderms. For now, you can create a herd and enter all the members that you have. In the near future, it will be possible to put your surplus ElePHPants up for trade, and request specific ElePHPants that you want to add to your herd.

But this project is more. The idea is to allow people who are interested involved. Not just by open sourcing the code so it can be contributed to, but by actually building and running it together. From idea to production and beyond.

What can be learned?

Well, the basics are pretty simple: we build, deploy and maintain a project together. This means that all the aspects of building and maintaining are areas of learning:

So some usual suspects:

  • Behaviour driven development
  • Automated testing
  • Event sourcing
  • The Symfony framework

But also:

  • Automated Provisioning
  • Deploying
  • Build pipelines
  • Logging and alerting
  • Dependency management

And eventually:

  • How to deal with legacy code ;-)

Feel free to add anything you learn, no matter how small, to <docs/lessons_learned.md>

Getting started with Docker

You will need docker on your local system:

[Docker](https://www.docker.com/)
[Make](https://en.wikipedia.org/wiki/Makefile)

Run the setup procedure with make (only required the first time):

make setup

Or up to continue working later:

make up

You should be up-and-running!

http://localhost.elewant.com/

For developers, there is a special button on the front page to generate users for your local environment. Just click on "Developer login" and you should be able to create (and log in as) randomly created users.

If you want to be able to log in with twitter, you'll need to create an application at app.twitter.com, then place your key & secret in .env.local.

Have fun!

Running tools

The project has a Makefile. Run Make without parameters to see the help:

make
make help

Running ci

You can run all the tools required to pass a build:

make ci

Or run the tests and quality assurance tools separately:

make test
make qa

Or run each individual tool:

make phpspec
make phpunit
make php-lint
make phpstan
make php-cs

Running commands inside docker containers

Run ls inside the default container (php-cli):

bin/docker ls

Run ls inside the default container of the testing environment:

bin/docker-test ls

Print usage:

bin/docker
bin/docker-test

Running Symfony Console:

bin/docker bin/console c:c
bin/docker-test bin/console c:c

Running vendor binaries:

bin/docker vendor/bin/phpunit
bin/docker-test vendor/bin/phpunit

Moar docs

You can find more docs in the /docs folder, like:

elewant's People

Contributors

adamculp avatar akiojalehto avatar carnage avatar cgrandval avatar cookieguru avatar dependabot-preview[bot] avatar dieterfu avatar edwinkortman avatar jaspernbrouwer avatar mjmeijerman avatar olivermensahdev avatar ramondelafuente avatar verschoof avatar waffle-iron avatar

Stargazers

 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  avatar

elewant's Issues

Add translations, before it's too late!

Currently, there are a lot of hardcoded texts on the website. We need to get them translations in a.s.a.p., before it's too late and we speak english forever and ever and ever...

Move inline JS to file(s) in assets folder

Except for the inline javascript. There's a (placeholder) file src/Elewant/FrontendBundle/Resources/assets/js/elewant.js, which is (emtpy, but) already used in Grunt. So I'd suggest to bind the events to to proper classes ๐Ÿ™‚
Also, we have jQuery, so no need to manually build anXMLHttpRequest ๐Ÿ˜‰

Privacy statement and terms of use

We need to actually have them, or remove the links on the template.
If we have them, it should be super simple and plain: no data is ever going to be sold. We only use your data to provide the service. Anyone can use this site.

Add a style-guide page

We can use a single page that contains all the possible elements available to build pages on the website.

That gives us as a visual method of choosing the right "component" for a certain use case, as well as example-html.

Add PHP Woolly Mammoth and pHackyderm

Two elePHPants breeds are missing! They are noted as "related species" in the field guide, so they where not added in the initial list.

Please add Woolly Mammoth and pHackyderm.

Add "relocate herd" command

A Herd does not have a location. In order to show herds on a map, we want to add a lat/long to a Herd's properties.

The "relocate herd" command can be run for all existing users by making a (console) command that takes the "country" input from Twitter and transforms that into lat/long.

After that, we should have a user-interface for changing the location of your herd, preferably on a map (resulting in lat/long coordinates).

A cool idea: for any Herds that we don't have a location for, just show them on a random place on the map with a question mark and a message to the user "Your herd is lost... help guiding them home!"

Add ShepherdId to the User model

The Herding domain works with a ShepherdId (uuid) to form new herds. Every new registered used will have their own herd - just one - based on their ShepherdId.

User adds an elephpant for trade

A Shepherd is the master of their Herd. If they wish to give up one (or more) of their Herd for adoption, they will trigger a GiveUpForAdoption command.

  • The ElePHPant is still part of the Herd, but no longer available for abandonment (the possibility for adoption must first be cancelled)
  • There might be more information required before this ElePHPant is properly available for trade, like: quality, in which actual batch it was created, location...
  • Quite possible this means the addition of the \Elewant\Trading domain in the code.

Update images/pictures used in the project

The template images have all been added to the source. All unused images can be removed.

Some images need to be replaced with our own photo's of ElePHPants - we need to do a photoshoot!

Navbar links are confusing

Due to the single page template the navbar links scroll smoothly to the area they link to.

But on different pages (in this case /herd/tending or /shepherd/[username]) the links do not point to anything on the page.

This needs to be looked at.

Use LetsEncrypt

We have an SSL certificate for elewant.com, but it would be nice to have an ansible role in provisioning to use LetsEncrypt for this project.

Non-twitter login

Since our application can only login with Twitter, we want a button that visitors can press to let us know If they have no twitter.

For Developers, being able to log in should not be connected to Twitter (they won't have our application codes) so a basic existing user could be added to the fixtures to allow a developer to log in without actual twitter login.

(this can then be extended to a production registration/login process without Twitter, but that is a separate issue)

Add a processmanager to hande forming a new herd for every registered user

When a user joins Elewant, we agreed on automatically forming a new herd for every user to simplify the initial application.

This change proposes a processmanager that can respond to events with new commands. The command in this case being formAHerd whenever a newUserHasRegistered.
(note that at this point, both the command and the event do not exist yet)

Add storage for events

Since we're using the Prooph event-sourcing library, we should also implement Prooph event-store.

Use correct data for a shepherd page

Currently, the /shepherd/{username} find a Herd not by searching for a User with user::username, but by querying for a Herd with herd::name instead.

This solves the problem of creating links to these shepherd pages in places where we only have access to a Herd, like the "newest Herds list". But it would also be the case in a search page.
So "create a link to the public page of this herd" in a view is a difficult problem if the Herd does not know the shepherds name but only the shepherdId.

Using the Herd::name is a workaround for now because we automatically create a herd with the same name as the user on registration, but this would break in the future if we allow a "rename herd" command or if we implement multiple herds per shepherd.

The proposed solution is to add a shepherd_name column and a shepherdName property to the Herd read model (the Herd entity in the AppBundle). The data would be filled by the herd projection - meaning we don't have to change the events but just rebuild the read model with the new projection in place. There are console commands that can do that.

Add a glossary

We currently have a single domain called Herding, with a DomeinModel.md file describing it. When we start adding other domains (like Trading), we want to be able to link to a general glossary to cover words that exist in the entire bounded context.

Shepherd adds a first elephpant to his/her Herd

After successful registration, a new Herd is automatically formed for the user, with the Twitter username as the name for their Herd.

Once the registration is completed, the user is redirected to an edit page for an empty herd - displaying all Breeds of ElePHPants and the option to add them to the new herd.

After completion, the user is redirected to their own public Herd listing, displaying the name of the herd (the Twitter username) and the collection of ElePHPants that they have.

Search for a Shepherd

The /shepherd/{username} page can use a search bar where you can search for other shepherd names.

Until we solve #68 this would actually search for Herd::name, but that should not be a problem right now.

Privacy feature to hide your herd

Some people might own ElePHPants, but not want to display them publicly. Do we need to add a feature that "hides" ElePHPants from public view, and if so - is that part of the domain model or is that a read model thing.

Improve readability of end-to-end tests

The unit tests don't need to use $this to assert things. In order to reduce confusion between PHPspec specs and PHPUnit tests we can remove $this from the latter:

TestCase::assertEquals(202, $this->client->getResponse()->getStatusCode());

In favor of:

$this->assertEquals(202, $this->client->getResponse()->getStatusCode());

Shepherd adds/removes an ElePHPant from the Herd

Once a Herd is formed and contains ElePHPants, the Herd can be changed by the Shepherd.

The view for this shows all the ElePHPant Breeds in the Herd, with a "+" and a "-" sign to add or remove. There is also a method to add a new Breed to the Herd, though a list of all Breeds and an "adopt" button.

Make breed translations easier to use

Every breed has a translation, that currently requires you to concat a string in the view (which is a pain):

("herding.breed." ~ breed)|trans

We should try to In order to make those translations more easy to use.
Putting them in their own translation domain could help.. or a special transBreed filter for Twig that abstracts the additional string concatination...

User Accounts

Twitter account should saved so we can make relations in the database.

There should be a extra property "is_organization" to define if the user account is an organization (that mostly sell elephpants).

Automate tweets

On behalf of users when they complete their first Herd: "I just added my Herd of 7 elephpants on Elewant.com! Will you?"

Currently, we do not ask for the required permission to post tweets for users.

Limit the formedOn and adoptedOn to seconds.

Currently, the Herd and ElePHPant models both use a DateTime type for formedOn and adoptedOn respectively.

The precision of these times can be limited to seconds, because that is the most precise value the domain is interested in. This means creating value objects that disregard the microseconds.

It also warrants the creation of a system clock that can be used to retrieve the system time.

See http://rosstuck.com/precision-through-imprecision-improving-time-objects

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.