Skip to content

This project aims to generate an NFT for each new unique and eligible segment a Strava user runs through.

Notifications You must be signed in to change notification settings

alainncls/strava-segments-to-nfts

Repository files navigation

Strava Segments to NFTs

Build

This project aims to generate an NFT for each new unique and eligible segment a Strava user runs through.

The corresponding web application is in a dedicated repository.

Blockchain part

Coverage Status

Web server part

Coverage Maintainability Rating

How to launch

Blockchain part

  1. Go to the blockchain folder and run npm install
  2. Start Ganache
  3. Deploy the contract with truffle migrate --reset (--reset to force re-deployment everytime)
  4. Generate the TypeScript interfaces for the contract with npm run types

Web server part

First, you need to copy the server/.env file to a server/.env.local file. Do not push this file (it's ignored) and add your own values, at least for:

  • PRIVATE_KEY = The wallet which mints the NFT - This is a PoC, do not do anything stupid with your private keys, please...
  • RECIPIENT = The public address that will receive the NFT minted - This is temporary of course, pending the MetaMask integration
  1. Go to the server folder and run npm install
  2. Launch the server with npm run start (npm run start:dev for the watch mode)
  3. The server runs on http://localhost:3001/

Web application part

It's here!

How to test

Blockchain part

  1. Go to the blockchain folder and run npm install
  2. Start Ganache
  3. Test the contract with truffle test

Web server part

  1. Go to the server folder and run npm install
  2. Unit test the server with npm run test (npm run test:watch for the watch mode and npm run test:coverage to generate the coverage data)
  3. E2E test the server with npm run test:e2e (npm run test:watch for the watch mode and npm run e2e:coverage to generate the coverage data)

Technical notes/ideas

Backend

Frontend

Blockchain

Features ideas

Basic stuff

  • ✔️ Create a database of eligible segments
  • ✔️ CRUD for these eligible segments
  • ✔️ Get a Strava activity via its ID
  • ✔️ Extract new segments IDs from this activity
  • ✔️ For matching segments, generate a PNG image
  • ✔️ This image should display the segment's name, distance and GPS path
  • ✔️ Strava connect from the webapp

Blockchain stuff

  • ✔️ Upload image to IPFS
  • ✔️ Make an NFT from this image
  • ✔️ Frontend connection with MetaMask
  • ❌ Frontend connection with Wallet Connect
  • ❌ Mint NFTs from the frontend with MetaMask

Advanced stuff

  • ❌ Create sets of segments, to make a complete collection of NFTs
  • ❌ When a collection is completed, generate a "GOLD" NFT

To Do

  • Remove backend NFT minting (to be done by the end-user)
  • Stop using end-user's Strava token in backend, get everything needed in frontend and send it to the backend
  • WebApp: use axios to manage API calls?
  • WebApp: get contract address from the endpoint

About

This project aims to generate an NFT for each new unique and eligible segment a Strava user runs through.

Topics

Resources

Stars

Watchers

Forks