pf-shop is an ecommerce website built with TypeScript, React, Redux, Redux Thunk, and Firestore. The project features include browsing and purchasing products, searching products by name, description, or tags, adding items to a cart and checkout, and authentication and authorization for users and admin.
To install the project, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/pf-shop.git
- Install dependencies:
cd pf-shop
npm install
To start the development server, run:
npm start
This will start the development server at http://localhost:3000.
To build the project for production, run:
npm run build
This will create a production build in the build directory.
To use Firebase authentication and authorization, you need to create a Firebase project and configure the credentials in the src/utils/firebase/firebase.utils.js file.
-
Create a Firebase project at https://console.firebase.google.com/.
-
In the Firebase console, go to Project settings > General and copy the Firebase SDK snippet > Config object.
-
Paste the config object in the src/utils/firebase/firebase.utils.js file:
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
databaseURL: "YOUR_DATABASE_URL",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID",
};
-
In the Firebase console, go to Authentication > Sign-in method and enable the Email/Password provider.
-
In the Firebase console, go to Firestore Database > Create database and choose Start in test mode.
-
In the Firebase console, go to Firestore Database > Rules and replace the default rules with the following:
While contributions are welcome, this is strictly a technology showcase for a developer portfolio.