A modern, full-stack stock market web application inspired by Groww.in, built with Next.js, MongoDB, and real-time stock data integration.
- Modern UI/UX: Clean, minimalist design inspired by Groww
- Responsive Design: Mobile-first approach with Tailwind CSS
- Dark Mode: Complete dark/light theme support
- Smooth Animations: Framer Motion for delightful interactions
- Authentication: JWT-based auth with bcrypt password hashing
- Database: MongoDB with Mongoose ODM
- RESTful API: Express.js-style API routes in Next.js
- Stock Data: Integration with Alpha Vantage API for live stock data
- Landing Page: Hero section, trending stocks, feature highlights
- Authentication: Login/signup with floating labels and validation
- Dashboard: Personalized greeting, market overview, top gainers/losers
- Stock Details: Individual stock pages with key metrics
- Profile: User settings, password change, account management
- Frontend: Next.js 14, React, TypeScript, Tailwind CSS
- Animations: Framer Motion
- Backend: Next.js API Routes, MongoDB, Mongoose
- Authentication: JWT, bcrypt
- UI Components: shadcn/ui
- Icons: Lucide React
-
Clone the repository
git clone <repository-url> cd stockflow
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Update the following variables in
.env.local:MONGODB_URI: Your MongoDB connection stringJWT_SECRET: A secure random string for JWT signingALPHA_VANTAGE_API_KEY: Your Alpha Vantage API key
-
Start MongoDB
# If using local MongoDB mongod # Or use MongoDB Atlas cloud database
-
Run the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000
{
name: String (required),
email: String (required, unique),
password: String (required, hashed),
createdAt: Date
}POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/users/me- Get current user
GET /api/stocks/[symbol]- Get stock data by symbol
- Navbar: Responsive navigation with theme toggle
- Footer: Links and social media
- StockCard: Reusable stock display component
- Theme Provider: Dark/light mode management
Create a .env.local file with:
MONGODB_URI=mongodb://localhost:27017/stockflow
JWT_SECRET=your-super-secret-jwt-key-here
ALPHA_VANTAGE_API_KEY=your-alpha-vantage-api-key
NEWS_API_KEY=your-news-api-key- Build the application:
npm run build - Start the production server:
npm start
- Create account at MongoDB Atlas
- Create a new cluster
- Get connection string
- Add to environment variables
- Sign up at Alpha Vantage
- Get your free API key
- Add to
.env.local:ALPHA_VANTAGE_API_KEY=your_key_here
- Create account at MongoDB Atlas
- Create a new cluster
- Get connection string
- Add to environment variables
- Real-time portfolio valuation
- Gain/loss calculations with percentages
- Transaction history and audit trail
- Performance tracking over time
- Real-time market news integration
- Stock-specific news filtering
- Multiple news categories
- API response caching
- Database query optimization
- Image optimization with Next.js
- Error tracking and logging
- Performance monitoring
- User analytics
- API usage tracking
- Secure JWT-based authentication
- Password hashing with bcrypt
- Protected routes and API endpoints
- Persistent login sessions
- Real-time stock price updates
- Key financial metrics
- Market cap, P/E ratio, volume data
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
This project is licensed under the MIT License - see the LICENSE file for details.
- Stock data provided by Alpha Vantage
- UI components from shadcn/ui
- Icons from Lucide React
- Alpha Vantage Integration: Live stock data with real-time quotes
- Company Overview: Detailed company information and metrics
- Market News: Latest financial news from NewsAPI
- Stock-Specific News: News filtered by stock symbol
- Category Filtering: Business, technology, health, and general news
- Real-time Updates: Fresh news content with timestamps