This repository contains an E-Commerce application.
Follow these steps to set up and run the project locally:
-
Clone the repository:
git clone https://github.com/yourusername/E-Commerce.git cd E-Commerce -
Install dependencies:
npm install
-
Configure environment variables:
- Copy the environment example file to create your own
.envfile:cp $env-example.sh .env - Fill in the required environment variables in the
.envfile:VITE_GOOGLE_CLIENT_ID: Your Google OAuth client IDVITE_API_URL: The backend API URL (default: http://localhost:5000)VITE_REDIRECT_URI: The OAuth redirect URI (default: http://localhost:5173/auth/callback)VITE_USE_SERVER_OAUTH: Whether to use server-side OAuth (default: true)
- Copy the environment example file to create your own
-
Start the development server:
npm run dev
-
Open your browser and navigate to the local development server (typically http://localhost:5173)
This frontend application connects to a backend API service located at http://localhost:5000. Make sure the backend server is running before starting the frontend application.
The backend API provides all the necessary endpoints for user authentication, product management, and order processing.
- Frontend: React with Vite
- Backend: API running on port 5000
- Authentication: Google OAuth