A modern, responsive image sharing platform built with React, TypeScript, and Node.js. Pixel allows users to browse, view, and interact with images across different categories.
- Responsive Image Grid: Masonry layout that adapts to different screen sizes
- Image Popup Viewer: Full-screen image viewing with maximize/minimize functionality
- Category Navigation: Browse images by categories
- Search Functionality: Search through images
- User Authentication: Login and registration system
- Modern UI: Built with Material-UI components and SCSS styling
- Image Details: View image statistics (views, downloads) and descriptions
- Related Images: Discover similar images in popup view
- RESTful API: Express.js server with TypeScript
- MongoDB Integration: Mongoose ODM for data management
- User Management: User registration, authentication, and profiles
- Image Management: Upload, categorize, and manage images
- Category System: Organize images into categories
- File Upload: Multer middleware for image uploads
- React 18 with TypeScript
- Vite for fast development and building
- Material-UI (MUI) for UI components
- React Router DOM for navigation
- SCSS for styling
- React Icons for iconography
- Context API for state management
- Node.js with TypeScript
- Express.js web framework
- MongoDB with Mongoose ODM
- Multer for file uploads
- Dotenv for environment variables
Pixel/
├── pixel/ # Frontend React application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ │ ├── image-popup/ # Image popup viewer
│ │ │ ├── inputs/ # Form input components
│ │ │ └── top-bar/ # Navigation and search
│ │ ├── pages/ # Application pages
│ │ │ ├── auth/ # Authentication pages
│ │ │ ├── category/ # Category browsing
│ │ │ └── home/ # Home page with image grid
│ │ ├── layout/ # Layout components
│ │ ├── state/ # Context and state management
│ │ ├── dto/ # Data transfer objects
│ │ └── logics/ # Business logic utilities
│ └── public/ # Static assets
└── server/ # Backend Node.js application
└── src/
├── controllers/ # Request handlers
├── models/ # MongoDB schemas
├── routes/ # API routes
└── service/ # Database and business logic
- Node.js (v16 or higher)
- MongoDB
- npm or yarn
- Navigate to the frontend directory:
cd pixel- Install dependencies:
npm install- Start the development server:
npm run devThe frontend will be available at http://localhost:5173
- Navigate to the backend directory:
cd server- Install dependencies:
npm install- Create a
.envfile with your configuration:
PORT=3000
MONGODB_URI=your_mongodb_connection_string- Start the development server:
npm run devThe backend API will be available at http://localhost:3000
npm run dev- Start development servernpm run build- Build for productionnpm run lint- Run ESLintnpm run preview- Preview production build
npm run dev- Start development server with nodemonnpm run build- Build TypeScript to JavaScriptnpm start- Start production server
firstName,lastName- User's nameemail- Unique email addresspassword- Hashed passwordcategory- User's preferred categoriesimages- User's uploaded images
title- Image titleimg- Image URL/pathlikes- Array of user IDs who liked the imagecategory- Array of category IDsviews- View countdownloads- Download count
name- Category namedescription- Category descriptioncoverImage- Category cover image
POST /register- User registrationPOST /login- User authentication
GET /- Get all imagesPOST /- Upload new imageGET /:id- Get specific imagePUT /:id- Update imageDELETE /:id- Delete image
- Full-screen image viewing
- Maximize/minimize functionality
- Image statistics display
- Related images grid
- Category tags
- Responsive masonry layout
- Dynamic column adjustment based on screen size
- Image cards with hover effects
- Logo and branding
- Search functionality
- Navigation links
- User authentication status
Create a .env file in the server directory:
PORT=3000
MONGODB_URI=mongodb://localhost:27017/pixel
JWT_SECRET=your_jwt_secret_key- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Ushan Chamod