This is the frontend application for Tiny Explorer, an e-commerce platform for baby products. It is built using Astro, React, and Tailwind CSS.
- Framework: Astro
- UI Library: React
- Styling: Tailwind CSS
- Icons: Lucide React
Before starting the project, you need to configure the environment variables.
-
Create Local Environment File Copy the template file to create your local environment file:
cp env.template .env.local
-
Strapi Setup
STRAPI_URL: The URL where your Strapi backend is running (default:http://localhost:1337).STRAPI_TOKEN: Generate an API token in your Strapi Admin Panel:- Go to Settings > Global Settings > API Tokens.
- Click Create new API Token.
- Name it (e.g., "Frontend"), select Full Access (or Custom with appropriate permissions), and save.
- Copy the generated token and paste it as the value for
STRAPI_TOKEN.
-
Medusa Setup
PUBLIC_MEDUSA_BACKEND_URL: The URL of your Medusa backend (e.g.,http://localhost:9000or your deployed URL).PUBLIC_MEDUSA_PUBLISHABLE_KEY: Generate a publishable API key in your Medusa Admin:- Go to Settings > Publishable API Keys.
- Click Create API Key.
- Give it a title (e.g., "Storefront") and create it.
- Copy the key (starts with
pk_...) and paste it as the value forPUBLIC_MEDUSA_PUBLISHABLE_KEY. - Important: Ensure you associate this key with the necessary Sales Channels in the Medusa settings.
All commands are run from the root of this project (tiny-explorer-fe).
pnpm installTo start the local development server:
pnpm run devThe site will be available at http://localhost:4321.
To build the project for production:
pnpm run buildThe output will be in the dist/ directory.
To preview the production build locally:
pnpm run preview/
├── public/ # Static assets (images, fonts, etc.)
├── src/
│ ├── assets/ # Imported assets
│ ├── components/ # React and Astro components
│ ├── layouts/ # Page layouts
│ ├── pages/ # File-based routing
│ └── styles/ # Global styles (if any)
└── package.json