Sarvagya is a platform that connects students with instructors, allowing for real-time communication through chat and video calls, as well as content sharing through announcements.
- Authentication for both students and instructors
- Student feed with announcements from followed instructors
- Instructor profiles with bio, occupation, and contact information
- Real-time chat using Stream Chat SDK
- Video calls using Stream Video SDK
- Announcement creation and management
- Follow/unfollow functionality
- Next.js - React framework for server-side rendering and static site generation
- TypeScript - Typed JavaScript
- Supabase - Open source Firebase alternative for authentication and database
- Stream Chat SDK - Real-time chat functionality
- Stream Video SDK - Video call functionality
- ShadCn UI - UI component library
- Tailwind CSS - Utility-first CSS framework
- Jest - Testing framework
- React Testing Library - Testing utilities
src/
├── actions/ # Server actions for data mutations
├── app/ # Next.js app router pages and layouts
├── components/ # React components
│ ├── common/ # Shared components
│ ├── instructor/ # Instructor-specific components
│ ├── student/ # Student-specific components
│ └── ui/ # UI components from ShadCn
├── config/ # Configuration files
├── constants/ # Constants and enums
├── hooks/ # Custom React hooks
├── lib/ # Utility libraries
│ └── supabase/ # Supabase client utilities
├── tests/ # Test utilities and mocks
└── types/ # TypeScript type definitions
- Node.js 18+ and npm
- Supabase account
- Stream account (for chat and video)
- Clone the GitHub repository
- Run
npm install
to install the project dependencies - Set up Supabase and copy the following credentials into the
.env.local
fileNEXT_PUBLIC_SUPABASE_ANON_KEY= NEXT_PUBLIC_SUPABASE_URL= STORAGE_URL=https://<supabase_url>/storage/v1/object/public/
- Add your Stream keys into the file also:
NEXT_PUBLIC_STREAM_API_KEY= STREAM_SECRET_KEY= NEXT_PUBLIC_PAGE_URL=http://localhost:3000 NEXT_PUBLIC_STREAM_CHANNEL_IMAGE_URL=https://api.dicebear.com/9.x/pixel-art/svg?seed=
- Ensure you set up the Supabase tables and their access policies, and the Supabase storage (
headshots
) for the instructors. - Run
npm run dev
to start the local development server.
npm run dev
- Start the development servernpm run build
- Build the application for productionnpm run start
- Start the production servernpm run lint
- Run ESLint to check for code issuesnpm test
- Run Jest testsnpm run test:watch
- Run Jest tests in watch modenpm run test:coverage
- Run Jest tests with coverage report
The project uses Jest and React Testing Library for testing. Tests are organized in __tests__
directories alongside the code they test.
- Unit tests for utility functions and hooks
- Component tests for UI components
- Integration tests for actions and API routes
Run tests with npm test
.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License.