Ask It. StackIt - A lightweight, community-driven Q&A platform built for seamless knowledge sharing.
StackIt is a modern, feature-rich question-and-answer platform designed for collaborative learning and structured knowledge sharing. Built with Next.js 15, TypeScript, and Prisma, it provides a seamless experience for asking questions, providing answers, and building a thriving community of learners and developers.
- Multi-provider Authentication: Sign in with email/password or Google OAuth
- User Profiles: Customizable profiles with avatars and activity tracking
- Role-based Access: User and Admin roles with different permissions
- Session Management: Secure JWT-based authentication with NextAuth.js
- Rich Text Editor: Advanced editor with TipTap.js supporting:
- Text formatting (bold, italic, underline, strikethrough)
- Code blocks with syntax highlighting
- Headings and lists
- Images and links
- Mentions and user tagging
- Question Management: Create, edit, and delete questions with tags
- Answer System: Provide detailed answers with approval workflow
- Voting System: Upvote/downvote answers to highlight quality content
- Comments: Threaded discussions on answers with mentions
- Tag System: Categorize questions with custom tags
- Search & Discovery: Find questions and answers easily
- Feed System: Browse latest questions with pagination
- User Activity: Track questions, answers, and comments per user
- Real-time Notifications: Get notified for mentions, answers, and comments
- Mention System: Tag users in comments with @username
- Activity Tracking: Monitor user engagement and contributions
- Answer Approval: Admin-controlled answer approval workflow
- Content Moderation: Edit and delete inappropriate content
- Admin Dashboard: Comprehensive analytics and user management
- User Management: View user statistics and activity
- Content Statistics: Track questions, answers, and comments
- Engagement Metrics: Monitor voting activity and popular tags
- User Analytics: Detailed user activity and contribution metrics
- Visual Charts: Interactive charts and graphs for data visualization
- Dark Theme: Beautiful dark mode interface
- Responsive Design: Mobile-first responsive layout
- Smooth Animations: Framer Motion powered interactions
- Modern Components: Built with Radix UI and Tailwind CSS
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first CSS framework
- Framer Motion - Animation library
- TipTap.js - Rich text editor
- Radix UI - Accessible component primitives
- Lucide React - Icon library
- Next.js API Routes - Server-side API endpoints
- Prisma ORM - Database toolkit and ORM
- PostgreSQL - Primary database
- NextAuth.js - Authentication solution
- bcryptjs - Password hashing
- ESLint - Code linting
- Prettier - Code formatting
- Turbopack - Fast bundler for development
- Node.js 18+
- PostgreSQL database
- pnpm (recommended) or npm
-
Clone the repository
git clone https://github.com/Ravi0529/StackIt.git cd stackit -
Install dependencies
pnpm install
-
Set up environment variables Create a
.env.localfile in the root directory:# Database DATABASE_URL="postgresql://username:password@localhost:5432/stackit" # Authentication AUTH_SECRET="your-secret-key" GOOGLE_CLIENT_ID="your-google-client-id" GOOGLE_CLIENT_SECRET="your-google-client-secret" # NextAuth NEXTAUTH_URL="http://localhost:3000" NEXTAUTH_SECRET="your-nextauth-secret"
-
Set up the database
# Generate Prisma client pnpm prisma generate # Run database migrations pnpm prisma db push
-
Start the development server
pnpm dev
-
Open your browser Navigate to http://localhost:3000
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | Yes |
AUTH_SECRET |
Secret key for authentication | Yes |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Yes |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | Yes |
NEXTAUTH_URL |
NextAuth.js URL | Yes |
NEXTAUTH_SECRET |
NextAuth.js secret | Yes |
StackIt/
βββ src/
β βββ app/ # Next.js App Router
β β βββ (app)/ # Protected app routes
β β β βββ admin/ # Admin dashboard
β β β βββ feed/ # Questions feed
β β β βββ profile/ # User profiles
β β β βββ question/ # Q&A pages
β β β βββ search/ # Search functionality
β β βββ (auth)/ # Authentication pages
β β βββ api/ # API routes
β β βββ globals.css # Global styles
β βββ components/ # Reusable components
β β βββ ui/ # UI components
β β βββ RichTextEditor/ # TipTap editor
β β βββ ... # Other components
β βββ context/ # React contexts
β βββ lib/ # Utilities and configs
β βββ types/ # TypeScript type definitions
β βββ utils/ # Helper functions
βββ prisma/ # Database schema and migrations
βββ public/ # Static assets
βββ assets/ # Project assets
The application uses PostgreSQL with the following main entities:
- Users: Authentication and profile information
- Questions: Main Q&A content with tags
- Answers: Responses to questions with approval workflow
- Comments: Threaded discussions on answers
- Votes: Upvote/downvote system for answers
- Tags: Content categorization
- Notifications: User engagement tracking
- AdminPanel: Moderation and admin actions
# Development
pnpm dev # Start development server with Turbopack
# Production
pnpm build # Build the application
pnpm start # Start production server
# Database
pnpm prisma generate # Generate Prisma client
pnpm prisma db push # Push schema changes to database
pnpm prisma studio # Open Prisma Studio
# Linting
pnpm lint # Run ESLint- Connect your repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy - Vercel will automatically detect Next.js
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- Ravi Mistry - mistryravi051005@gmail.com
- Govind Gupta - govind12771277@gmail.com
- Richa Chauhan - chauhanricha2911@gmail.com
- Next.js - React framework
- Prisma - Database toolkit
- TipTap - Rich text editor
- Tailwind CSS - CSS framework
- Radix UI - UI primitives
- Framer Motion - Animation library
If you have any questions or need help, please:
- Check the Issues page
- Create a new issue with detailed information
- Contact the team members directly