diff --git a/TechStack/C++/a b/TechStack/C++/a deleted file mode 100644 index 8b13789..0000000 --- a/TechStack/C++/a +++ /dev/null @@ -1 +0,0 @@ - diff --git a/TechStack/CPP/cpp-projects.css b/TechStack/CPP/cpp-projects.css new file mode 100644 index 0000000..7c6fefd --- /dev/null +++ b/TechStack/CPP/cpp-projects.css @@ -0,0 +1,140 @@ +/* Reset unwanted margin */ +body { + margin: 0; + padding: 0; + font-family: "Inter", sans-serif; + background: #f9f9f9; +} + +/* Header styling */ +.ml-header { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + text-align: center; + padding: 50px 20px; + margin: 0; /* remove extra gap */ +} + +.ml-header h1 { + font-size: 2.5rem; + margin: 0; +} + +.ml-header p { + margin-top: 20px; + font-size: 1.1rem; + opacity: 0.9; + margin-bottom: 20px ; +} + +.back-button { + display: inline-flex; + align-items: center; + gap: 0.5rem; + background: linear-gradient(135deg, #6a11cb, #2575fc); + color: #fff; + padding: 0.75rem 1.75rem; + border-radius: 50px; + text-decoration: none; + font-weight: 600; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); + backdrop-filter: blur(8px); + border: 1px solid rgba(255, 255, 255, 0.2); + transition: all 0.3s ease; + font-size: 0.95rem; + z-index: 10; +} + +/* Projects container */ +.projects-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 25px; + max-width: 1200px; + margin: 40px auto; /* centers and adds spacing */ + padding: 0 20px; +} + +/* Project cards */ +.project-card { + background: white; + border-radius: 15px; + box-shadow: 0 4px 15px rgba(0,0,0,0.08); + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + transition: transform 0.2s ease, box-shadow 0.2s ease; + min-height: 320px; /* ensures equal height */ +} + +.project-card:hover { + transform: translateY(-6px); + box-shadow: 0 6px 20px rgba(0,0,0,0.12); +} + +.project-icon { + font-size: 2.5rem; + display: inline-block; + + background: linear-gradient(135deg, #667eea, #764ba2); + + /* For Chrome, Safari, Edge */ + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + + /* For Firefox */ + background-clip: text; + color: transparent; + + margin-bottom: 15px; +} + + + + +/* Text */ +.project-content h3 { + font-size: 1.3rem; + margin-bottom: 10px; + color: #333; +} + +.project-content p { + color: #555; + font-size: 0.95rem; + margin-bottom: 15px; + flex-grow: 1; /* pushes button down */ +} + +/* Tags */ +.tech-stack { + margin-bottom: 15px; +} + +.tech-tag { + display: inline-block; + background: #eee; + padding: 5px 12px; + border-radius: 20px; + font-size: 0.8rem; + margin: 3px; + color: #333; +} + +/* Button */ +.view-code-btn { + display: inline-block; + padding: 10px 18px; + background:linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border-radius: 8px; + text-decoration: none; + font-weight: 600; + transition: background 0.2s ease; +} + +.view-code-btn:hover { + background: #2575fc; +} diff --git a/TechStack/CPP/cpp-projects.html b/TechStack/CPP/cpp-projects.html new file mode 100644 index 0000000..ab38f64 --- /dev/null +++ b/TechStack/CPP/cpp-projects.html @@ -0,0 +1,186 @@ + + + + + + C++ Projects - Project Vault + + + + + + +
+
+

C++ Projects

+

Classic C++ projects showcasing data structures, algorithms, and real-world system implementations

+ ← Back to Home +
+
+ +
+
+ + +
+
+ +
+
+

Library Management System

+

A C++ project that manages book records, borrowing, returning, and tracking availability in a library system.

+
+ C++ + File Handling + OOP +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Student Record Management

+

C++ based project to store, update, and manage student records with roll numbers, grades, and personal details.

+
+ C++ + Data Structures +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Bank Management System

+

A banking system simulation in C++ allowing users to create accounts, deposit, withdraw, and check balances.

+
+ C++ + File Handling +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Tic-Tac-Toe Game

+

A simple console-based Tic-Tac-Toe game implemented in C++ for two players.

+
+ C++ + Game Logic +
+ + View Project + + + View Code + +
+
+ +
+
+ + + + + + + diff --git a/TechStack/CPP/projects/Student_report_system.cpp b/TechStack/CPP/projects/Student_report_system.cpp new file mode 100644 index 0000000..262556e --- /dev/null +++ b/TechStack/CPP/projects/Student_report_system.cpp @@ -0,0 +1,149 @@ +#include +#include +#include +#include +using namespace std; + +struct Student { + int rollNumber{}; + string name; + int age{}; + char grade{'-'}; + + void display() const { + cout << "Roll No: " << rollNumber + << ", Name: " << name + << ", Age: " << age + << ", Grade: " << grade << '\n'; + } +}; + +class StudentRecords { +private: + vector records; + + // Find student index by roll number; -1 if not found + int findIndex(int roll) const { + for (size_t i = 0; i < records.size(); ++i) { + if (records[i].rollNumber == roll) return static_cast(i); + } + return -1; + } + +public: + void addStudent() { + Student s; + s.rollNumber = readInt("Enter Roll Number: "); + cout << "Enter Name: "; + cin.ignore(numeric_limits::max(), '\n'); // clear newline before getline + getline(cin, s.name); + s.age = readInt("Enter Age: "); + s.grade = readGrade("Enter Grade (A-F): "); + + if (findIndex(s.rollNumber) != -1) { + cout << "⚠️ A student with roll " << s.rollNumber << " already exists.\n"; + return; + } + records.push_back(s); + cout << "✅ Student added successfully!\n"; + } + + void displayAll() const { + if (records.empty()) { + cout << "⚠️ No records found!\n"; + return; + } + cout << "\n--- Student Records ---\n"; + for (const auto& s : records) s.display(); + } + + void searchStudent() const { + int roll = readInt("Enter Roll Number to Search: "); + int idx = findIndex(roll); + if (idx == -1) { + cout << "⚠️ Student with Roll No " << roll << " not found!\n"; + return; + } + cout << "✅ Student Found: "; + records[idx].display(); + } + + void updateStudent() { + int roll = readInt("Enter Roll Number to Update: "); + int idx = findIndex(roll); + if (idx == -1) { + cout << "⚠️ Student with Roll No " << roll << " not found!\n"; + return; + } + + cout << "Enter new Name: "; + cin.ignore(numeric_limits::max(), '\n'); + getline(cin, records[idx].name); + + records[idx].age = readInt("Enter new Age: "); + records[idx].grade = readGrade("Enter new Grade (A-F): "); + cout << "✅ Record updated successfully!\n"; + } + + void deleteStudent() { + int roll = readInt("Enter Roll Number to Delete: "); + int idx = findIndex(roll); + if (idx == -1) { + cout << "⚠️ Student with Roll No " << roll << " not found!\n"; + return; + } + records.erase(records.begin() + idx); + cout << "🗑️ Record deleted successfully!\n"; + } + + // --- Input helpers --- + static int readInt(const string& prompt) { + int x; + while (true) { + cout << prompt; + if (cin >> x) return x; + // bad input -> clear and retry + cin.clear(); + cin.ignore(numeric_limits::max(), '\n'); + cout << "❌ Invalid number. Please try again.\n"; + } + } + + static char readGrade(const string& prompt) { + while (true) { + cout << prompt; + string g; + if (cin >> g && !g.empty()) { + char c = toupper(static_cast(g[0])); + if (c >= 'A' && c <= 'F') return c; + } + cin.clear(); + cin.ignore(numeric_limits::max(), '\n'); + cout << "❌ Invalid grade. Enter a letter A-F.\n"; + } + } +}; + +int main() { + StudentRecords system; + while (true) { + cout << "\n===== Student Record Management System =====\n" + << "1. Add Student\n" + << "2. Display All Students\n" + << "3. Search Student\n" + << "4. Update Student\n" + << "5. Delete Student\n" + << "6. Exit\n"; + + int choice = StudentRecords::readInt("Enter your choice: "); + switch (choice) { + case 1: system.addStudent(); break; + case 2: system.displayAll(); break; + case 3: system.searchStudent(); break; + case 4: system.updateStudent(); break; + case 5: system.deleteStudent(); break; + case 6: cout << "🚪 Exiting... Goodbye!\n"; return 0; + default: cout << "⚠️ Invalid choice! Try again.\n"; + } + } +} diff --git a/TechStack/CPP/projects/bank_management_system.cpp b/TechStack/CPP/projects/bank_management_system.cpp new file mode 100644 index 0000000..be207df --- /dev/null +++ b/TechStack/CPP/projects/bank_management_system.cpp @@ -0,0 +1,146 @@ +#include +#include +#include +using namespace std; + +class Account { +private: + int accNumber; + string name; + double balance; + +public: + Account(int accNum, string accName, double initialBalance) { + accNumber = accNum; + name = accName; + balance = initialBalance; + } + + int getAccNumber() { + return accNumber; + } + + string getName() { + return name; + } + + double getBalance() { + return balance; + } + + void deposit(double amount) { + if (amount > 0) { + balance += amount; + cout << "Deposited: " << amount << " successfully.\n"; + } else { + cout << "Invalid deposit amount.\n"; + } + } + + void withdraw(double amount) { + if (amount <= balance && amount > 0) { + balance -= amount; + cout << "Withdrawn: " << amount << " successfully.\n"; + } else { + cout << "Invalid withdrawal amount or insufficient balance.\n"; + } + } + + void display() { + cout << "Account Number: " << accNumber + << "\nName: " << name + << "\nBalance: " << balance << endl; + } +}; + +int main() { + vector accounts; + int choice; + + while (true) { + cout << "\n=== Banking System Menu ===\n"; + cout << "1. Create Account\n"; + cout << "2. Deposit Money\n"; + cout << "3. Withdraw Money\n"; + cout << "4. Check Balance\n"; + cout << "5. Exit\n"; + cout << "Enter choice: "; + cin >> choice; + + if (choice == 1) { + int accNum; + string name; + double initialBalance; + + cout << "Enter Account Number: "; + cin >> accNum; + cout << "Enter Name: "; + cin.ignore(); + getline(cin, name); + cout << "Enter Initial Balance: "; + cin >> initialBalance; + + accounts.push_back(Account(accNum, name, initialBalance)); + cout << "Account created successfully!\n"; + + } else if (choice == 2) { + int accNum; + double amount; + cout << "Enter Account Number: "; + cin >> accNum; + bool found = false; + + for (auto &acc : accounts) { + if (acc.getAccNumber() == accNum) { + cout << "Enter Amount to Deposit: "; + cin >> amount; + acc.deposit(amount); + found = true; + break; + } + } + if (!found) cout << "Account not found!\n"; + + } else if (choice == 3) { + int accNum; + double amount; + cout << "Enter Account Number: "; + cin >> accNum; + bool found = false; + + for (auto &acc : accounts) { + if (acc.getAccNumber() == accNum) { + cout << "Enter Amount to Withdraw: "; + cin >> amount; + acc.withdraw(amount); + found = true; + break; + } + } + if (!found) cout << "Account not found!\n"; + + } else if (choice == 4) { + int accNum; + cout << "Enter Account Number: "; + cin >> accNum; + bool found = false; + + for (auto &acc : accounts) { + if (acc.getAccNumber() == accNum) { + acc.display(); + found = true; + break; + } + } + if (!found) cout << "Account not found!\n"; + + } else if (choice == 5) { + cout << "Exiting Banking System. Goodbye!\n"; + break; + } else { + cout << "Invalid choice. Try again.\n"; + } + } + + return 0; +} diff --git a/TechStack/CPP/projects/library_managent_system.cpp b/TechStack/CPP/projects/library_managent_system.cpp new file mode 100644 index 0000000..2c3c612 --- /dev/null +++ b/TechStack/CPP/projects/library_managent_system.cpp @@ -0,0 +1,136 @@ +#include +#include +#include +using namespace std; + +class Book { +public: + int id; + string title; + string author; + bool isIssued; + + Book(int i, string t, string a) { + id = i; + title = t; + author = a; + isIssued = false; + } +}; + +class Library { +private: + vector books; + +public: + void addBook() { + int id; + string title, author; + cout << "Enter Book ID: "; + cin >> id; + cin.ignore(); + cout << "Enter Book Title: "; + getline(cin, title); + cout << "Enter Author Name: "; + getline(cin, author); + + books.push_back(Book(id, title, author)); + cout << "✅ Book added successfully!\n"; + } + + void displayBooks() { + if (books.empty()) { + cout << "❌ No books in library.\n"; + return; + } + cout << "\n📚 Library Books:\n"; + for (auto &b : books) { + cout << "ID: " << b.id + << " | Title: " << b.title + << " | Author: " << b.author + << " | Status: " << (b.isIssued ? "Issued" : "Available") << "\n"; + } + } + + void searchBook() { + int id; + cout << "Enter Book ID to search: "; + cin >> id; + + for (auto &b : books) { + if (b.id == id) { + cout << "✅ Found: " << b.title << " by " << b.author + << " | Status: " << (b.isIssued ? "Issued" : "Available") << "\n"; + return; + } + } + cout << "❌ Book not found.\n"; + } + + void issueBook() { + int id; + cout << "Enter Book ID to issue: "; + cin >> id; + + for (auto &b : books) { + if (b.id == id) { + if (!b.isIssued) { + b.isIssued = true; + cout << "✅ Book issued successfully!\n"; + } else { + cout << "❌ Book already issued.\n"; + } + return; + } + } + cout << "❌ Book not found.\n"; + } + + void returnBook() { + int id; + cout << "Enter Book ID to return: "; + cin >> id; + + for (auto &b : books) { + if (b.id == id) { + if (b.isIssued) { + b.isIssued = false; + cout << "✅ Book returned successfully!\n"; + } else { + cout << "❌ Book was not issued.\n"; + } + return; + } + } + cout << "❌ Book not found.\n"; + } +}; + +int main() { + Library lib; + int choice; + + do { + cout << "\n===== 📖 Library Management System =====\n"; + cout << "1. Add Book\n"; + cout << "2. Display Books\n"; + cout << "3. Search Book\n"; + cout << "4. Issue Book\n"; + cout << "5. Return Book\n"; + cout << "6. Exit\n"; + cout << "Enter your choice: "; + cin >> choice; + + switch (choice) { + case 1: lib.addBook(); break; + case 2: lib.displayBooks(); break; + case 3: lib.searchBook(); break; + case 4: lib.issueBook(); break; + case 5: lib.returnBook(); break; + case 6: cout << "👋 Exiting... Thank you!\n"; break; + default: cout << "❌ Invalid choice!\n"; + } + } while (choice != 6); + + return 0; +} diff --git a/TechStack/CPP/projects/tic_tac_toe_game.cpp b/TechStack/CPP/projects/tic_tac_toe_game.cpp new file mode 100644 index 0000000..5c05146 --- /dev/null +++ b/TechStack/CPP/projects/tic_tac_toe_game.cpp @@ -0,0 +1,128 @@ +#include +#include +#include +using namespace std; + +char board[3][3]; // 3x3 board + +// Function to reset board +void resetBoard() { + char c = '1'; + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { + board[i][j] = c++; + } + } +} + +// Function to display board +void displayBoard() { + cout << "\n\n"; + cout << " TIC TAC TOE\n"; + cout << "-----------------------\n"; + for (int i = 0; i < 3; i++) { + cout << " | "; + for (int j = 0; j < 3; j++) { + cout << " " << board[i][j] << " |"; + } + cout << "\n-----------------------\n"; + } + cout << "\n"; +} + +// Check winner +char checkWinner() { + for (int i = 0; i < 3; i++) { + // Rows and columns + if (board[i][0] == board[i][1] && board[i][1] == board[i][2]) return board[i][0]; + if (board[0][i] == board[1][i] && board[1][i] == board[2][i]) return board[0][i]; + } + // Diagonals + if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return board[0][0]; + if (board[0][2] == board[1][1] && board[1][1] == board[2][0]) return board[0][2]; + return ' '; +} + +// Check if board is full +bool isFull() { + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + if (board[i][j] != 'X' && board[i][j] != 'O') + return false; + return true; +} + +// Player move +void playerMove() { + int move; + while (true) { + cout << "Enter your move (1-9): "; + cin >> move; + if (move < 1 || move > 9) { + cout << "Invalid! Try again.\n"; + continue; + } + int row = (move - 1) / 3; + int col = (move - 1) % 3; + if (board[row][col] != 'X' && board[row][col] != 'O') { + board[row][col] = 'X'; + break; + } else { + cout << "Cell already taken! Try again.\n"; + } + } +} + +// Computer move (random) +void computerMove() { + srand(time(0)); + int move; + while (true) { + move = rand() % 9 + 1; + int row = (move - 1) / 3; + int col = (move - 1) % 3; + if (board[row][col] != 'X' && board[row][col] != 'O') { + board[row][col] = 'O'; + cout << "Computer chose " << move << "\n"; + break; + } + } +} + +// Main Game +int main() { + int choice; + do { + resetBoard(); + char winner = ' '; + bool gameOver = false; + + while (!gameOver) { + displayBoard(); + playerMove(); + winner = checkWinner(); + if (winner == 'X' || isFull()) break; + + computerMove(); + winner = checkWinner(); + if (winner == 'O' || isFull()) break; + } + + displayBoard(); + if (winner == 'X') cout << "🎉 You Win!\n"; + else if (winner == 'O') cout << "💻 Computer Wins!\n"; + else cout << "🤝 It's a Draw!\n"; + + cout << "\n1. Play Again\n2. Reset\n3. Exit\nChoose: "; + cin >> choice; + + if (choice == 2) { + resetBoard(); + cout << "Board Reset!\n"; + choice = 1; // restart automatically + } + } while (choice == 1); + + cout << "Thanks for playing! 👋\n"; + return 0; +} diff --git a/TechStack/Java/a b/TechStack/Java/a deleted file mode 100644 index 8b13789..0000000 --- a/TechStack/Java/a +++ /dev/null @@ -1 +0,0 @@ - diff --git a/TechStack/Java/java-projects.css b/TechStack/Java/java-projects.css new file mode 100644 index 0000000..7c6fefd --- /dev/null +++ b/TechStack/Java/java-projects.css @@ -0,0 +1,140 @@ +/* Reset unwanted margin */ +body { + margin: 0; + padding: 0; + font-family: "Inter", sans-serif; + background: #f9f9f9; +} + +/* Header styling */ +.ml-header { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + text-align: center; + padding: 50px 20px; + margin: 0; /* remove extra gap */ +} + +.ml-header h1 { + font-size: 2.5rem; + margin: 0; +} + +.ml-header p { + margin-top: 20px; + font-size: 1.1rem; + opacity: 0.9; + margin-bottom: 20px ; +} + +.back-button { + display: inline-flex; + align-items: center; + gap: 0.5rem; + background: linear-gradient(135deg, #6a11cb, #2575fc); + color: #fff; + padding: 0.75rem 1.75rem; + border-radius: 50px; + text-decoration: none; + font-weight: 600; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); + backdrop-filter: blur(8px); + border: 1px solid rgba(255, 255, 255, 0.2); + transition: all 0.3s ease; + font-size: 0.95rem; + z-index: 10; +} + +/* Projects container */ +.projects-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 25px; + max-width: 1200px; + margin: 40px auto; /* centers and adds spacing */ + padding: 0 20px; +} + +/* Project cards */ +.project-card { + background: white; + border-radius: 15px; + box-shadow: 0 4px 15px rgba(0,0,0,0.08); + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + transition: transform 0.2s ease, box-shadow 0.2s ease; + min-height: 320px; /* ensures equal height */ +} + +.project-card:hover { + transform: translateY(-6px); + box-shadow: 0 6px 20px rgba(0,0,0,0.12); +} + +.project-icon { + font-size: 2.5rem; + display: inline-block; + + background: linear-gradient(135deg, #667eea, #764ba2); + + /* For Chrome, Safari, Edge */ + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + + /* For Firefox */ + background-clip: text; + color: transparent; + + margin-bottom: 15px; +} + + + + +/* Text */ +.project-content h3 { + font-size: 1.3rem; + margin-bottom: 10px; + color: #333; +} + +.project-content p { + color: #555; + font-size: 0.95rem; + margin-bottom: 15px; + flex-grow: 1; /* pushes button down */ +} + +/* Tags */ +.tech-stack { + margin-bottom: 15px; +} + +.tech-tag { + display: inline-block; + background: #eee; + padding: 5px 12px; + border-radius: 20px; + font-size: 0.8rem; + margin: 3px; + color: #333; +} + +/* Button */ +.view-code-btn { + display: inline-block; + padding: 10px 18px; + background:linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border-radius: 8px; + text-decoration: none; + font-weight: 600; + transition: background 0.2s ease; +} + +.view-code-btn:hover { + background: #2575fc; +} diff --git a/TechStack/Java/java-projects.html b/TechStack/Java/java-projects.html new file mode 100644 index 0000000..0c3b0f3 --- /dev/null +++ b/TechStack/Java/java-projects.html @@ -0,0 +1,156 @@ + + + + + + Java Projects - Project Vault + + + + + + +
+
+

Java Projects

+

Robust Java projects showcasing OOP, multithreading, GUI development, and database connectivity

+ ← Back to Home +
+
+ +
+
+ + + + +
+
+ +
+
+

ATM Simulator

+

A console-based Java project simulating ATM operations like cash withdrawal, deposit, and PIN verification.

+
+ Java + OOP +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Hotel Reservation System

+

A Java project using JDBC to manage hotel bookings, customer check-in/check-out, and room availability.

+
+ Java + JDBC + MySQL +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Expense Tracker

+

A Java Swing GUI project for tracking daily expenses, storing data in files or a database.

+
+ Java + Swing + File Handling +
+ + View Project + + + View Code + +
+
+ +
+
+ +
+
+

Chat Application

+

A Java socket programming project for real-time messaging between multiple clients and a server.

+
+ Java + Socket Programming + Multithreading +
+ + View Project + + + View Code + +
+
+ +
+
+ +
+ +
+ + + + + diff --git a/TechStack/Java/projects/ATMSimulator.java b/TechStack/Java/projects/ATMSimulator.java new file mode 100644 index 0000000..60965f7 --- /dev/null +++ b/TechStack/Java/projects/ATMSimulator.java @@ -0,0 +1,142 @@ +import java.util.*; + +public class ATMSimulator { + + // ---------- Account class ---------- + static class Account { + private String name; + private String pin; + private double balance; + + public Account(String name, String pin, double balance) { + this.name = name; + this.pin = pin; + this.balance = balance; + } + + public String getName() { + return name; + } + + public boolean verifyPin(String enteredPin) { + return this.pin.equals(enteredPin); + } + + public double getBalance() { + return balance; + } + + public void deposit(double amount) { + if (amount > 0) { + balance += amount; + System.out.println("₹" + amount + " deposited successfully."); + } else { + System.out.println("Invalid deposit amount."); + } + } + + public void withdraw(double amount) { + if (amount <= 0) { + System.out.println("Invalid withdrawal amount."); + } else if (amount > balance) { + System.out.println("Insufficient funds."); + } else { + balance -= amount; + System.out.println("₹" + amount + " withdrawn successfully."); + } + } + } + + // ---------- ATM class ---------- + static class ATM { + private Scanner scanner; + private Account account; + + public ATM(Account account, Scanner scanner) { // pass scanner + this.account = account; + this.scanner = scanner; + } + + public void start() { + System.out.println("\n----- Welcome to the ATM, " + account.getName() + " -----"); + if (!login()) { + System.out.println("Too many failed attempts. Exiting."); + return; + } + + int choice; + do { + showMenu(); + choice = scanner.nextInt(); + switch (choice) { + case 1 -> checkBalance(); + case 2 -> deposit(); + case 3 -> withdraw(); + case 4 -> System.out.println("Thank you, " + account.getName() + "! Please collect your card."); + default -> System.out.println("Invalid choice."); + } + } while (choice != 4); + } + + private boolean login() { + int attempts = 0; + while (attempts < 3) { + System.out.print("Enter your PIN: "); + String enteredPin = scanner.next(); + if (account.verifyPin(enteredPin)) { + System.out.println("Login successful.\n"); + return true; + } else { + System.out.println("Incorrect PIN. Try again."); + attempts++; + } + } + return false; + } + + private void showMenu() { + System.out.println("\n----- ATM Menu -----"); + System.out.println("1. Check Balance"); + System.out.println("2. Deposit"); + System.out.println("3. Withdraw"); + System.out.println("4. Exit"); + System.out.print("Enter choice: "); + } + + private void checkBalance() { + System.out.println("Your balance: ₹" + account.getBalance()); + } + + private void deposit() { + System.out.print("Enter amount to deposit: "); + double amount = scanner.nextDouble(); + account.deposit(amount); + } + + private void withdraw() { + System.out.print("Enter amount to withdraw: "); + double amount = scanner.nextDouble(); + account.withdraw(amount); + } + } + + // ---------- main ---------- + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + + // Step 1: Create account + System.out.println("----- Create Your Bank Account -----"); + System.out.print("Enter your name: "); + String name = sc.nextLine(); + + System.out.print("Set your 4-digit PIN: "); + String pin = sc.nextLine(); + + // start with zero balance + Account account = new Account(name, pin, 0.0); + + // Step 2: Launch ATM (pass same scanner) + ATM atm = new ATM(account, sc); + atm.start(); + } +} diff --git a/TechStack/Java/projects/ChatApp.java b/TechStack/Java/projects/ChatApp.java new file mode 100644 index 0000000..c52e3ea --- /dev/null +++ b/TechStack/Java/projects/ChatApp.java @@ -0,0 +1,186 @@ +import java.io.*; +import java.net.*; +import java.util.*; +import java.util.concurrent.*; + +/** + * ChatApp.java + * Usage: + * Server: java ChatApp server + * Client: java ChatApp client + * + * Example: + * Terminal 1 -> java ChatApp server 5000 + * Terminal 2 -> java ChatApp client 127.0.0.1 5000 Alice + * Terminal 3 -> java ChatApp client 127.0.0.1 5000 Bob + * + * Commands (client): + * /quit -> disconnect + */ +public class ChatApp { + + // ---------- entry ---------- + public static void main(String[] args) { + if (args.length == 0) { + usage(); + return; + } + switch (args[0].toLowerCase()) { + case "server": + int port = (args.length >= 2) ? parsePort(args[1]) : 5000; + new ChatServer(port).start(); + break; + case "client": + if (args.length < 4) { + System.out.println("Client usage: java ChatApp client "); + return; + } + String host = args[1]; + int p = parsePort(args[2]); + String name = args[3]; + new ChatClient(host, p, name).start(); + break; + default: + usage(); + } + } + + private static void usage() { + System.out.println("Usage:"); + System.out.println(" Server: java ChatApp server "); + System.out.println(" Client: java ChatApp client "); + } + + private static int parsePort(String s) { + try { return Integer.parseInt(s); } + catch (Exception e) { return 5000; } + } + + // ---------- server ---------- + static class ChatServer { + private final int port; + private final Set clients = ConcurrentHashMap.newKeySet(); + + ChatServer(int port) { this.port = port; } + + void start() { + System.out.println("[Server] Starting on port " + port + " ..."); + try (ServerSocket serverSocket = new ServerSocket(port)) { + System.out.println("[Server] Listening on " + serverSocket.getLocalPort()); + while (true) { + Socket socket = serverSocket.accept(); + ClientHandler handler = new ClientHandler(socket); + clients.add(handler); + new Thread(handler, "ClientHandler-" + socket.getPort()).start(); + } + } catch (IOException e) { + System.out.println("[Server] Error: " + e.getMessage()); + } + } + + void broadcast(String from, String message) { + String payload = (from == null ? "" : "[" + from + "] ") + message; + for (ClientHandler ch : clients) { + ch.send(payload); + } + } + + void remove(ClientHandler ch) { + clients.remove(ch); + } + + class ClientHandler implements Runnable { + private final Socket socket; + private PrintWriter out; + private BufferedReader in; + private String name = "Anonymous"; + + ClientHandler(Socket socket) { this.socket = socket; } + + public void run() { + try { + in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8")); + out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF-8"), true); + + // first line from client is the desired name + String proposed = in.readLine(); + if (proposed != null && !proposed.trim().isEmpty()) name = proposed.trim(); + out.println("Welcome " + name + "! Type /quit to exit."); + broadcast("Server", name + " joined the chat."); + + String line; + while ((line = in.readLine()) != null) { + if (line.trim().equalsIgnoreCase("/quit")) { + break; + } + if (!line.trim().isEmpty()) { + broadcast(name, line); + } + } + } catch (IOException e) { + // connection issue + } finally { + close(); + } + } + + void send(String msg) { + try { + if (out != null) out.println(msg); + } catch (Exception ignored) { } + } + + void close() { + try { socket.close(); } catch (IOException ignored) {} + remove(this); + broadcast("Server", name + " left the chat."); + } + } + } + + // ---------- client ---------- + static class ChatClient { + private final String host; + private final int port; + private final String name; + + ChatClient(String host, int port, String name) { + this.host = host; this.port = port; this.name = name; + } + + void start() { + System.out.println("[Client] Connecting to " + host + ":" + port + " as " + name + " ..."); + try (Socket socket = new Socket(host, port); + BufferedReader serverIn = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8")); + PrintWriter serverOut = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF-8"), true); + BufferedReader userIn = new BufferedReader(new InputStreamReader(System.in))) { + + // send our name first + serverOut.println(name); + + // reader thread: prints server messages + Thread reader = new Thread(() -> { + try { + String line; + while ((line = serverIn.readLine()) != null) { + System.out.println(line); + } + } catch (IOException ignored) { } + System.out.println("[Client] Disconnected."); + System.exit(0); + }, "ServerReader"); + reader.setDaemon(true); + reader.start(); + + // main thread: reads user input and sends + String input; + while ((input = userIn.readLine()) != null) { + serverOut.println(input); + if (input.trim().equalsIgnoreCase("/quit")) break; + } + } catch (IOException e) { + System.out.println("[Client] Error: " + e.getMessage()); + } + } + } +} diff --git a/TechStack/Java/projects/HotelReservationSystem.java b/TechStack/Java/projects/HotelReservationSystem.java new file mode 100644 index 0000000..3adf95a --- /dev/null +++ b/TechStack/Java/projects/HotelReservationSystem.java @@ -0,0 +1,134 @@ +import java.sql.*; +import java.util.*; + +public class HotelReservationSystem { + private static final String URL = "jdbc:mysql://localhost:3306/hotel_db"; + private static final String USER = "root"; // change if needed + private static final String PASS = "root"; // change if needed + + private Connection conn; + private Scanner sc; + + public HotelReservationSystem() { + try { + conn = DriverManager.getConnection(URL, USER, PASS); + sc = new Scanner(System.in); + } catch (SQLException e) { + System.out.println("DB Connection Failed: " + e.getMessage()); + System.exit(0); + } + } + + // Show available rooms + private void showAvailableRooms() throws SQLException { + String query = "SELECT * FROM rooms WHERE is_booked = FALSE"; + Statement st = conn.createStatement(); + ResultSet rs = st.executeQuery(query); + System.out.println("\n--- Available Rooms ---"); + while (rs.next()) { + System.out.println("Room " + rs.getString("room_number") + + " | Type: " + rs.getString("type") + + " | Price: ₹" + rs.getDouble("price")); + } + } + + // Book a room + private void bookRoom() throws SQLException { + showAvailableRooms(); + System.out.print("Enter Room Number to Book: "); + String roomNumber = sc.next(); + + // check if available + String check = "SELECT room_id FROM rooms WHERE room_number=? AND is_booked=FALSE"; + PreparedStatement pst = conn.prepareStatement(check); + pst.setString(1, roomNumber); + ResultSet rs = pst.executeQuery(); + + if (rs.next()) { + int roomId = rs.getInt("room_id"); + System.out.print("Enter Customer Name: "); + sc.nextLine(); // consume newline + String name = sc.nextLine(); + System.out.print("Enter Phone: "); + String phone = sc.next(); + + String insert = "INSERT INTO customers(name, phone, room_id) VALUES(?,?,?)"; + PreparedStatement pst2 = conn.prepareStatement(insert); + pst2.setString(1, name); + pst2.setString(2, phone); + pst2.setInt(3, roomId); + pst2.executeUpdate(); + + String update = "UPDATE rooms SET is_booked=TRUE WHERE room_id=?"; + PreparedStatement pst3 = conn.prepareStatement(update); + pst3.setInt(1, roomId); + pst3.executeUpdate(); + + System.out.println("✅ Room booked successfully for " + name); + } else { + System.out.println("❌ Room not available."); + } + } + + // Check out + private void checkOut() throws SQLException { + System.out.print("Enter Customer ID to check out: "); + int cid = sc.nextInt(); + + String query = "SELECT room_id FROM customers WHERE customer_id=?"; + PreparedStatement pst = conn.prepareStatement(query); + pst.setInt(1, cid); + ResultSet rs = pst.executeQuery(); + + if (rs.next()) { + int roomId = rs.getInt("room_id"); + + String updateRoom = "UPDATE rooms SET is_booked=FALSE WHERE room_id=?"; + PreparedStatement pst1 = conn.prepareStatement(updateRoom); + pst1.setInt(1, roomId); + pst1.executeUpdate(); + + String deleteCustomer = "DELETE FROM customers WHERE customer_id=?"; + PreparedStatement pst2 = conn.prepareStatement(deleteCustomer); + pst2.setInt(1, cid); + pst2.executeUpdate(); + + System.out.println("✅ Customer checked out and room is now available."); + } else { + System.out.println("❌ Customer not found."); + } + } + + // Menu + public void start() { + while (true) { + try { + System.out.println("\n--- Hotel Reservation System ---"); + System.out.println("1. Show Available Rooms"); + System.out.println("2. Book Room"); + System.out.println("3. Check Out"); + System.out.println("4. Exit"); + System.out.print("Enter choice: "); + int choice = sc.nextInt(); + + switch (choice) { + case 1 -> showAvailableRooms(); + case 2 -> bookRoom(); + case 3 -> checkOut(); + case 4 -> { + System.out.println("Exiting..."); + return; + } + default -> System.out.println("Invalid choice."); + } + } catch (Exception e) { + System.out.println("Error: " + e.getMessage()); + } + } + } + + // Main + public static void main(String[] args) { + new HotelReservationSystem().start(); + } +} diff --git a/TechStack/Python/a b/TechStack/Python/a deleted file mode 100644 index 8b13789..0000000 --- a/TechStack/Python/a +++ /dev/null @@ -1 +0,0 @@ - diff --git a/TechStack/Python/projects/expense tracker.py b/TechStack/Python/projects/expense tracker.py new file mode 100644 index 0000000..52c0969 --- /dev/null +++ b/TechStack/Python/projects/expense tracker.py @@ -0,0 +1,41 @@ +import tkinter as tk +from tkinter import messagebox +import os + +FILE_NAME = "expenses.txt" + +def add_expense(): + item = entry_item.get() + amount = entry_amount.get() + if item and amount: + with open(FILE_NAME, "a") as f: + f.write(f"{item} - Rs.{amount}\n") + messagebox.showinfo("Saved", "Expense added successfully!") + entry_item.delete(0, tk.END) + entry_amount.delete(0, tk.END) + else: + messagebox.showwarning("Error", "Enter both item and amount") + +def view_expenses(): + if os.path.exists(FILE_NAME): + with open(FILE_NAME, "r") as f: + data = f.read() + messagebox.showinfo("Expenses", data if data else "No expenses yet!") + else: + messagebox.showinfo("Expenses", "No expenses file found!") + +root = tk.Tk() +root.title("Expense Tracker") + +tk.Label(root, text="Item:").grid(row=0, column=0) +entry_item = tk.Entry(root) +entry_item.grid(row=0, column=1) + +tk.Label(root, text="Amount:").grid(row=1, column=0) +entry_amount = tk.Entry(root) +entry_amount.grid(row=1, column=1) + +tk.Button(root, text="Add Expense", command=add_expense).grid(row=2, column=0) +tk.Button(root, text="View Expenses", command=view_expenses).grid(row=2, column=1) + +root.mainloop() diff --git a/TechStack/Python/projects/fun fact generator.py b/TechStack/Python/projects/fun fact generator.py new file mode 100644 index 0000000..7f7c5d9 --- /dev/null +++ b/TechStack/Python/projects/fun fact generator.py @@ -0,0 +1,28 @@ +from flask import Flask, render_template_string +import random + +app = Flask(__name__) + +facts = [ + "Honey never spoils.", + "Bananas are berries, but strawberries are not.", + "Octopuses have three hearts.", + "A day on Venus is longer than a year on Venus." +] + +@app.route("/") +def index(): + fact = random.choice(facts) + return render_template_string(""" + + Fun Fact Generator + +

🤓 Fun Fact Generator

+

{{ fact }}

+ Get another fact + + + """, fact=fact) + +if __name__ == "__main__": + app.run(debug=True) diff --git a/TechStack/Python/projects/hotel reservation system.py b/TechStack/Python/projects/hotel reservation system.py new file mode 100644 index 0000000..1bbaf75 --- /dev/null +++ b/TechStack/Python/projects/hotel reservation system.py @@ -0,0 +1,31 @@ +import sqlite3 + +# Database setup +conn = sqlite3.connect("hotel.db") +cur = conn.cursor() +cur.execute("CREATE TABLE IF NOT EXISTS reservations(id INTEGER PRIMARY KEY, name TEXT, room TEXT)") +conn.commit() + +def book_room(name, room): + cur.execute("INSERT INTO reservations(name, room) VALUES(?, ?)", (name, room)) + conn.commit() + print("Room booked successfully!") + +def view_reservations(): + cur.execute("SELECT * FROM reservations") + for row in cur.fetchall(): + print(row) + +def check_in(name): + cur.execute("DELETE FROM reservations WHERE name=?", (name,)) + conn.commit() + print("Checked in!") + +# Example usage +book_room("Alice", "101") +book_room("Bob", "102") +print("Current Reservations:") +view_reservations() +check_in("Alice") +print("After check-in:") +view_reservations() diff --git a/TechStack/Python/projects/number guessing game.py b/TechStack/Python/projects/number guessing game.py new file mode 100644 index 0000000..e8b84c0 --- /dev/null +++ b/TechStack/Python/projects/number guessing game.py @@ -0,0 +1,20 @@ +import random + +def number_guessing(): + number = random.randint(1, 100) + attempts = 0 + print("Welcome to Number Guessing Game!") + print("Guess the number between 1 and 100") + + while True: + guess = int(input("Enter your guess: ")) + attempts += 1 + if guess < number: + print("Too low! Try again.") + elif guess > number: + print("Too high! Try again.") + else: + print(f"🎉 Correct! You guessed it in {attempts} attempts.") + break + +number_guessing() diff --git a/TechStack/Python/projects/rock paper scissor.py b/TechStack/Python/projects/rock paper scissor.py new file mode 100644 index 0000000..7cc6f4c --- /dev/null +++ b/TechStack/Python/projects/rock paper scissor.py @@ -0,0 +1,28 @@ +import random + +def rock_paper_scissors(): + choices = ["rock", "paper", "scissors"] + print("Rock Paper Scissors Game!") + + while True: + user = input("Enter rock, paper or scissors (or 'quit' to stop): ").lower() + if user == "quit": + print("Thanks for playing!") + break + if user not in choices: + print("Invalid choice, try again.") + continue + + computer = random.choice(choices) + print(f"Computer chose: {computer}") + + if user == computer: + print("It's a tie!") + elif (user == "rock" and computer == "scissors") or \ + (user == "paper" and computer == "rock") or \ + (user == "scissors" and computer == "paper"): + print("🎉 You win!") + else: + print("💻 Computer wins!") + +rock_paper_scissors() diff --git a/TechStack/Python/projects/snake game.py b/TechStack/Python/projects/snake game.py new file mode 100644 index 0000000..edda174 --- /dev/null +++ b/TechStack/Python/projects/snake game.py @@ -0,0 +1,71 @@ +import pygame, time, random + +pygame.init() +white = (255,255,255) +black = (0,0,0) +red = (255,0,0) +green = (0,255,0) + +dis = pygame.display.set_mode((600,400)) +pygame.display.set_caption('Snake Game') +clock = pygame.time.Clock() + +snake_block = 10 +snake_speed = 15 +font = pygame.font.SysFont(None, 35) + +def snake(snake_list): + for x in snake_list: + pygame.draw.rect(dis, black, [x[0], x[1], snake_block, snake_block]) + +def gameLoop(): + game_over = False + x1, y1 = 300, 200 + x1_change, y1_change = 0, 0 + snake_list = [] + length = 1 + + foodx = round(random.randrange(0, 600 - snake_block) / 10.0) * 10.0 + foody = round(random.randrange(0, 400 - snake_block) / 10.0) * 10.0 + + while not game_over: + for event in pygame.event.get(): + if event.type == pygame.QUIT: + game_over = True + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_LEFT: + x1_change, y1_change = -snake_block, 0 + elif event.key == pygame.K_RIGHT: + x1_change, y1_change = snake_block, 0 + elif event.key == pygame.K_UP: + x1_change, y1_change = 0, -snake_block + elif event.key == pygame.K_DOWN: + x1_change, y1_change = 0, snake_block + + x1 += x1_change + y1 += y1_change + dis.fill(white) + pygame.draw.rect(dis, green, [foodx, foody, snake_block, snake_block]) + snake_head = [x1, y1] + snake_list.append(snake_head) + if len(snake_list) > length: + del snake_list[0] + + for x in snake_list[:-1]: + if x == snake_head: + game_over = True + + snake(snake_list) + pygame.display.update() + + if x1 == foodx and y1 == foody: + foodx = round(random.randrange(0, 600 - snake_block) / 10.0) * 10.0 + foody = round(random.randrange(0, 400 - snake_block) / 10.0) * 10.0 + length += 1 + + clock.tick(snake_speed) + + pygame.quit() + quit() + +gameLoop() diff --git a/TechStack/Python/projects/weather app.py b/TechStack/Python/projects/weather app.py new file mode 100644 index 0000000..5442fb8 --- /dev/null +++ b/TechStack/Python/projects/weather app.py @@ -0,0 +1,20 @@ +import requests + +API_KEY = "your_api_key_here" +BASE_URL = "http://api.openweathermap.org/data/2.5/weather?" + +def get_weather(city): + url = BASE_URL + "appid=" + API_KEY + "&q=" + city + "&units=metric" + response = requests.get(url).json() + + if response["cod"] != "404": + main = response["main"] + weather = response["weather"][0] + print(f"City: {city}") + print(f"Temperature: {main['temp']}°C") + print(f"Weather: {weather['description']}") + else: + print("City not found!") + +city_name = input("Enter city name: ") +get_weather(city_name) diff --git a/TechStack/Python/python-projects.css b/TechStack/Python/python-projects.css new file mode 100644 index 0000000..26e43a1 --- /dev/null +++ b/TechStack/Python/python-projects.css @@ -0,0 +1,141 @@ +/* Reset unwanted margin */ +body { + margin: 0; + padding: 0; + font-family: "Inter", sans-serif; + background: #f9f9f9; + } + + /* Header styling */ + .ml-header { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + text-align: center; + padding: 50px 20px; + margin: 0; /* remove extra gap */ + } + + .ml-header h1 { + font-size: 2.5rem; + margin: 0; + } + + .ml-header p { + margin-top: 20px; + font-size: 1.1rem; + opacity: 0.9; + margin-bottom: 20px ; + } + + .back-button { + display: inline-flex; + align-items: center; + gap: 0.5rem; + background: linear-gradient(135deg, #6a11cb, #2575fc); + color: #fff; + padding: 0.75rem 1.75rem; + border-radius: 50px; + text-decoration: none; + font-weight: 600; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); + backdrop-filter: blur(8px); + border: 1px solid rgba(255, 255, 255, 0.2); + transition: all 0.3s ease; + font-size: 0.95rem; + z-index: 10; + } + + /* Projects container */ + .projects-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 25px; + max-width: 1200px; + margin: 40px auto; /* centers and adds spacing */ + padding: 0 20px; + } + + /* Project cards */ + .project-card { + background: white; + border-radius: 15px; + box-shadow: 0 4px 15px rgba(0,0,0,0.08); + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + transition: transform 0.2s ease, box-shadow 0.2s ease; + min-height: 320px; /* ensures equal height */ + } + + .project-card:hover { + transform: translateY(-6px); + box-shadow: 0 6px 20px rgba(0,0,0,0.12); + } + + .project-icon { + font-size: 2.5rem; + display: inline-block; + + background: linear-gradient(135deg, #667eea, #764ba2); + + /* For Chrome, Safari, Edge */ + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + + /* For Firefox */ + background-clip: text; + color: transparent; + + margin-bottom: 15px; + } + + + + + /* Text */ + .project-content h3 { + font-size: 1.3rem; + margin-bottom: 10px; + color: #333; + } + + .project-content p { + color: #555; + font-size: 0.95rem; + margin-bottom: 15px; + flex-grow: 1; /* pushes button down */ + } + + /* Tags */ + .tech-stack { + margin-bottom: 15px; + } + + .tech-tag { + display: inline-block; + background: #eee; + padding: 5px 12px; + border-radius: 20px; + font-size: 0.8rem; + margin: 3px; + color: #333; + } + + /* Button */ + .view-code-btn { + display: inline-block; + padding: 10px 18px; + background:linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border-radius: 8px; + text-decoration: none; + font-weight: 600; + transition: background 0.2s ease; + } + + .view-code-btn:hover { + background: #2575fc; + } + \ No newline at end of file diff --git a/TechStack/Python/python-projects.html b/TechStack/Python/python-projects.html new file mode 100644 index 0000000..f62416c --- /dev/null +++ b/TechStack/Python/python-projects.html @@ -0,0 +1,255 @@ + + + + + + Python Projects - Project Vault + + + + + + +
+
+

Python Projects

+

Practical Python projects covering automation, data analysis, GUI apps, and web development

+ ← Back to Home +
+
+ +
+
+ + +
+
+ +
+
+

Expense Tracker

+

A Python Tkinter GUI project for tracking daily expenses with file storage and simple reports.

+
+ Python + Tkinter + File Handling +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Weather App

+

A Python program using APIs to fetch real-time weather updates for any city.

+
+ Python + API + JSON +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Hotel Reservation System

+

A Python project using SQLite to manage hotel bookings, check-ins, and room availability.

+
+ Python + SQLite + Database +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Snake Game

+

A classic Snake game built with Python using the Pygame library.

+
+ Python + Pygame + Game Development +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Number Guessing Game

+

A fun game where the computer picks a number and you have to guess it with hints.

+
+ Python + Random + Game +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Rock Paper Scissor

+

Classic Rock, Paper, Scissors game built in Python. Play against the computer.

+
+ Python + Random + Game +
+ + View Project + + + View Code + +
+
+ + +
+
+ +
+
+

Fun Fact Generator

+

A simple Python web app that generates random fun facts every time you click a button.

+
+ Python + Flask + Web App +
+ + View Project + + + View Code + +
+
+ +
+
+ +
+ + + +
+ + + + + diff --git a/TechStack/ReactJs/a b/TechStack/ReactJs/a deleted file mode 100644 index 8b13789..0000000 --- a/TechStack/ReactJs/a +++ /dev/null @@ -1 +0,0 @@ - diff --git a/TechStack/ReactJs/projects/Todo app.js b/TechStack/ReactJs/projects/Todo app.js new file mode 100644 index 0000000..e1c5305 --- /dev/null +++ b/TechStack/ReactJs/projects/Todo app.js @@ -0,0 +1,55 @@ +import React, { useState } from "react"; + +export default function TodoApp() { + const [task, setTask] = useState(""); + const [todos, setTodos] = useState([]); + + const addTask = () => { + if (task.trim() !== "") { + setTodos([...todos, { text: task, completed: false }]); + setTask(""); + } + }; + + const toggleTask = (index) => { + const updated = [...todos]; + updated[index].completed = !updated[index].completed; + setTodos(updated); + }; + + const deleteTask = (index) => { + setTodos(todos.filter((_, i) => i !== index)); + }; + + return ( +
+

Todo List

+
+ setTask(e.target.value)} + placeholder="Enter task" + className="border p-2 flex-1 rounded" + /> + +
+
    + {todos.map((t, i) => ( +
  • + toggleTask(i)} + className={t.completed ? "line-through cursor-pointer" : "cursor-pointer"} + > + {t.text} + + +
  • + ))} +
+
+ ); +} diff --git a/TechStack/ReactJs/projects/calculatorapp.js b/TechStack/ReactJs/projects/calculatorapp.js new file mode 100644 index 0000000..4472b7f --- /dev/null +++ b/TechStack/ReactJs/projects/calculatorapp.js @@ -0,0 +1,39 @@ +import React, { useState } from "react"; + +export default function Calculator() { + const [input, setInput] = useState(""); + + const handleClick = (val) => { + if (val === "=") { + try { + setInput(eval(input).toString()); // For demo (avoid eval in production) + } catch { + setInput("Error"); + } + } else if (val === "C") { + setInput(""); + } else { + setInput(input + val); + } + }; + + const buttons = ["7","8","9","/","4","5","6","*","1","2","3","-","0",".","=","+","C"]; + + return ( +
+

Calculator

+ +
+ {buttons.map((b, i) => ( + + ))} +
+
+ ); +} diff --git a/TechStack/ReactJs/projects/quizapp.js b/TechStack/ReactJs/projects/quizapp.js new file mode 100644 index 0000000..8216280 --- /dev/null +++ b/TechStack/ReactJs/projects/quizapp.js @@ -0,0 +1,43 @@ +import React, { useState } from "react"; + +const questions = [ + { q: "What is the capital of France?", options: ["Berlin", "Paris", "Madrid"], answer: "Paris" }, + { q: "Which language is used in React?", options: ["Python", "JavaScript", "C++"], answer: "JavaScript" }, + { q: "Who developed React?", options: ["Google", "Facebook", "Microsoft"], answer: "Facebook" } +]; + +export default function QuizApp() { + const [current, setCurrent] = useState(0); + const [score, setScore] = useState(0); + const [finished, setFinished] = useState(false); + + const handleAnswer = (option) => { + if (option === questions[current].answer) setScore(score + 1); + if (current + 1 < questions.length) setCurrent(current + 1); + else setFinished(true); + }; + + return ( +
+

Quiz App

+ {!finished ? ( +
+

{questions[current].q}

+
+ {questions[current].options.map((opt, i) => ( + + ))} +
+
+ ) : ( +

Your Score: {score}/{questions.length}

+ )} +
+ ); +} diff --git a/TechStack/ReactJs/projects/weatherapp.js b/TechStack/ReactJs/projects/weatherapp.js new file mode 100644 index 0000000..8f6b6cc --- /dev/null +++ b/TechStack/ReactJs/projects/weatherapp.js @@ -0,0 +1,44 @@ +import React, { useState } from "react"; +import axios from "axios"; + +export default function WeatherApp() { + const [city, setCity] = useState(""); + const [weather, setWeather] = useState(null); + + const getWeather = async () => { + try { + const apiKey = "YOUR_API_KEY"; // Replace with OpenWeather API key + const res = await axios.get( + `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric` + ); + setWeather(res.data); + } catch { + setWeather(null); + alert("City not found!"); + } + }; + + return ( +
+

Weather App

+
+ setCity(e.target.value)} + placeholder="Enter city" + className="border p-2 flex-1 rounded" + /> + +
+ {weather && ( +
+

{weather.name}

+

Temperature: {weather.main.temp}°C

+

Condition: {weather.weather[0].description}

+
+ )} +
+ ); +} diff --git a/TechStack/ReactJs/react-projects.css b/TechStack/ReactJs/react-projects.css new file mode 100644 index 0000000..26e43a1 --- /dev/null +++ b/TechStack/ReactJs/react-projects.css @@ -0,0 +1,141 @@ +/* Reset unwanted margin */ +body { + margin: 0; + padding: 0; + font-family: "Inter", sans-serif; + background: #f9f9f9; + } + + /* Header styling */ + .ml-header { + background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + text-align: center; + padding: 50px 20px; + margin: 0; /* remove extra gap */ + } + + .ml-header h1 { + font-size: 2.5rem; + margin: 0; + } + + .ml-header p { + margin-top: 20px; + font-size: 1.1rem; + opacity: 0.9; + margin-bottom: 20px ; + } + + .back-button { + display: inline-flex; + align-items: center; + gap: 0.5rem; + background: linear-gradient(135deg, #6a11cb, #2575fc); + color: #fff; + padding: 0.75rem 1.75rem; + border-radius: 50px; + text-decoration: none; + font-weight: 600; + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); + backdrop-filter: blur(8px); + border: 1px solid rgba(255, 255, 255, 0.2); + transition: all 0.3s ease; + font-size: 0.95rem; + z-index: 10; + } + + /* Projects container */ + .projects-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 25px; + max-width: 1200px; + margin: 40px auto; /* centers and adds spacing */ + padding: 0 20px; + } + + /* Project cards */ + .project-card { + background: white; + border-radius: 15px; + box-shadow: 0 4px 15px rgba(0,0,0,0.08); + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + transition: transform 0.2s ease, box-shadow 0.2s ease; + min-height: 320px; /* ensures equal height */ + } + + .project-card:hover { + transform: translateY(-6px); + box-shadow: 0 6px 20px rgba(0,0,0,0.12); + } + + .project-icon { + font-size: 2.5rem; + display: inline-block; + + background: linear-gradient(135deg, #667eea, #764ba2); + + /* For Chrome, Safari, Edge */ + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + + /* For Firefox */ + background-clip: text; + color: transparent; + + margin-bottom: 15px; + } + + + + + /* Text */ + .project-content h3 { + font-size: 1.3rem; + margin-bottom: 10px; + color: #333; + } + + .project-content p { + color: #555; + font-size: 0.95rem; + margin-bottom: 15px; + flex-grow: 1; /* pushes button down */ + } + + /* Tags */ + .tech-stack { + margin-bottom: 15px; + } + + .tech-tag { + display: inline-block; + background: #eee; + padding: 5px 12px; + border-radius: 20px; + font-size: 0.8rem; + margin: 3px; + color: #333; + } + + /* Button */ + .view-code-btn { + display: inline-block; + padding: 10px 18px; + background:linear-gradient(135deg, #667eea 0%, #764ba2 100%); + color: white; + border-radius: 8px; + text-decoration: none; + font-weight: 600; + transition: background 0.2s ease; + } + + .view-code-btn:hover { + background: #2575fc; + } + \ No newline at end of file diff --git a/TechStack/ReactJs/react-projects.html b/TechStack/ReactJs/react-projects.html new file mode 100644 index 0000000..473eb68 --- /dev/null +++ b/TechStack/ReactJs/react-projects.html @@ -0,0 +1,173 @@ + + + + + + React Projects - Project Vault + + + + + + +
+
+

React.js Projects

+

Beginner-friendly React.js projects showcasing UI components, hooks, and simple applications

+ ← Back to Home +
+
+ +
+
+ + +
+
+ +
+
+

Todo List App

+

A simple React app to add, delete, and mark tasks as complete using useState hook.

+
+ React + Hooks + JavaScript +
+ + View Code + +
+
+ + +
+
+ +
+
+

Weather App

+

A React app that fetches weather data from OpenWeather API and displays city weather.

+
+ React + API + Axios +
+ + View Code + +
+
+ + +
+
+ +
+
+

Calculator

+

A simple React calculator app that performs basic arithmetic operations.

+
+ React + JavaScript + CSS +
+ + + View Code + +
+
+ + +
+
+ +
+
+

Quiz App

+

A React quiz app with multiple-choice questions and score tracking.

+
+ React + State Management +
+ + View Code + +
+
+ +
+
+ +
+ + + +
+ + + + + diff --git a/assets/html_files/techStack.html b/assets/html_files/techStack.html index 7193fa9..1fa4066 100644 --- a/assets/html_files/techStack.html +++ b/assets/html_files/techStack.html @@ -80,30 +80,25 @@

Tech Stacks

C++

Explore projects built with C++ for high-performance applications.

- View Projects +View Projects
-

HTML, CSS

-

Discover stunning static websites crafted with HTML and CSS.

- View Projects +

Java

+

Explore projects built with Java for robust, scalable, and platform-independent applications.

+ View Projects
-
-

HTML, CSS, JS

-

Explore interactive websites built with HTML, CSS, and JavaScript.

- View Projects -

Python

Discover projects built with Python for various applications.

- View Projects + View Projects

React JSX Frontend

Explore dynamic web applications built with React JSX.

- View Projects + View Projects

React TSX Frontend

diff --git a/index.html b/index.html index 6865ad4..586e4a3 100644 --- a/index.html +++ b/index.html @@ -37,15 +37,11 @@
Webfolio Games ML Projects + Tech Stack