Skip to content

Commit 24abd0b

Browse files
committed
fix atlas DNS issues
1 parent 8796733 commit 24abd0b

4 files changed

Lines changed: 57 additions & 51 deletions

File tree

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
# ÉLITE Frontend
2-
3-
## Folder Structure & File Explanations
4-
5-
### 📁 frontend/
6-
7-
Main project folder for the frontend React application.
8-
9-
#### 📁 node_modules/
10-
11-
Contains all installed packages and dependencies. Managed automatically by Bun.
12-
13-
#### 📁 public/
14-
15-
- `kit_2025.jpg`: Static assets (images, etc.) served directly. Not processed by Webpack/Vite.
16-
17-
#### 📁 src/
18-
19-
Source code for the React app.
20-
21-
##### 📁 api/
22-
23-
- `config.jsx`: API configuration, base URLs, and utility functions for making HTTP requests.
24-
25-
##### 📁 components/
26-
27-
Reusable UI components, organized by feature:
28-
29-
- **cart/**: Cart-related UI (CartItem, CartSummary, QuantitySelector)
30-
- **common/**: Shared UI (Button, Loader, RatingStars)
31-
- **filters/**: Product filtering UI (Availability, Brand, Category, Price, etc.)
32-
- **layout/**: Layout components (Footer, Nav, Sidebar)
33-
- **product/**: Product display (ProductCard, ProductList)
34-
35-
##### 📁 hooks/
36-
37-
Custom React hooks for business logic:
38-
39-
- **cartHook/useCart.js**: Cart state and logic
40-
- **productHook/**: (future product-related hooks)
41-
1+
# ÉLITE
2+
3+
ÉLITE is a full-stack e-commerce platform built with React and Vite on the frontend, and powered by Bun, Express, and MongoDB on the backend.
4+
It features product browsing with filters and sorting, cart management, secure authentication using JSON Web Token, and admin-controlled product CRUD operations.
5+
Designed with a layered architecture and Redux-based state management, it is structured for scalability, maintainability, and production-grade deployment.
6+
7+
8+
+## Features
9+
+- Product catalog with filter UI, sorting, and infinite scroll
10+
+- Product details view with image gallery and related items
11+
+- Cart management with quantity updates
12+
+- User authentication (signup/signin) and profile management
13+
+- Admin-only product creation, updates, and deletion
14+
+
15+
+## Tech Stack
16+
+**Frontend:** React 19, Vite, Redux Toolkit, React Router, Tailwind CSS v4, Axios, Framer Motion
17+
+**Backend:** Bun runtime, Express 5, MongoDB + Mongoose, JWT auth, CORS, Multer
18+
+
19+
+## Project Structure
20+
+- `frontend/` React app (Vite)
21+
+- `backend/` Express API
22+
+- `backend/src/routes/` API routes
23+
+- `backend/src/controllers/` business logic
24+
+- `backend/src/models/` Mongoose schemas
25+
+
26+
+## Getting Started
27+
+### Prerequisites
28+
+- Bun (for both frontend and backend)
29+
+- MongoDB (local or Atlas)
30+
+
31+
+### Setup
32+
+1. Install dependencies:
33+
+```bash
34+
+cd backend
35+
+bun install
36+
+cd ../frontend
37+
+bun install
38+
+```
4239
##### 📁 pages/
4340

4441
Top-level pages for routing:

backend/bun.lock

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
"bcryptjs": "^3.0.2",
1212
"cookie-parser": "^1.4.7",
1313
"cors": "^2.8.5",
14+
"dotenv": "^17.3.1",
1415
"express": "^5.1.0",
1516
"jsonwebtoken": "^9.0.2",
16-
"mongoose": "^8.17.1",
17+
"mongoose": "^9.2.3",
1718
"morgan": "^1.10.1",
1819
"multer": "^2.0.2"
1920
},

backend/src/config/db.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import mongoose from "mongoose";
22

3+
34
const connectDB = async () => {
45
try {
5-
const conn = await mongoose.connect(process.env.MONGO_URI);
6+
const mongoUri = (process.env.MONGO_URI || "").trim();
7+
if (!mongoUri) {
8+
throw new Error("MONGO_URI is not defined in environment variables");
9+
}
10+
const conn = await mongoose.connect(mongoUri);
611
console.log(`You are connect to MongoDB database: ${conn.connection.host}`);
712
} catch (error) {
813
console.log(`MongoDB error: ${error.message}`);

0 commit comments

Comments
 (0)