Sign inSign up

rayan0301/focusspark-backend

By rayan0301

•Updated 3 months ago

FastAPI backend for FocusSpark AI study platform with focus tracking, Pomodoro, quizzes and chat.

Image
Languages & frameworks
API management
Machine learning & AI
0

468

rayan0301/focusspark-backend repository overview

⁠FocusSpark Backend

FocusSpark Backend is the Dockerized FastAPI API service for FocusSpark, an AI productivity and study platform built for students and focused work.

It powers the FocusSpark web app and Chrome extension with authentication, user profiles, Pomodoro study sessions, focus and emotion tracking, analytics, achievements, notifications, AI chat, document chat, quizzes, flashcards, and data export.

⁠Features

  • JWT authentication with signup, login, protected routes, password updates, and profile management
  • AI chat, document chat, generated study artifacts, flashcards, and quizzes
  • Pomodoro study sessions, focus tracking, distraction logs, emotion logs, goals, analytics, and reports
  • Focus and emotion analysis using OpenCV, MediaPipe, Pillow, and DeepFace
  • Cloudinary-backed profile picture upload, replacement, and cleanup
  • PostgreSQL database support with SQLModel and SQLAlchemy
  • User settings, achievements, notifications, and JSON/CSV export
  • Swagger API documentation available at /docs

⁠Tech Stack

  • Python 3.12
  • FastAPI
  • Uvicorn
  • PostgreSQL
  • SQLModel / SQLAlchemy
  • JWT authentication
  • OpenAI-compatible GitHub Models and Gemini support
  • OpenCV, MediaPipe, DeepFace
  • Cloudinary
  • Docker

⁠Run

docker pull rayan0301/focusspark-backend:latest
docker run --name focusspark-backend --env-file .env -p 8000:8000 rayan0301/focusspark-backend:latest

API:

http://localhost:8000

Swagger docs:

http://localhost:8000/docs

Health check:

GET /

Expected response:

{
  "message": "FocusSpark Backend Running"
}

⁠Environment

This image expects configuration through environment variables. Create a .env file and pass it with --env-file .env when running the container.

Minimum required values:

DATABASE_URL=postgresql+psycopg2://postgres:[email protected]:5432/focusspark
JWT_SECRET=your-32-character-secret-key
CORS_ORIGINS=http://localhost:3000

Optional variables are available for AI providers, Cloudinary image uploads, CORS, and logging.

⁠Exposed Port

8000

Tag summary

Content type

Image

Digest

sha256:bcfb4330f…

Size

1.2 GB

Last updated

3 months ago

docker pull rayan0301/focusspark-backend