Skip to content

abdulkareem25/threadora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧡 Threadora

A modern, full-stack web application built with cutting-edge technologies for seamless product management and secure authentication.


🎯 Overview

Threadora is a production-ready full-stack application demonstrating professional software engineering practices, including:

  • Secure Authentication with JWT and Google OAuth integration
  • RESTful API with comprehensive validation and error handling
  • Modern Frontend with responsive UI and state management
  • MongoDB integration with Mongoose ORM
  • Cloud Image Storage using ImageKit
  • Professional Code Architecture with middleware pattern and service layer

πŸ› οΈ Tech Stack

Backend

Node.js + Express 5.2.1
β”œβ”€β”€ Authentication
β”‚   β”œβ”€β”€ JWT (jsonwebtoken)
β”‚   β”œβ”€β”€ Passport.js with Google OAuth 2.0
β”‚   └── Password hashing (bcryptjs)
β”œβ”€β”€ Database
β”‚   └── MongoDB + Mongoose 9.6.3
β”œβ”€β”€ File Management
β”‚   β”œβ”€β”€ Multer for uploads
β”‚   └── ImageKit for cloud storage
β”œβ”€β”€ Validation & Security
β”‚   β”œβ”€β”€ express-validator
β”‚   β”œβ”€β”€ CORS enabled
β”‚   └── Cookie Parser
└── Logging
    └── Morgan HTTP logger

Frontend

React 19.0 + Vite
β”œβ”€β”€ State Management
β”‚   └── Redux Toolkit
β”œβ”€β”€ Routing
β”‚   └── React Router v7
β”œβ”€β”€ Styling
β”‚   └── Tailwind CSS v4
β”œβ”€β”€ HTTP Client
β”‚   └── Axios
└── UI/UX
    β”œβ”€β”€ React Toastify (notifications)
    └── Responsive Design

πŸ“ Project Structure

Threadora/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app.js              # Express app configuration
β”‚   β”‚   β”œβ”€β”€ config/             # Database & environment config
β”‚   β”‚   β”œβ”€β”€ controllers/        # Business logic handlers
β”‚   β”‚   β”œβ”€β”€ middlewares/        # Auth, validation, error handling
β”‚   β”‚   β”œβ”€β”€ models/             # MongoDB schemas (User, Product)
β”‚   β”‚   β”œβ”€β”€ routes/             # API endpoints
β”‚   β”‚   β”œβ”€β”€ services/           # Business logic services
β”‚   β”‚   β”œβ”€β”€ validators/         # Request validation rules
β”‚   β”‚   └── utils/              # Async handler utilities
β”‚   β”œβ”€β”€ server.js               # Entry point
β”‚   └── package.json            # Dependencies
β”‚
└── Frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ app/                # App configuration
    β”‚   β”‚   β”œβ”€β”€ App.jsx         # Root component
    β”‚   β”‚   β”œβ”€β”€ app.routes.jsx  # Route definitions
    β”‚   β”‚   └── app.store.js    # Redux store
    β”‚   └── features/           # Feature modules
    β”‚       β”œβ”€β”€ auth/           # Authentication feature
    β”‚       β”‚   β”œβ”€β”€ components/ # Login, Signup, Protected routes
    β”‚       β”‚   β”œβ”€β”€ hooks/      # useAuth hook
    β”‚       β”‚   β”œβ”€β”€ pages/      # Auth pages
    β”‚       β”‚   β”œβ”€β”€ services/   # Auth API calls
    β”‚       β”‚   └── states/     # Redux slices
    β”‚       └── shared/         # Shared components
    └── vite.config.js          # Build configuration

✨ Key Features

Authentication & Authorization

  • βœ… JWT-based authentication
  • βœ… Google OAuth 2.0 integration
  • βœ… Secure password hashing with bcryptjs
  • βœ… Protected routes with middleware
  • βœ… Cookie-based session management

Product Management

  • βœ… CRUD operations for products
  • βœ… Image upload with cloud storage
  • βœ… Comprehensive input validation
  • βœ… Error handling and logging

Backend Architecture

  • βœ… Separation of concerns (Controllers, Services, Models)
  • βœ… Middleware pattern for request processing
  • βœ… Global error handling
  • βœ… Request validation layer
  • βœ… Async/await error wrapper utilities

Frontend Features

  • βœ… Modern React with Hooks
  • βœ… Redux state management
  • βœ… Client-side routing
  • βœ… Responsive Tailwind CSS design
  • βœ… Toast notifications for user feedback
  • βœ… Protected routes and role-based access

πŸš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB local instance or MongoDB Atlas connection
  • Google OAuth credentials

Backend Setup

cd Backend
npm install

# Create .env file with:
# PORT=5000
# MONGODB_URI=your_mongodb_uri
# JWT_SECRET=your_secret_key
# GOOGLE_CLIENT_ID=your_client_id
# GOOGLE_CLIENT_SECRET=your_client_secret
# IMAGEKIT_PUBLIC_KEY=your_imagekit_key
# IMAGEKIT_PRIVATE_KEY=your_private_key
# IMAGEKIT_URL_ENDPOINT=your_url_endpoint

# Development
npm run dev

# Production
npm run start

Frontend Setup

cd Frontend
npm install
npm run dev

Visit http://localhost:5173 (or your configured Vite port)


πŸ“ API Endpoints

Authentication Routes

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout
  • GET /api/auth/google - Google OAuth

Product Routes

  • GET /api/products - Get all products
  • POST /api/products - Create product (authenticated)
  • GET /api/products/:id - Get product by ID
  • PUT /api/products/:id - Update product (authenticated)
  • DELETE /api/products/:id - Delete product (authenticated)

πŸ”’ Security Features

  • JWT Authentication - Stateless, secure token-based auth
  • CORS Protection - Configured for trusted origins
  • Request Validation - express-validator middleware
  • Password Security - Bcryptjs hashing with salt rounds
  • Error Handling - No sensitive information leakage
  • HTTP Only Cookies - Secure cookie configuration
  • Environment Variables - Sensitive data protection

πŸ“¦ Dependencies Highlights

Backend

  • Express 5.2.1 - Latest web framework
  • Mongoose 9.6.3 - ODM for MongoDB
  • Passport.js - Authentication middleware
  • express-validator - Request validation
  • bcryptjs - Secure password hashing
  • ImageKit - Cloud image management

Frontend

  • React 19.0 - Latest React version
  • Redux Toolkit - State management
  • React Router v7 - Client-side routing
  • Tailwind CSS v4 - Utility-first CSS
  • Axios - Promise-based HTTP client
  • Vite - Next-gen build tool

πŸŽ“ Learning & Best Practices

This project demonstrates:

  • βœ… Clean code architecture with separation of concerns
  • βœ… Middleware pattern for cross-cutting concerns
  • βœ… Service layer for business logic
  • βœ… Comprehensive error handling
  • βœ… Input validation and sanitization
  • βœ… RESTful API design principles
  • βœ… Component-based UI architecture
  • βœ… State management with Redux
  • βœ… Environment-based configuration
  • βœ… Responsive design patterns

πŸ“š Documentation


πŸ”§ Available Scripts

Backend

npm run dev      # Start development server with hot reload
npm run start    # Start production server

Frontend

npm run dev      # Start Vite development server
npm run build    # Build for production
npm run lint     # Run ESLint
npm run preview  # Preview production build

🀝 Contributing

Feel free to fork this repository and submit pull requests to help improve Threadora.


πŸ“„ License

This project is licensed under the ISC License - see LICENSE file for details.


πŸ‘¨β€πŸ’» About

Threadora is built with a focus on modern development practices, scalability, and maintainability. It serves as a comprehensive example of full-stack JavaScript development with industry best practices.

Created with ❀️ using Node.js, React, and MongoDB

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors