Coder Social home page Coder Social logo

jolicode / starfleet Goto Github PK

View Code? Open in Web Editor NEW
20.0 15.0 3.0 3.08 MB

:rocket: Share your conferences activity to your buddies

Home Page: https://starfleet.app/

License: MIT License

PHP 79.81% CSS 0.01% JavaScript 0.40% Dockerfile 1.19% Shell 0.20% SCSS 1.83% Twig 16.57%
slack bot cfp conferences

starfleet's Introduction

Starfleet logo

Starfleet

Share your conferences activity to your buddies

Requirements

A Docker environment is provided and requires you to have these tools available:

  • Docker
  • Bash
  • PHP >= 8.1
  • Castor

Castor

Once castor is installed, in order to improve your usage of castor scripts, you can install console autocompletion script.

If you are using bash:

castor completion | sudo tee /etc/bash_completion.d/castor

If you are using something else, please refer to your shell documentation. You may need to use castor completion > /to/somewhere.

Castor supports completion for bash, zsh & fish shells.

Docker environment

The Docker infrastructure provides a web stack with:

  • NGINX
  • PostgreSQL
  • PHP
  • Traefik
  • A container with some tooling:
    • Composer
    • Node
    • Yarn / NPM

Domain configuration (first time only)

Before running the application for the first time, ensure your domain names point the IP of your Docker daemon by editing your /etc/hosts file.

This IP is probably 127.0.0.1 unless you run Docker in a special VM (like docker-machine for example).

Note: The router binds port 80 and 443, that's why it will work with 127.0.0.1

echo '127.0.0.1 local.starfleet.app' | sudo tee -a /etc/hosts

Starting the stack

Launch the stack by running this command:

castor start

Note: the first start of the stack should take a few minutes.

The site is now accessible at the hostnames your have configured over HTTPS (you may need to accept self-signed SSL certificate if you do not have mkcert installed on your computer - see below).

SSL certificates

HTTPS is supported out of the box. SSL certificates are not versioned and will be generated the first time you start the infrastructure (castor start) or if you run castor infra:generate-certificates.

If you have mkcert installed on your computer, it will be used to generate locally trusted certificates. See mkcert documentation to understand how to install it. Do not forget to install CA root from mkcert by running mkcert -install.

If you don't have mkcert, then self-signed certificates will instead be generated with openssl. You can configure infrastructure/docker/services/router/openssl.cnf to tweak certificates.

You can run castor infra:generate-certificates --force to recreate new certificates if some were already generated. Remember to restart the infrastructure to make use of the new certificates with castor up or castor start.

Builder

Having some composer, yarn or other modifications to make on the project? Start the builder which will give you access to a container with all these tools available:

castor builder

Other tasks

Checkout castor to have the list of available tasks.

Usage

By default, the fetchers are not configured and won't fetch anything. You first need to head to the admin and configure them in the fetcher menu, then you can run inv fetch-conferences.

If you want to add a source, you only have to implement the FetcherInterface.

Some fetchers will use tags to fetch their data, and some of these tags may be missing. If this is the case, you should find the fetcher in src\Fetcher and add the missing tag to its tags list.

Slack

Starfleet uses strong integration with Slack as it sends daily Slack notifications. You must create a Slack application if you don't have any. You need to configure a webhook at https://[your-slack-organization].slack.com/apps/A0F7XDUAZ-incoming-webhooks and add it to the SLACK_WEB_HOOK_URL env variable. Since Starfleet uses user interaction, you must configure your application at to allow user interaction. You may see how to do it at https://api.slack.com/interactivity/handling#setup. Your Slack Signing Secret should be stored in the SLACK_SIGNING_SECRET env variable. During dev, you may use Ngrok to let Slack reach your application. We provide a command to start Ngrok : inv ngrok. Paste the resulting address in your Slack app Request URL field.

Map

We provide you with the possibility of adding a map with a marker on every location you and your team attended a conference. If you want to enable this feature, you need to create an account at Mapbox. You then need to retrieve your API Token and add it to your .env file, by replacing the default value of the MAPBOX_TOKEN variable.

Translations

To add easily add new translations, please install and use i18n-ally.

Changes

View the CHANGELOG file attached to this project.

Sponsor

JoliCode

Open Source time sponsored by JoliCode

Credits

License

View the LICENSE file attached to this project.

starfleet's People

Contributors

alexzerah avatar dependabot[bot] avatar hedicguibert avatar joelwurtz avatar jonathanlevaillant avatar lyrixx avatar marionleherisson avatar pyrech avatar qboot avatar remyvanlerberghe avatar ternel avatar welcomattic avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

qboot lolaolivet

starfleet's Issues

Manage conference participations (as admin, as user)

As an admin, I want to see the conferences that users are interested in, the ones they ask to attend. They can request to participate, then I could validate or reject these requests.

Once the request has been validated, I can indicate the status of the next steps: transport tickets, hotel booking, conference tickets...

A participation request can be opened by any user, but if they got a pending submission or they are speaker to the conference, they must mention it in the request (checkbox for it).

Each user will have statistics on his participations/submissions (accepted and rejected). These statistics will be displayed to admin, to let theme decide to accept or reject requests.

AA user I want to add talk and submit to a conference easily

As a user, I want to submit a talk to a conference in the easiest way possible.

Technically, we have to add a Conference field to the talk creation form, that automatically create a submit between the new talk and the conference. The aim is to avoid the user to manually create a Submit object for a new talk.

For an existing talk, we can add a collection form to the talk edition form, to let the user add a new submit of their talk. In this way, we can remove Submit menu entry, which is not really necessary for the user.

Update the concept of "Tag" -> FetcherConfiguration

Tag does not really work ATM. It's used to filter what we want to grab thanks to fetchers.
But fetchers has also their own "tag" that is own by their API.

So the goal of this issue is:

  • Remove the Tag concept (entity + all related code)
    • for the entity Conference, use a plain array in place of the current relation (please, migrate all existing data)
  • Add a new concept : FetcherConfiguration
    • add a new entity: id, className, configuration
    • add public function buildForm(): FormBuilderInterface (not sure ATM about the return type) in FetcherInterface
    • use the form in the admin, to configure each fetcher
    • If it's easy, let's be nice: add a way to create a new record for each fetcher if it does not exists in the DB yet
    • At runtime, each fetcher should get it's configuration. But IMHO, this should be delegate to the service that call the fetcher. So maybe update the interface FetcherInterface::fetch(array $configuration): \Generator

Setup CI

  • Finish docker dev stack

  • Add CI configuration to run tests, check coding style, check linting, etc

Replace the 404 page by a nicer 403 when accessing a random conference

All the conference links are displayed and active in the Starfleet Slack integration. If I tried to use one of this link for a random conference (where I'm not), the destination page is a 404 instead of "something" to inform me properly that I just have to participate to to this conference to see more information.

image

image

I suggest to replace this page by a 403, or a minimal page with few informations, and a form to submit a talk.

Additionally, is it really relevant to have links to 404/403 (for many users) ? It could be smart to activate links in Slack messages only for allowed users/organisations.

Write documentation

  • Installation documentation
    • [local] Classical way
    • [local] Docker way
    • PaaS : heroku, clever-cloud, sensio.cloud, ...

  • Configuration
    • Add tags
    • Add Google oAuth keys
    • Restrict login to your Google Apps domain
    • Create Slack webhook

  • Usage
    • Fetch conferences daily
    • Notifications about CFP, talks submission, talks status, ...

AA User I want Starfleet asks me on Slack if my pending talks are accepted/rejected

Allow to filter the list of next conferences

Same idea as #3, the conference listing is too hard to read.

We have +180 conferences incoming and can't filter the one we could really go to.

Allow to filter by:

  • city
  • country
  • topic
  • tags
  • start and end date
  • number of days

Thanks!

[Participations] Improve feature

  • Automatically select the logged user in form
  • Apply filter on Conference list like from 10/19 to 12/19 (globally, apply filters for all app on countries, tags, dates ...)
  • Adapt workflow places according to needs (ticket, hotel or transport). Don't ask for unnecessary places.

Foreign key violation when deleting a user or a conference

There is a bug when trying to delete a user or a conference in Easy Admin.

If you try to delete a user, the foreign key of that user is still referenced in the participation table, raising this exception :
User Exception

The same occurs with some conferences, but not all of them (I don't know why, it may be because of the fixtures), because the key is still referenced in the submit table.

A quick solution would be to remove the possibility to delete a user or a conference in the admin, but ultimately a decision should should be taken about whether or not we want to completely remove all participations of deleted users. Same goes with conferences : if we delete a conference, do we want to delete all submits referencing this conference ?

Add more data sources

Todo:

  • Create FetcherInterface
  • Implement this interface to create a fetcher for https://raw.githubusercontent.com/tech-conferences/conference-data/master/conferences/2019/php.json
  • Modify the command starfleet-conferences-fetch to let it call the fetcher
  • Compute a hash from conference.slug (cleaned: remove year for instance)+conference.startAt+conference.endAt to check if we already have the conference in database
  • The fetcher fetch method must return an array of Conference entities
  • Save conferences in database

We will improve fetchers with other sources in near future.


Help

See:

Add region filter on fetching

It could be useful to avoid fetching conference placed on the other side of the world. So, we want to filter conference fetching on region (by continent, by country). For fetchers without this filter possibility, we want to filter after fetching, before persist on database.

Update Bootstrap

GitHub alerts us about a security vulnerability from our Bootstrap version.

Todo

  • Update Bootstrap

We found a potential security vulnerability in one of your dependencies. You can see this message because you have been granted access to vulnerability alerts for this repository. Manage your notification settings or learn more about vulnerability alerts.

Fix double Slack message for added conferences

Sometimes we have Slack message in double for new added conferences. We need to investigate to find why and fix it.

In otherwise, we also have "empty" Slack message with only CFP link as CFP reminder message. May be it is because we do not have conference data? Needs investigation too.

The way we search for an existing conference does not scale

ATM, we loop over all conference to find it a conference exist.
This does not scale.

protected function retrieveConferenceIfExists(Conference $conference): ?Conference
{
$currentConferenceName = preg_replace('/(20)[0-9][0-9]/', '', $conference->getName());
$matchedConference = null;
$existingConferences = $this->conferenceRepository->getAllConferencesAsRow();
$shortest = -1;
foreach ($existingConferences as $existingConference) {
$existingConferenceName = preg_replace('/(20)[0-9][0-9]/', '', $existingConference['name']);
$distance = levenshtein(strtolower($currentConferenceName), strtolower($existingConferenceName));


Please, find a way to avoid that. But before coding anything, please expose the algo (here if you're hot, or in slack it's fine)

When editing talk, wrong status is selected

When you go in the Talks listing then edit a talk. Old status is not selected.
For example if you have a submission with "Refused" status, it will go back to "In progress" during edit.

See below ๐Ÿ‘‡ for example


Properly handle online conference

ATM, we are using city="online" to do that. This is not really clean.

  • Let's add a real flag in the DB.
  • Existing data should be migrated too
  • Update all part of the code using this

Add a whitelist/blacklist system to filter more precisely conference fetching

The actual fetching system is not ideal. We fetch all conferences based on a tags list. But for instance at JoliCode we fetch all PHP conference, including TYPO3 conference, which is a CMS that we do not use. So, we would like to manage a blacklist of tags and words contained in conferences name to avoid fetching them.

The behaviour should be:
We fetch all conferences based on the whitelist of tags, and we remove all matching conferences on the blacklist, then we record the result of this filtering.

Manage conference sponsoring

As admin,
I want to manage conference sponsoring:

  • Create a sponsoring for a conference (amount, level ...)
  • Get notifications regularly before the event (to order goodies, order kakemono ...)

Is it really useful for concerned people like @RozennB and/or @xavierlacot ?

Improve Participation system

As Admin, I want the users to let me know which conference they want to participate to. They could request to attend to a conference through a page with conferences list and I want to be able to accept or reject those demands on an admin page with filter by user.

I want to build the list of conferences from which users can request for participation from an admin page.

Todo

  • Automatically select the logged user in form
  • Apply filter on Conference list like from 10/19 to 12/19 (globally, apply filters for all app on countries, tags, dates ...)
  • Adapt workflow places according to needs (ticket, hotel or transport). Don't ask for unnecessary places.

Improve Talks list view on admin

The actual talks list view is very "empty"
image

It should be great to add some columns like "authors", "created at", โ€ฆ In this way, it will be possible to filter on these fields to easily retrieve Talks.

Add init command to create first admin user

For new installation of Starfleet, we need to let people init the application with at least one user with ROLE_ADMIN. It can be done with a command like starfleet:init which asks for an email, a password and some others things required to start using Starfleet (like Slack webhook).

Find a way to avoid duplicated conferences

For now, we have 2 conferences sources (JoindIn API and Conf Tech JSON files).
Sometimes, we fetch the same conference from each source, but the name is not exactly the same.

For instance, "Forum PHP" in Conf Tech, and "Forum PHP 2020" in JoindIn API.
Both has the same dates, but not the same name, and not the same CFP url (https://afup.org/event/forumphp2020 and http://cfp.afup.org/).

To avoid this, @lyrixx gives us an hint: https://www.php.net/manual/en/function.levenshtein.php

We could match the incoming conferences to the existing ones with levenshtein and avoid storing multiple times the same conference.

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.