A modern Q&A platform for Sri Lankan university students to ask questions, share knowledge, and collaborate in their academic journey.
- π Student-focused Q&A Platform - Ask and answer academic questions
- π Smart Search & Filtering - Find relevant questions quickly
- π₯ User Authentication - Secure login and registration system
- π Leaderboard System - Gamified learning experience
- π¨ Modern UI/UX - Clean, responsive design with Tailwind CSS
- π± Mobile Responsive - Works seamlessly on all devices
- React 18 - Modern React with hooks
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Token authentication
- Doppler - Environment variable management
- Node.js 16+ and npm
- MongoDB database
- Doppler CLI (for environment management)
Terminal window 1 (Backend):
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Start development server with Doppler
npm run devTerminal window 2 (Frontend):
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run devTerminal window 1 (Backend):
# Navigate to backend directory
cd backend
# Create .env file with required variables
cp .env.example .env
# Edit .env with your configuration
# Install dependencies
npm install
# Start development server
npm run dev:localTerminal window 2 (Frontend):
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run devCreate a .env file in the backend directory with the following variables:
# Database
MONGO_URI=mongodb://localhost:27017/the-online-kuppiya
# Authentication
JWT_SECRET=your-super-secure-jwt-secret
# AWS S3 (for file uploads)
AWS_ACCESS_KEY_ID=your-aws-access-key
AWS_SECRET_ACCESS_KEY=your-aws-secret-key
AWS_REGION=your-aws-region
AWS_S3_BUCKET=your-s3-bucket-name
# Error Tracking (Optional)
SENTRY_DSN=your-sentry-dsn
# Server
PORT=3003# Start with Doppler
npm start # Production with Doppler
npm run dev # Development with Doppler
# Start without Doppler
npm run start:local # Production without Doppler
npm run dev:local # Development without Dopplernpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint# Navigate to backend directory
cd backend
# Create an admin user
node create-admin-user.js# List all users
node list-users.js
# Set user as admin
node set-admin.js
# Clean up database
node cleanup-database.jsPOST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/questions- Get all questionsPOST /api/questions- Create new questionGET /api/questions/:id- Get specific questionPOST /api/questions/:id/answers- Add answer to question
GET /api/leaderboard- Get user rankings
The-Online-Kuppiya/
βββ backend/ # Node.js/Express API
β βββ config/ # Database configuration
β βββ controllers/ # Route controllers
β βββ middleware/ # Custom middleware
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ services/ # External services
β βββ server.js # Application entry point
βββ frontend/ # React application
β βββ public/ # Static assets
β βββ src/
β βββ api/ # API client functions
β βββ components/ # React components
β βββ contexts/ # React contexts
β βββ hooks/ # Custom hooks
β βββ pages/ # Page components
βββ docs/ # Documentation
Frontend:
cd frontend
npm run buildBackend:
cd backend
npm startMake sure to set the following environment variables in your production environment:
- All variables from the
.envexample above - Update
frontend/src/api/axios.jswith your production API URL
- 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 ISC License.
For support and questions, please open an issue on GitHub or contact the development team.