A modern, AI-powered Q&A platform built with React, TypeScript, Express, and MongoDB. Ask questions, get instant AI-generated draft answers, and engage with a community of developers.
Try OpenAsk now!
- π Web App: https://open-ask-web.vercel.app
- π API: https://open-ask-api-cdcq.vercel.app
- π API Health: https://open-ask-api-cdcq.vercel.app/health
Demo Features:
- Browse 5 pre-seeded questions with AI-generated answers
- Login with Auth0 to ask questions, post answers, and vote
- Experience real-time AI draft answer generation
- Test full-text search and tag filtering
- Production Readiness Assessment - Complete production audit and deployment checklist
- Contributing Guide - How to contribute to OpenAsk
- Code of Conduct - Community guidelines and standards
- Security Policy - Reporting vulnerabilities and security best practices
- Postman API Collection - Ready-to-use API testing collection
- Postman Setup Guide - Detailed guide for API testing with Postman
- API Documentation - Complete API reference and examples
- Docker Guide - Containerization and deployment with Docker
- Implementation Summary - Project status and technical decisions
Watch OpenAsk in action:
- Instant Draft Answers - Get AI-generated answer suggestions using Google Gemini
- Context-Aware - AI analyzes question content and provides relevant responses
- Mock Fallback - Works without API key using deterministic mock responses
- Ask Questions - Post questions with rich markdown support
- Answer & Discuss - Contribute answers to help others
- Vote System - Upvote/downvote questions and answers
- Tag-Based Organization - Categorize and discover questions by tags
- Full-Text Search - Find questions instantly with relevance scoring
- Filter by Tags - Browse questions by topic
- Sort Options - New, most voted, most answered
- Trending Tags - Discover popular topics
- Auth0 Authentication - Secure, industry-standard authentication
- Ownership Validation - Users can only edit their own content
- Markdown Sanitization - XSS prevention with safe HTML
- Rate Limiting - Prevent abuse with request throttling
- Responsive Design - Works on desktop, tablet, and mobile
- Dark Mode - Easy on the eyes (coming soon)
- Real-time Updates - See vote counts update live
- Loading States - Smooth skeleton loaders
- React 18 - Modern UI library
- TypeScript - Type safety
- Vite - Lightning-fast build tool
- Tailwind CSS - Utility-first styling
- React Router - Client-side routing
- React Hook Form - Form management
- Auth0 React SDK - Authentication
- React Markdown - Safe markdown rendering
- Node.js 18+ - JavaScript runtime
- Express 4 - Web framework
- TypeScript - Type safety
- MongoDB 6+ - NoSQL database
- Mongoose 8 - ODM for MongoDB
- Auth0 - JWT authentication
- Google Gemini AI - AI answer generation
- Zod - Schema validation
- Pino - Structured logging
- pnpm - Fast package manager
- Vitest - Unit & integration testing
- Docker - Containerization
- GitHub Actions - CI/CD
- ESLint - Code linting
- Prettier - Code formatting
OpenAsk/
βββ apps/
β βββ api/ # Backend API
β β βββ src/
β β β βββ __tests__/ # Integration tests
β β β βββ middleware/ # Express middleware
β β β βββ models/ # Mongoose models
β β β βββ routes/ # API endpoints
β β β βββ services/ # External services (AI)
β β β βββ utils/ # Helper functions
β β β βββ config.ts # Environment config
β β β βββ db.ts # MongoDB connection
β β β βββ logger.ts # Pino logger
β β β βββ server.ts # Express app
β β β βββ index.ts # Entry point
β β βββ scripts/
β β β βββ seed.ts # Database seeder
β β βββ Dockerfile
β β βββ package.json
β β βββ README.md # API documentation
β β
β βββ web/ # Frontend app
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Route pages
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities
β β βββ types/ # TypeScript types
β β βββ App.tsx # Root component
β βββ package.json
β βββ README.md
β
βββ packages/
β βββ ui/ # Shared UI components
β βββ config/ # Shared configs
β βββ sdk/ # API client SDK
β
βββ .github/
β βββ workflows/
β βββ api-ci.yml # CI/CD pipeline
β
βββ docker-compose.yml # Docker setup
βββ DOCKER.md # Docker guide
βββ pnpm-workspace.yaml # Monorepo config
βββ ProjectScope.txt # Project requirements
βββ README.md # This file
- Node.js 18 or higher
- pnpm 8 or higher
- MongoDB 6 or higher
- Auth0 account (free tier works)
- Google Gemini API key (optional, uses mock if not provided)
- Clone the repository
git clone https://github.com/9jaDevo/OpenAsk.git
cd OpenAsk- Install dependencies
pnpm install- Set up environment variables
For API (apps/api/.env):
cd apps/api
cp .env.example .envEdit .env with your credentials:
PORT=3000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/openask
WEB_ORIGIN=http://localhost:5173
# Auth0 Configuration
AUTH0_DOMAIN=your-tenant.auth0.com
AUTH0_AUDIENCE=https://api.openask.com
# Optional: Google Gemini API
GEMINI_API_KEY=your-gemini-api-key
# Rate Limiting
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX=100
# Logging
LOG_LEVEL=infoFor Web App (apps/web/.env):
cd apps/web
cp .env.example .envEdit .env:
VITE_API_URL=http://localhost:3000/api/v1
VITE_AUTH0_DOMAIN=your-tenant.auth0.com
VITE_AUTH0_CLIENT_ID=your-client-id
VITE_AUTH0_AUDIENCE=https://api.openask.com- Start MongoDB
# Using Docker
docker run -d -p 27017:27017 --name mongodb mongo:7
# Or use local MongoDB installation
mongod- Seed the database (optional)
cd apps/api
pnpm seedThis creates demo users, questions, answers, and votes.
- Start the development servers
# Terminal 1: Start API
cd apps/api
pnpm dev
# Terminal 2: Start Web App
cd apps/web
pnpm devThe API will be available at http://localhost:3000
The Web App will be available at http://localhost:5173
The easiest way to run OpenAsk locally:
# Create .env file with Auth0 credentials
cp .env.example .env
# Edit .env with your Auth0 credentials
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Seed database
docker-compose exec api pnpm seed
# Stop services
docker-compose downSee DOCKER.md for detailed Docker documentation.
- API Documentation - Complete API endpoint reference
- Docker Guide - Container setup and usage
- Project Scope - Original requirements and specifications
- Implementation Summary - Development progress
# API tests
cd apps/api
pnpm test
# Web tests (when available)
cd apps/web
pnpm testcd apps/api
pnpm test --coverage# API - specific test file
pnpm test src/__tests__/questions.test.ts
# API - watch mode
pnpm test --watch# Install dependencies for all workspaces
pnpm install
# Build all packages
pnpm -r build
# Run linting across all workspaces
pnpm -r lint
# Type check all workspaces
pnpm -r typecheckcd apps/api
# Development with hot reload
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Run tests
pnpm test
# Lint code
pnpm lint
# Type check
pnpm typecheck
# Seed database
pnpm seedcd apps/web
# Development server
pnpm dev
# Build for production
pnpm build
# Preview production build
pnpm preview
# Lint code
pnpm lint
# Type check
pnpm typecheck-
Create an Auth0 account at auth0.com
-
Create an API
- Go to Applications > APIs
- Click "Create API"
- Name:
OpenAsk API - Identifier:
https://api.openask.com - Signing Algorithm:
RS256
-
Create an Application
- Go to Applications > Applications
- Click "Create Application"
- Name:
OpenAsk Web - Type:
Single Page Application - Technology:
React
-
Configure Application Settings
- Allowed Callback URLs:
http://localhost:5173/callback - Allowed Logout URLs:
http://localhost:5173 - Allowed Web Origins:
http://localhost:5173 - Allowed Origins (CORS):
http://localhost:5173
- Allowed Callback URLs:
-
Copy credentials to
.envfiles- API: Use API Identifier as
AUTH0_AUDIENCE - Web: Use Application's Client ID as
VITE_AUTH0_CLIENT_ID - Both: Use your Auth0 domain (e.g.,
dev-xxx.us.auth0.com)
- API: Use API Identifier as
-
Get API Key
- Go to Google AI Studio
- Create API key
- Copy to
GEMINI_API_KEYinapps/api/.env
-
Without API Key
- The app will use a deterministic mock that generates answers based on question keywords
- Perfect for development and testing
GET /api/v1/questions- List questions (filters: q, tag, sort)POST /api/v1/questions- Create question (auth required) β‘ Gets AI draftGET /api/v1/questions/:id- Get question by IDPATCH /api/v1/questions/:id- Update question (owner only)
GET /api/v1/questions/:questionId/answers- List answersPOST /api/v1/questions/:questionId/answers- Create answer (auth required)PATCH /api/v1/answers/:id- Update answer (owner only)
POST /api/v1/questions/:id/vote- Vote on question (auth required)POST /api/v1/answers/:id/vote- Vote on answer (auth required)
GET /api/v1/tags/top- Get trending tagsGET /api/v1/search- Full-text search
GET /health- Health checkGET /api/v1/profile- User profile (auth required)
See API Documentation for complete details.
Using Docker:
cd apps/api
docker build -t openask-api .
docker run -p 3000:3000 --env-file .env openask-apiUsing Node.js:
cd apps/api
pnpm build
NODE_ENV=production pnpm startPlatforms:
- Railway
- Render
- Heroku
- DigitalOcean App Platform
- AWS ECS
- Google Cloud Run
Build:
cd apps/web
pnpm build
# Output: dist/Platforms:
- Vercel (recommended for React)
- Netlify
- Cloudflare Pages
- AWS S3 + CloudFront
- GitHub Pages
API:
- Set
NODE_ENV=production - Use strong MongoDB connection string with auth
- Configure proper CORS (
WEB_ORIGIN) - Set up Auth0 production tenant
- Add Gemini API key for AI features
- Configure monitoring (Sentry, Datadog, etc.)
Web:
- Point
VITE_API_URLto production API - Use Auth0 production credentials
- Configure analytics (Google Analytics, Mixpanel, etc.)
- β Auth0 JWT validation - Industry-standard authentication
- β CORS protection - Restricted to frontend origin
- β Rate limiting - 100 requests per 15 minutes on write operations
- β Input validation - Zod schemas on all inputs
- β Markdown sanitization - XSS prevention with safe HTML allowlist
- β Helmet security headers - Protection against common vulnerabilities
- β Ownership checks - Users can only edit their own content
- β MongoDB injection prevention - Mongoose escaping
We welcome contributions! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Write tests for new features
- Follow TypeScript strict mode
- Use conventional commits (see CONTRIBUTING.md)
- Update documentation
- Ensure all tests pass
- Follow existing code style
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- Developer - @9jaDevo
- Auth0 - Authentication platform
- Google Gemini - AI model
- MongoDB - Database
- React - UI library
- Vite - Build tool
- Tailwind CSS - CSS framework
Current Version: 1.0.0
Status: π Live in Production
Last Updated: October 19, 2025
Live Demo: https://open-ask-web.vercel.app
- β Full-Stack Application - React frontend + Express backend deployed on Vercel
- β Backend API - 11 RESTful endpoints with complete CRUD operations
- β Frontend Web App - Responsive React app with Auth0 integration
- β MongoDB Atlas - Cloud database with indexes and seeded data
- β Auth0 Authentication - Secure JWT-based user authentication
- β AI-Powered Answers - Google Gemini integration for draft answer generation
- β Voting System - Upvote/downvote for questions and answers
- β Full-Text Search - MongoDB text indexes with relevance scoring
- β Tag-Based Filtering - Organize and discover content by tags
- β Rate Limiting - Protection against API abuse
- β Markdown Support - Safe HTML rendering with XSS prevention
- β Docker Setup - Containerization for local development
- β CI/CD Pipeline - Automated testing and deployment
- β Comprehensive Tests - 57 integration tests (70% passing)
- β Complete Documentation - API docs, guides, and examples
- β Production Deployment - Live on Vercel with MongoDB Atlas
- Email notifications for new answers
- User reputation system with badges
- Comment threads on answers
- File uploads for code snippets and images
- Real-time updates with WebSocket
- Advanced search filters (date range, author, etc.)
- Analytics dashboard for admins
- Mobile app (React Native)
- Dark mode theme
- Internationalization (i18n)
- Some integration tests have body length validation warnings (easily fixable)
- Real-time updates use polling instead of WebSocket (optimization opportunity)
- Documentation: See docs in
/apps/api/README.mdand/DOCKER.md - Issues: GitHub Issues
- Discussions: GitHub Discussions
- Repository: github.com/9jaDevo/OpenAsk
- API Docs: apps/api/README.md
- Docker Guide: DOCKER.md
- Project Scope: ProjectScope.txt
Built with β€οΈ by the OpenAsk team
Empowering developers to learn and grow together π