Skip to content

sqonky1/Spark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spark

Overview

Spark is a unique platform that allows fans to support creators with their time instead of money. By engaging with ads and completing surveys, fans can earn Sparks and use them to gift to specific creators, transforming passive attention into active engagement.

Key Features

Sparks - Earn, Gift, Boost

We made a new Impact Point system called Sparks that can be earned by:

  • Watching ads
  • Completing User surveys

Fans can direct these Sparks to creators to show support without spending money. Spark utilises the attention economy to create a new value flow pathway from consumer to creator.

Fans

  • Support with time: No money required
  • Earn levels and titles: Unlocks rewards for supporting creators
  • Recognition in community: Badges and emojis for dedicated fans
  • Better recommendations Your feedback matters to improving TikTok

For Creators

  • New revenue stream driven by the value of time—your fans’ attention.
  • Reinvest Sparks into growing your reach: Boost your content, grow your followers.
  • Small creators can use Sparks to increase visibility and accelerate discovery.
  • Big creators can either cash out or reinvest for further growth.
  • Fan loyalty strengthened through supporter tiers and visible recognition.

For TikTok

  • New monetization layer that doesn’t increase user spend.
  • Better creator retention with a fairer reward system.
  • Rich insights from surveys and ad targeting data.
  • A stronger ecosystem where fans, creators, and advertisers are more connected.

Safeguards

  • Daily cap on ads/surveys.
  • 1-week minimum account age before earning.
  • At least 1K followers to unlock the creator dashboard.
  • Server-verified ad completions (no client spoofing).
  • Bot and self-farming monitoring via IP and device hashing

Tech Stack

  • Node.js + Express API for backend services.
  • Postgres 16 (Dockerized) as the database.
  • Prisma ORM for schema definition and migrations.

Core Entities

  • User: Different roles (FAN, CREATOR, ADMIN), device-linked, and has a trust score.
  • Wallet: Tracks Spark balance for each user.
  • Transaction: Logs various actions (EARN_AD, SURVEY, GIFT, BOOST, CASHOUT).
  • AdSession: Details of the ad session (brand, token, duration, heartbeat, status).
  • Survey + SurveyAnswer: Definitions of surveys and user responses.
  • EventLog: A transparent audit trail of all user actions.

APIs

/auth

  • POST /register: Register a new user.
  • POST /login: Login using email and password.
  • POST /dev-login: Dev login using deviceId.
  • GET /whoami: Retrieve current user details.

/wallet

  • GET /balance: Get the user's Spark balance.
  • POST /gift: Gift Sparks to a creator.
  • POST /boost: Boost a video using Sparks.
  • POST /cashout: Cash out Sparks.

/ads

  • POST /start: Start an ad session.
  • POST /heartbeat: Send a heartbeat for the ad session.
  • POST /complete: Complete the ad session and earn Sparks.

/surveys

  • GET /: List all active surveys.
  • POST /complete: Complete a survey and earn Sparks (with cap checks).

/events

  • GET /: Query the personal event log.

/creators

  • GET /me/stats: Retrieve creator statistics (gifts, boosts).

/surveys

  • GET /: List all active surveys.
  • POST /complete: Complete a survey and earn Sparks (with cap checks).

/events

  • GET /: Query the personal event log.

/creators

  • GET /me/stats: Retrieve creator statistics (gifts, boosts).

Fairness & Safety

  • Caps: Limits on daily ad and weekly survey participation to prevent abuse.
  • Gates: Account age gate (7 days configurable) to prevent early abuse.
  • Anti-abuse: JWT authentication, rate-limiting, and a trust score to ensure fair usage.
  • AML (Anti-Money Laundering): Sparks can only flow outward (earned → gifted → boosted/cashed), eliminating inbound cash and preventing laundering risks.
  • Transparency: Each user has an Event Log and Transaction History for full transparency.

Seed/Dev Tools

  • seed.js: Provisioning tool that creates a demo creator and sets up survey definitions.
  • Dev Login: Supports login via deviceId, backdating creation to simulate testing scenarios.

Project Setup

Homebrew (pkg manager) — if you don’t have it

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Core tools

brew update
brew install git
brew install nvm

Set up nvm (Node Version Manager)

mkdir -p ~/.nvm
cat <<'EOF' >> ~/.zshrc
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
EOF
source ~/.

Install Node LTS (includes npm)

nvm install --lts
node -v
npm -v

Docker Desktop

brew install --cask docker
open -a Docker

(wait until the whale icon says “Docker Desktop is running”)

docker --version
docker compose version

Expo tooling (use CLI locally; Expo Go is on your phone)

npm i -g expo-cli
expo --version

(Inside your project repo) install Prisma CLI locally

(do this AFTER you git clone your repo and cd into it)

npm i -D prisma
npx prisma --version

Reach the backend directory

cd spark-backend

(If your repo uses Docker Compose for Postgres)

docker compose up -d

Prisma (when your repo has schema.prisma)

npx prisma db push
npm run seed  # if your repo provides a seed script

Start the API (example)

npm run dev

Load Packages

npm install

Reach the mobile folder

cd mobile

Start the project

npx expo start

Team

This project was made for TikTok TechJam 2025 by acacia tembusu dining hall

Members:

  • Chloe Chua
  • Chew Wei Jie
  • Cheong Kang Jie
  • Kenneth Lee
  • Yap Han Keat

License

This project is licensed under the MIT License.

For setup, usage, and product details, please refer to the full documentation above. Let me know if you need additional information or modifications!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors