StepWiseMart is an e-commerce platform that allows users to shop for shoes with a unique augmented reality (AR) feature, letting them try on shoes virtually using their camera. The platform also includes all essential e-commerce features such as product sorting, categories, and a checkout system.
This project is built using the following tech stack:
- Frontend: ReactJS with Tailwind CSS (via Vite)
- Backend: FastAPI with Uvicorn
- Database: PostgreSQL
Before running this project, ensure you have the following installed:
- Python 3.7+
- Node.js (with npm)
- PostgreSQL (or use a cloud database)
To set up the FastAPI backend:
-
Clone the repository:
git clone https://github.com/yourusername/StepWiseMart.git cd StepWiseMart
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
If you don't have a
requirements.txt
, run:pip install fastapi uvicorn sqlalchemy psycopg2
You can add any additional dependencies as your project grows.
-
Set up your PostgreSQL database:
- Create a PostgreSQL database (e.g.,
stepwisemart
). - Update the database URL in your project’s configuration (for example, in
config.py
or.env
):DATABASE_URL="postgresql://user:password@localhost:5432/stepwisemart"
- Create a PostgreSQL database (e.g.,
-
Run the backend:
- Start Uvicorn to run FastAPI:
uvicorn app.main:app --reload
- This will start the FastAPI server at
http://127.0.0.1:8000
.
- Start Uvicorn to run FastAPI:
-
Migrate the database (using Alembic or a similar tool): If you have SQLAlchemy models, run migrations:
alembic upgrade head
If you don't have migrations, you can manually create tables in PostgreSQL using the
Base.metadata.create_all()
command in your FastAPI code.
To set up the frontend with Vite, ReactJS, and Tailwind CSS:
-
Navigate to the frontend directory:
cd frontend
-
Install dependencies: First, ensure you have Node.js installed. Then, run the following:
npm install
-
Configure Tailwind CSS: If Tailwind isn't set up yet, you can follow these steps:
- Install Tailwind and its dependencies:
npm install tailwindcss postcss autoprefixer npx tailwindcss init
- Add the following configuration to
tailwind.config.js
:module.exports = { content: [ "./index.html", "./src/**/*.{js,ts,jsx,tsx}", ], theme: { extend: {}, }, plugins: [], }
- Add the Tailwind directives to your main
index.css
file:@tailwind base; @tailwind components; @tailwind utilities;
- Install Tailwind and its dependencies:
-
Run the frontend: Start the Vite development server:
npm run dev
- This will run the frontend at
http://localhost:3000
.
- This will run the frontend at
-
Start the backend (FastAPI with Uvicorn):
uvicorn app.main:app --reload
-
Start the frontend (Vite):
npm run dev
With both the backend and frontend running, you can now visit
http://localhost:3000
to view the app and test the features.
We welcome contributions to improve the project! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-name
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push your branch (
git push origin feature-name
). - Open a Pull Request.
This project is licensed under the MIT License.