Skip to content

Repository files navigation

Zenly Banner

Typing SVG

TypeScript Next.js Node.js Supabase Socket.IO Recharts ESLint MPL-2.0 License


πŸ“Œ Overview

Zenly is an open source, full-stack platform supporting student mental well-being with:

  • AI-powered journaling & reflections (SSE)
  • Mood tracking with profile insights and charts
  • Community forum (posts, comments, real-time updates)
  • Curated resource hub (live helpful/view counts)
  • Admin dashboard with moderation, alerts, user management

Built in a modern Next.js (App Router) frontend, backed by a robust Express/PostgreSQL API.


✨ Features

  • πŸ“ Journals with AI analysis β€” Streamed progress and personalized reflections
  • πŸ“ˆ Mood tracking β€” Profile insights, Recharts line graphs, daily ratings
  • πŸ§‘β€πŸ€β€πŸ§‘ Community forum β€” Posts, comments, likes, reporting, real-time via Socket.IO
  • πŸ”— Curated resources β€” Featured, search, live helpful/view counts
  • πŸ›‘οΈ Admin β€” Moderation, risk alerts, secure elevation flow
  • πŸ“° Recent activity feed β€” Journals, resource views, forum posts
  • πŸš€ Real-time updates β€” Seamless with Socket.IO & SSE

πŸ“¦ Installation

Fork the repo
git clone https://github.com/YourUsername/Zenly.git
cd Zenly

Copy env file and fill out your secrets
cp backend/.env.example backend/.env

Start both servers (FE + BE)
./start-dev.sh

▢️ Usage

Start Development:

./start-dev.sh
  • Installs dependencies

  • Runs backend & frontend servers

API Endpoints: See API Overview for routes and usage.


πŸ› Troubleshooting

  • CORS errors β†’ Set FRONTEND_URL in backend .env
  • Token issues β†’ Auto-refresh is handled; if stuck, login again
  • SSE/Socket.IO not streaming β†’ Ensure proxy allows streaming, CORS whitelists are correct

πŸ—‚οΈ Monorepo Structure

Zenly/
β”œβ”€β”€ backend/ # Express API, Socket.IO, SSE
β”‚ β”œβ”€β”€ server.js
β”‚ β”œβ”€β”€ config/
β”‚ β”œβ”€β”€ controllers/
β”‚ β”œβ”€β”€ middleware/
β”‚ β”œβ”€β”€ models/
β”‚ β”œβ”€β”€ routes/
β”‚ └── services/
β”œβ”€β”€ frontend/ # Next.js 14 app (App Router)
β”‚ β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ components/
β”‚ β”œβ”€β”€ hooks/
β”‚ β”œβ”€β”€ lib/
β”‚ └── public/
β”œβ”€β”€ start-dev.sh # One-command dev start (FE+BE)
β”œβ”€β”€ package.json # Root scripts (dev, build, lint, bdev)
└── README.md

βš™οΈ Configuration

Backend (backend/.env):

  • SUPABASE_URL β€” Your Supabase project URL
  • SUPABASE_SERVICE_ROLE_KEY β€” Your Supabase service role API key
  • PORT β€” API port
  • FRONTEND_URL β€” Allowed CORS origin
  • JWT_ACCESS_SECRET, JWT_REFRESH_SECRET β€” JWT secrets
  • ...and more for emails, AI, admin, see .env.example

Frontend (frontend/.env.local)

  • NEXT_PUBLIC_API_URL β€” API base

🌐 API Overview (high-level)

  • Auth (/auth): Signup, OTP, login, password reset, admin elevation
  • Journals (/journals): CRUD, stats, analysis (SSE), AI messages
  • Moods (/moods): Today's update, profile chart
  • Forum (/forum): Posts, comments, likes, reports
  • Resources (/resources): Featured, search, helpful/view count, admin CRUD
  • Notifications/Activity: Recent events, notifications

See code for full endpoints and sample payloads.


🚦 Real-time & Streaming

  • Socket.IO: Real-time forum & resources rooms
  • SSE: Streaming for journal analysis, AI chat

πŸ“‹ Roadmap

  • Email flows (password reset, onboarding)
  • File uploads (avatars, attachments)
  • Production deployment guides (Vercel, Railway, Render, Fly.io)
  • Monitoring, error tracking

πŸ”’ License

Zenly is open source under the MPL-2.0 License (Mozilla Public License Version 2.0).
See LICENSE for details.

While commercial use is technically allowed under MPL-2.0, we kindly discourage commercialization of Zenly. Please use this project for learning, personal growth, and community benefit.


🀝 Contributing & Community


About

An AI-powered Mental Health Support System for Students in Higher Education

Topics

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages