/tiktok-sharer

Full-stack test task. Share a video to TikTok

Primary LanguageTypeScript

Heroku App Status


Tiktok Sharer

Web app for sharing highlights to TikTok (test task)
View Demo

About The Project

Built With

  • TypeScript
  • React + RxJS
  • NestJS + Express.js
  • MongoDB
  • Docker
  • Heroku
  • Cloudflare
  • TikTok

Getting started

Start in Docker

  1. Create config file
  # .env 
  MONGO_CONNECTION_URI=mongodb+srv://...
  PORT=3000
  # SERVER_BASE_URL should match with TikTok OAuth uri
  SERVER_BASE_URL=...
  SERVER_JWT_SECRET=...
  SERVER_SESSION_SECRET=...
  TIKTOK_CLIENT_KEY=...
  TIKTOK_CLIENT_SECRET=...
  # Used for creating a tunnel via https://dash.cloudflare.com/
  TUNNEL_TOKEN=...
  1. Run the container
docker-compose up 

Start locally (dev)

# create config file in the /back-end/.env
# /back-end
npm install
npm run start:dev

# /front-end
npm install
npm run start

Documentation

REST API

- Serve static
    - GET /*

- Get highlight's video source
    - GET  /api/v1/highlights/:highlightId

- Get JWT token
    - GET /api/v1/auth/jwt

- Share highlight to TikTok
    - POST /api/v1/highlights/:highlightId/share-to-tiktok
    - requires Authorization header

- Start auth with TikTok
    - GET /api/v1/auth/tiktok
 
- Handle TikTok OAuth callback
    - GET /api/v1/auth/tiktok

Modules architecture

Architecture diagram

Tests

Back-end

Front-end