ThoughtSwap is a real-time classroom discussion tool that facilitates anonymous peer review of short answers ("thoughts") using Canvas for authentication.
- Client: React (Vite) + Tailwind CSS
- Server: Node.js (Express) + Socket.io + Prisma (PostgreSQL)
- Node.js (v18+ recommended)
- npm
- Docker & Docker Compose (for the database)
- A Canvas LMS instance (or a Free-for-Teacher account) for developer keys.
-
Clone the repository:
git clone https://github.com/victor-hugo-dc/thoughtswap-ts.git cd thoughtswap-ts -
Install dependencies: This will install dependencies for the root, client, and server workspaces.
npm install
-
Environment Configuration: Create a
.envfile in the root directory (orpackages/server/.envdepending on your preference, but the docker setup expects it at root or server level).# Server Configuration PORT=8000 DATABASE_URL="postgresql://user:password@localhost:5432/thoughtswap?schema=public" FRONTEND_URL="http://localhost:5173" # Canvas OAuth Configuration # Obtain these from Canvas Admin -> Developer Keys CANVAS_CLIENT_ID="your_client_id" CANVAS_CLIENT_SECRET="your_client_secret" CANVAS_BASE_URL="https://<your-canvas-instance>.instructure.com" # IMPORTANT: Must match exactly what is configured in Canvas CANVAS_REDIRECT_URI="http://localhost:8000/accounts/canvas/login/callback/"
Use Docker to spin up the PostgreSQL database defined in docker-compose.yml.
docker-compose up -dApply the Prisma schema to your database and seed the initial dev user.
# Run from the root
npm run dev --workspace=packages/server
# OR specifically for migrations:
cd packages/server
npx prisma migrate dev
npx prisma db seedThe seed command creates a "Dev Teacher" account (teacher@dev.com) which allows you to test teacher features without a real Canvas login.
Run both the client and server concurrently from the root directory.
npm run dev- Client: http://localhost:5173
- Server: http://localhost:8000