Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
198 changes: 132 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,138 @@
# About me
Welcome to my personal GitHub repository!
<!-- Profile README for subhilogix -->

<h1 align="center">Hi there, I'm Subhiksha M 👋</h1>

<p align="center">
✨ Aspiring <b>Data Analyst</b> | 💻 Python & Java Enthusiast | 🚀 Turning Ideas into Code ✨
</p>

---

## 🌻 About Me

- 🎓 Pursuing **B.Tech in Computer Science Engineering** at Shiv Nadar University, focusing on **Internet of Things,Python**.
- 🌱 I am **learning data analysis** and am **so interested in it** – I love uncovering insights from datasets and transforming raw data into stories.
- 🔭 Currently building **personal projects** to strengthen my **Python, Java, and data analysis** skills.
- 🛠️ Worked on projects like a **Smart Parking System** and a **Water Flow Meter using IR sensors** to apply theory into practical systems.
- 💡 I enjoy **solving problems and making data speak through clean visuals**.
- 🎨 Outside of code, I love **organizing notes and helping others learn programming**.
- 📫 Let’s connect on [![LinkedIn](https://img.shields.io/badge/-LinkedIn-0A66C2?logo=linkedin&logoColor=white)](https://www.linkedin.com/in/subhiksha-m-11062007s)

---

## 🛠️ Languages & Tools

<p align="center">
<img src="https://img.shields.io/badge/-Python-3776AB?logo=python&logoColor=white&style=for-the-badge" />
<img src="https://img.shields.io/badge/-Java-007396?logo=java&logoColor=white&style=for-the-badge" />
<img src="https://img.shields.io/badge/-Arduino_IDE-00979D?logo=arduino&logoColor=white&style=for-the-badge" />
<img src="https://img.shields.io/badge/-Git-F05032?logo=git&logoColor=white&style=for-the-badge" />
<img src="https://img.shields.io/badge/-VS_Code-007ACC?logo=visual-studio-code&logoColor=white&style=for-the-badge" />
</p>

---

## ✨ What I’m Learning

🚩 **Data Analysis** with Python (pandas, matplotlib, and storytelling with data)
🚩 **Java OOPs & Backend Basics**
🚩 Building **clean data dashboards**
🚩 **Git & GitHub workflow for collaboration**

---

## 📈 GitHub Stats

<p align="center">
<img src="https://github-readme-stats.vercel.app/api?username=subhilogix&show_icons=true&theme=radical" alt="Subhiksha's GitHub stats" height="180">
<img src="https://github-readme-stats.vercel.app/api/top-langs/?username=subhilogix&layout=compact&theme=radical" alt="Subhiksha's Top Languages" height="180">
</p>

---

## 📨 Let’s Connect!

📬 [![LinkedIn](https://img.shields.io/badge/-Connect-0A66C2?logo=linkedin&logoColor=white&style=for-the-badge)](https://www.linkedin.com/in/subhiksha-m-11062007s)

💡 Let’s build and learn together!

---

<p align="center">
<img src="https://komarev.com/ghpvc/?username=subhilogix&label=Profile%20Views&color=brightgreen&style=flat" alt="Profile Views" />
</p>
# StoxPlay - Stock Market Simulation App

A comprehensive stock market simulation platform designed to teach users about investing, trading, and market behavior through a risk-free, interactive, and gamified experience.

## 🎯 Overview

StoxPlay targets students, beginners, and enthusiasts by combining real-time stock data, virtual money, learning modules, and interactive challenges. Users start with ₹1,00,000 virtual cash to practice trading without financial risk.

## ✨ Key Features

### 🔐 Authentication & Onboarding
- Email and Google OAuth sign-in
- Experience level selection (Beginner/Intermediate)
- Financial literacy assessment quiz

### 📚 Learning System
- Level-wise modules covering:
- Stock market basics
- IPOs and ETFs
- Risk management
- Portfolio building
- Technical and fundamental analysis
- Interactive quizzes and challenges
- XP and badge reward system

### 💹 Trading Simulation
- Real-time stock data integration
- Virtual portfolio management
- Real-time charts and market news
- Historical trading simulations
- ROI tracking and analytics

### 🎮 Gamification
- Daily challenges
- Time-based market simulations
- Leaderboards and competitions
- Achievement system

### 🤖 AI Mentor
- Chat-based support
- Term explanations
- Trading strategy recommendations
- Personalized learning paths

### 👥 Community Features
- Discussion boards
- Peer chat system
- User-generated strategies
- Portfolio sharing

## 🛠️ Tech Stack

**Frontend:** React.js
**Backend:** Node.js with Express
**Database:** MongoDB
**Authentication:** Firebase Auth
**Stock Data:** Alpha Vantage API
**Real-time Features:** Socket.io

## 🚀 Getting Started

### Prerequisites
- Node.js (v16 or higher)
- MongoDB
- Firebase account
- Alpha Vantage API key

### Installation

1. Clone the repository:
```bash
git clone <repository-url>
cd stoxplay
```

2. Install all dependencies:
```bash
npm run install-all
```

3. Set up environment variables:
```bash
# Create .env files in both frontend and backend directories
# See .env.example files for required variables
```

4. Start the development servers:
```bash
npm run dev
```

## 📁 Project Structure

```
stoxplay/
├── frontend/ # React.js web application
├── backend/ # Node.js API server
├── docs/ # Documentation
└── scripts/ # Utility scripts
```

## 🎓 Educational Impact

StoxPlay aims to:
- Improve youth financial literacy
- Encourage informed investing decisions
- Make finance education accessible and fun
- Provide safe practice environment for trading

## 🔮 Future Roadmap

- [ ] Mobile app (React Native/Flutter)
- [ ] Real-money investing integration
- [ ] Cryptocurrency simulation
- [ ] Mutual fund education
- [ ] Certification programs
- [ ] School/college partnerships

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 👨‍💻 Author

**Subhiksha M**
- LinkedIn: [Connect with me](https://www.linkedin.com/in/subhiksha-m-11062007s)
- GitHub: [@subhilogix](https://github.com/subhilogix)

---

✨ *Thank you for visiting my GitHub profile! Feel free to explore my repositories, fork projects, and star what you like. Let’s grow together as developers!* ✨
*Making finance education accessible, interactive, and fun for everyone! 🚀*



Expand Down
15 changes: 15 additions & 0 deletions backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

# Database
MONGODB_URI=mongodb://localhost:27017/stoxplay

# JWT
JWT_SECRET=your_super_secure_jwt_secret_key_here_for_development
JWT_EXPIRE=7d

# Alpha Vantage API (for demo - replace with your key)
ALPHA_VANTAGE_API_KEY=demo
STOCK_API_BASE_URL=https://www.alphavantage.co/query
31 changes: 31 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Server Configuration
PORT=5000
NODE_ENV=development
FRONTEND_URL=http://localhost:3000

# Database
MONGODB_URI=mongodb://localhost:27017/stoxplay

# JWT
JWT_SECRET=your_super_secure_jwt_secret_key_here
JWT_EXPIRE=7d

# Firebase Admin SDK
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_PRIVATE_KEY_ID=your_private_key_id
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nyour_private_key\n-----END PRIVATE KEY-----\n"
FIREBASE_CLIENT_EMAIL=your_service_account_email
FIREBASE_CLIENT_ID=your_client_id
FIREBASE_AUTH_URI=https://accounts.google.com/o/oauth2/auth
FIREBASE_TOKEN_URI=https://oauth2.googleapis.com/token

# Stock API
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key
STOCK_API_BASE_URL=https://www.alphavantage.co/query

# Email Configuration (Optional)
[email protected]
SENDGRID_API_KEY=your_sendgrid_api_key

# Redis Configuration (Optional for caching)
REDIS_URL=redis://localhost:6379
140 changes: 140 additions & 0 deletions backend/middleware/auth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
const jwt = require('jsonwebtoken');
const User = require('../models/User');

// Middleware to authenticate JWT token
const authenticateToken = async (req, res, next) => {
try {
// Get token from header
const authHeader = req.headers.authorization;
const token = authHeader && authHeader.split(' ')[1]; // Bearer TOKEN

if (!token) {
return res.status(401).json({
success: false,
message: 'Access token required'
});
}

// Verify token
const decoded = jwt.verify(token, process.env.JWT_SECRET);

// Check if user still exists and is active
const user = await User.findById(decoded.userId);
if (!user || !user.isActive) {
return res.status(401).json({
success: false,
message: 'Invalid token or user not found'
});
}

// Add user info to request object
req.user = {
userId: decoded.userId,
user: user
};

next();
} catch (error) {
console.error('Token verification error:', error);

if (error.name === 'JsonWebTokenError') {
return res.status(401).json({
success: false,
message: 'Invalid token'
});
}

if (error.name === 'TokenExpiredError') {
return res.status(401).json({
success: false,
message: 'Token expired'
});
}

return res.status(500).json({
success: false,
message: 'Internal server error'
});
}
};

// Middleware to check user roles (for future admin features)
const authorize = (...roles) => {
return (req, res, next) => {
if (!req.user) {
return res.status(401).json({
success: false,
message: 'Authentication required'
});
}

const userRole = req.user.user.role || 'user';
if (!roles.includes(userRole)) {
return res.status(403).json({
success: false,
message: 'Insufficient permissions'
});
}

next();
};
};

// Middleware to check if user completed onboarding
const requireOnboarding = (req, res, next) => {
if (!req.user.user.onboardingCompleted) {
return res.status(403).json({
success: false,
message: 'Onboarding required',
code: 'ONBOARDING_REQUIRED'
});
}

next();
};

// Middleware to check if user is verified
const requireVerification = (req, res, next) => {
if (!req.user.user.isVerified) {
return res.status(403).json({
success: false,
message: 'Email verification required',
code: 'VERIFICATION_REQUIRED'
});
}

next();
};

// Optional authentication - doesn't fail if no token
const optionalAuth = async (req, res, next) => {
try {
const authHeader = req.headers.authorization;
const token = authHeader && authHeader.split(' ')[1];

if (token) {
const decoded = jwt.verify(token, process.env.JWT_SECRET);
const user = await User.findById(decoded.userId);

if (user && user.isActive) {
req.user = {
userId: decoded.userId,
user: user
};
}
}

next();
} catch (error) {
// Continue without authentication
next();
}
};

module.exports = {
authenticateToken,
authorize,
requireOnboarding,
requireVerification,
optionalAuth
};
Loading