Skip to content

kanchan2803/TCanalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ TCAnalyzer: Smart Time & Space Complexity Analyzer

β€œCode faster. Think deeper. Analyze smarter.”

TCAnalyzer is a full-stack web application built to demystify the performance of algorithms.
It provides developers, students, and coding enthusiasts with instant, clear analysis of time and space complexity directly in the browser β€” making it both a learning tool and a developer assistant.

πŸ”— Live Demo: TCAnalyzer on Render
🧠 Stack: React (Vite) · Node.js · Express · MongoDB · JWT Auth · Tailwind CSS


🧩 Core Functionality

πŸ€– Instant Complexity Analysis

  • Instantly compute Big-O notation for time and space complexity.
  • Get a plain-English explanation of the reasoning and contributing code patterns.

🌐 Multi-Language Support

  • Supports JavaScript, Python, C++, and Java out of the box.

πŸ” Secure Authentication

  • Fully integrated JWT-based authentication for registration, login, and session management.
  • Passwords are safely hashed using bcrypt.js before storage.

πŸ“ˆ Personalized History Tracking

  • Users can view all previous analyses in a dedicated history dashboard.
  • Each analysis includes code snippets, complexity breakdown, and explanations.

βš™οΈ Profile Customization

  • Manage your profile with editable fields for LeetCode ID, Codeforces ID, and other settings.

🎯 Why TCAnalyzer?

πŸ‘¨β€πŸŽ“ For Students

An interactive tutor for understanding how different code structures impact runtime and memory.

πŸ’Ό For Interview Prep

A companion tool to practice and verify your solutions for platforms like LeetCode and Codeforces.

πŸ’» For Developers

A quick performance sanity check when optimizing algorithms or refactoring functions.


🧠 Tech Stack Overview

Layer Technology Description
Frontend React (Vite) + Tailwind CSS Modern, responsive, component-based UI
Backend Node.js + Express.js RESTful API architecture with JWT auth
Database MongoDB + Mongoose Schema-based modeling for users & analyses
Authentication JWT + bcrypt.js Secure token-based login system
State Management React Context API Global state for user session & data
Deployment Render Backend β†’ Web Service Β· Frontend β†’ Static Site

🧱 Architecture

TCAnalyzer/ β”‚ β”œβ”€β”€ frontend/ # Frontend (React + Vite) β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ pages/ β”‚ β”‚ β”œβ”€β”€ context/ β”‚ β”‚ └── api/ β”‚ β”œβ”€β”€ public/ β”‚ └── dist/ # Production build output β”‚ β”œβ”€β”€ backend/ # Backend (Node + Express) β”‚ β”œβ”€β”€ controllers/ β”‚ β”œβ”€β”€ routes/ β”‚ β”œβ”€β”€ models/ β”‚ β”œβ”€β”€ db.js β”‚ β”œβ”€β”€ authController.js β”‚ └── server.js β”‚ └── README.md 

βš™οΈ Local Setup

1️⃣ Clone the Repository

git clone https://github.com/<your-username>/TCAnalyzer.git cd TCAnalyzer

2️⃣ Backend Setup

cd backend npm install

Create a .env file inside /backend:

MONGO_DB_URI=your_mongodb_atlas_uri JWT_SECRET=your_jwt_secret PORT=5000

Run the backend:

npm start

The server will run on http://localhost:5000


3️⃣ Frontend Setup

cd ../frontend npm install

Create a .env file inside /frontend:

VITE_API_BASE_URL=http://localhost:5000

Run the frontend:

npm run dev

Open http://localhost:5173


☁️ Deployment Guide (Render)

πŸ”Ή Backend Deployment

  1. Push your code to GitHub.
  2. On Render Dashboard:
    • New β†’ Web Service
    • Connect your repo.
    • Root Directory: backend
    • Build Command: npm install
    • Start Command: npm start
  3. Add environment variables:
    MONGO_DB_URI=your_mongodb_atlas_uri JWT_SECRET=your_jwt_secret NODE_ENV=production
  4. Deploy β€” your backend URL will look like:
    https://tcanalyzer-api.onrender.com

πŸ”Ή Frontend Deployment

  1. Create New β†’ Static Site on Render.
  2. Root Directory: frontend
  3. Build Command: npm install && npm run build
  4. Publish Directory: dist
  5. Add env var:
    VITE_API_BASE_URL=https://tcanalyzer-api.onrender.com
  6. Add a _redirects file in /client/public:
    /* /index.html 200 
  7. Deploy β€” your frontend URL might look like:
    https://tcanalyzer.onrender.com

πŸ”Ή CORS Configuration

In server.js:

import cors from "cors"; app.use(cors({ origin: process.env.CLIENT_URL || "*" }));

Optionally add in .env:

CLIENT_URL=https://tcanalyzer.onrender.com

🧩 Demonstrated Expertise

πŸ’ͺ Full-Stack MERN Development

  • Modular Express API architecture with clean separation of controllers, routes, and middleware.
  • React frontend using Vite for lightning-fast development and builds.

πŸ”’ Secure Auth & State Management

  • Encrypted credentials using bcrypt.
  • Stateless JWT-based sessions.
  • Global auth context in React for seamless login state management.

🎨 Modern Frontend Design

  • Built with Tailwind CSS for a responsive, custom look.
  • Intuitive layout with dynamic content rendering and clean UX.

βš™οΈ DevOps & Cloud

  • CI/CD-ready structure with Render deployment.
  • .env-based environment management for dev and prod.
  • Works seamlessly with MongoDB Atlas for persistent cloud data.

🧾 enhancements TO DO further

want to add different modes of input in home page 1: the default one which is working right now 2: the file input from local system and code gets extracted into the text area 3: Direct code extraction from the latest solution submitted of user on leetcode and extracting code from the leetcode submission link 4: similar to keetcode but for codeforces

I need to learn web scraping or some alternative to implement this feature , however will try integrating this direct analysis from leetcode and codforces id of user


πŸ™Œ Acknowledgements


πŸ’‘ TCAnalyzer bridges the gap between writing code and understanding it β€” making algorithm analysis accessible to everyone.

Releases

No releases published

Packages

No packages published

Languages