Skip to content

Repository files navigation

Smart Reminders

Production-grade reminder platform with:

  • NestJS backend (JWT auth, Prisma/Postgres, AI + manual reminders, worker delivery)
  • React frontend dashboard (auth, reminders, history, status, profile)

Architecture

  • src/: NestJS API
  • prisma/: Prisma schema, migrations, seed
  • frontend/: React + Vite + TypeScript app
  • test/: backend e2e tests

Backend capabilities

  • JWT auth with refresh-token rotation
  • Access token invalidation tied to refresh token revocation
  • AI reminder creation: POST /reminders
  • Manual reminder creation: POST /reminders/manual
  • Owned reminder CRUD with cursor pagination
  • Due reminder processing + delivery attempts
  • Resend email provider (with retry/backoff/logging) + console fallback
  • Health endpoints: /health, /ready
  • Swagger UI: /docs
  • OpenAPI JSON: /docs-json

Frontend capabilities

  • Email/password register + login
  • Access token in memory
  • Refresh session via httpOnly cookie
  • Protected dashboard routes
  • Reminder creation (AI + manual)
  • Reminder list with filters and cursor pagination
  • Reminder detail edit/cancel
  • History view for sent/failed/cancelled reminders
  • Live backend health/readiness status page
  • Profile page + logout

Stack

Backend

  • NestJS 11
  • Prisma + PostgreSQL
  • BullMQ + Redis
  • OpenAI Responses API
  • Resend SDK
  • Jest + Supertest

Frontend

  • React 19 + Vite + TypeScript
  • React Router (data router)
  • TanStack Query
  • TanStack Table
  • React Hook Form + Zod
  • OpenAPI types + client (openapi-typescript, openapi-fetch)
  • Vitest + Testing Library

Prerequisites

  • Node.js 20+
  • pnpm
  • PostgreSQL
  • Redis

Environment

Copy .env.example to .env.

Required core vars:

NODE_ENV=development
PORT=43107
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/smart_reminders?schema=public
JWT_ACCESS_SECRET=replace-with-a-strong-access-secret
JWT_REFRESH_SECRET=replace-with-a-strong-refresh-secret
JWT_ACCESS_TTL=15m
JWT_REFRESH_TTL=7d
OPENAI_API_KEY=replace-with-your-openai-api-key

Optional/recommended:

QUEUE_ENABLED=true
REDIS_URL=redis://localhost:46379
RESEND_ENABLED=false
RESEND_API_KEY=replace-with-your-resend-api-key
RESEND_FROM_EMAIL=noreply@partfolirt.com
OPENAI_BASE_URL=https://api.avalai.ir/v1
OPENAI_MODEL=gpt-4.1-mini
OPENAI_TEMPERATURE=0.5

Local run

1) Start infra

docker compose up -d db redis

2) Backend

pnpm install
pnpm prisma:generate
pnpm prisma:migrate:deploy
pnpm start:dev

Backend runs at http://localhost:43107.

3) Frontend

cd frontend
pnpm install
pnpm dev

Frontend runs at http://localhost:43117.

OpenAPI-driven frontend (what this means)

The frontend client/types are generated directly from backend Swagger JSON.

  • Source: http://localhost:43107/docs-json
  • Saved as: frontend/openapi.json
  • Generated types: frontend/src/api/generated/openapi.ts

Sync commands:

cd frontend
pnpm api:sync

This prevents drift between frontend request/response types and real backend contracts.

API docs

  • Swagger UI: http://localhost:43107/docs
  • OpenAPI JSON: http://localhost:43107/docs-json

Quality gates

Backend

pnpm lint
pnpm typecheck
pnpm test
pnpm test:e2e
pnpm build

Frontend

cd frontend
pnpm lint
pnpm typecheck
pnpm test
pnpm build

CI

GitHub Actions workflow: .github/workflows/ci.yml

Runs separate backend and frontend jobs:

  • Backend: lint, typecheck, unit, e2e, build
  • Frontend: lint, typecheck, tests, build

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages