GithubHelp home page GithubHelp logo

slashdotdash / segment-challenge Goto Github PK

View Code? Open in Web Editor NEW
76.0 4.0 11.0 6.15 MB

Segment Challenge is an Elixir Phoenix web application built using Commanded

Elixir 75.52% CSS 3.04% JavaScript 9.73% HTML 11.71%

segment-challenge's Introduction

Segment Challenge

Segment Challenge is an Elixir Phoenix web application built using Commanded for CQRS/ES. The front-end is mostly server generated HTML plus a few React components for responsive forms.

Segment Challenge homepage

What is Segment Challenge?

Segment Challenge allows any Strava athlete to host their own Strava-based challenge. Strava is a social network for athletes.

A challenge comprises one or more stages. You can create a challenge based around different Strava segments, or an activity challenge where you decide what type of activity to record (distance, duration, or elevation) and can set an optional goal.

Why is this being made public?

In March 2019 Strava decided to revoke access to the Strava API for Segment Challenge as "... the purpose of this app is competitive with Strava". Without API access the site cannot function. I am making the source code public to demonstrate one approach to building event sourced Elixir applications using Commanded.

Can I run this locally?

Yes, first you need to create a Strava account and create your own Strava API Application and then follow the steps below to clone the Git repo, prepare, and run the application.

Can I deploy this publicly?

No, Strava will not allow Segment Challenge access to their API in public.


Prerequisites

Install Elixir v1.8 and a Postgres database.

You will need to create a Strava API Application to access the API. Any Strava account can be used to create an application. Please refer to the Strava Developers documentation for help.

Getting started

  1. Install Elixir dependencies:

    mix deps.get
  2. Configure your Strava API Application settings:

    cp config/dev.secret.example config/dev.secret.exs

    Edit the config/dev.secret.exs config file and enter the Client ID, Client Secret, and Access Token values from you Strava API Application settings.

    You will need to do the same for test.secret.exs to run tests and prod.secret.exs to run in production.

  3. Create the event store and read store databases:

    mix setup

    This command will create and initialise two databases (segmentchallenge_eventstore_dev and segmentchallenge_readstore_dev) using the default Postgres connection settings configured in config/dev.exs.

  4. Install JavaScript dependencies and compile assets:

    npm install
    npm run compile

    You can use the npm run watch task to watch the assets and recompile on change.

  5. Run the Phoenix web server:

    iex -S mix phx.server

Useful tasks

Import active challenge stage efforts

Attempts at active stages are fetched from Strava every four hours. To import them immediately you can run the following from an iex -S mix console:

iex> SegmentChallenge.Tasks.ImportActiveStageEfforts.execute()

segment-challenge's People

Contributors

slashdotdash avatar

Stargazers

Brett Cooke avatar  avatar Yattol avatar Yalin Gunayer avatar  avatar Malian avatar Alexander Mikuta avatar Rafael T. Ballestiero avatar Kenan Klisura avatar Dario Di Pasquale avatar Justin Workman avatar antx avatar Dominik Muhs avatar  avatar Frédéric Woelffel avatar Sunilkelkar avatar meddle avatar Rafa Noronha avatar Pedro Seabra avatar Anil Wadghule avatar  avatar Mat Garland avatar Josh Price avatar Scott Ming avatar Marcello Santambrogio avatar Herminio Torres avatar Tanapat Xu avatar Dave Lucia avatar Artur avatar Martin Elvar avatar  avatar Maxim Moinat avatar Benjamin Moss avatar Bonn avatar Sam Pratt avatar Ryan Zidago avatar Alexander Zinolidis avatar Pierre-Yves Lebecq avatar Oscar Hult avatar Marwen Ounis avatar  avatar Sarat Chandra Balla avatar Yamil Díaz Aguirre avatar Shane Thacker avatar Igor K avatar Don Onwunumah avatar Filipe A Moreira avatar YuCho avatar Rossi Meacham avatar  avatar  avatar Mihai Târnovan avatar Bogdan BUNECI avatar Lucas C. Villa Real avatar Martin Fahy avatar Fabián Heredia Montiel avatar Oscar Duignan avatar Sanjeev Sekar avatar Abimael Martell avatar Jonathan Simpson avatar Stephen Richardson  avatar Nick Chirico avatar Grant McLendon avatar Henry S avatar Rodrigo Serradura avatar Nil Késede avatar kyo avatar Zdenko Nevrala avatar Vasilis Spilka avatar Navneet Gupta avatar laserx avatar Toan Tran avatar Felipe Menegazzi avatar Andrejs Agejevs avatar Arkadiusz Jaskólski avatar Zack avatar

Watchers

 avatar James Cloos avatar Stephen Moloney avatar  avatar

segment-challenge's Issues

Licensing?

This is a great project to learn about Commanded. The README has instructions for running the app. But without a License technically this is all proprietary and cloning/forking and maybe even running aren't allowed without your prior permission.

Is that intentional, or could you maybe add a license that open sources the codebase?

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.