Full-stack e-commerce application built with Angular and Medusa.js.
- 🛍️ Storefront: Modern Angular frontend
- 🚀 Backend: Medusa.js headless commerce engine
- 📦 Monorepo: npm workspaces for easy management
- 🔄 Live Reload: Hot module replacement for both apps
- 🎨 TypeScript: Full type safety across the stack
- Node.js 22+
- npm 10+
- Docker and Docker Compose
- PostgreSQL 12+
- Redis 7+ (optional but recommended)
Using Docker has several advantages:
- No manual database installation - PostgreSQL and Redis run in containers
- Consistent environment - Same setup across all development machines
- Easy cleanup - Remove everything with one command
- Isolated services - No conflicts with other projects
- Production-like setup - Closer to deployment environment
git clone <your-repo-url>
cd ecommerce-starterdocker-compose up -dThis starts:
- PostgreSQL 15 on port 5432
- Redis 7 on port 6379
npm run install:allnpm run devgit clone <your-repo-url>
cd ecommerce-starternpm run install:allThis will:
- ✅ Check system prerequisites
- ✅ Install root dependencies
- ✅ Install storefront (Angular) dependencies
- ✅ Install and configure backend (Medusa)
- ✅ Setup database and run migrations
npm run devThis starts both:
- Storefront at http://localhost:4200
- Backend at http://localhost:9000
- Admin at http://localhost:9000/app
npm run docker:up # Start Docker services (PostgreSQL + Redis)
npm run docker:down # Stop Docker services
npm run docker:logs # View Docker logs
npm run docker:ps # List running containers
npm run docker:restart # Restart Docker services
npm run docker:clean # Stop and remove volumes (deletes data!)npm run dev # Start both servers
npm run dev:backend # Start backend only
npm run dev:storefront # Start storefront onlynpm run build # Build both projects
npm run build:backend # Build backend only
npm run build:storefront # Build storefront onlynpm run test # Run storefront tests
npm run lint # Lint storefront codenpm run backend:seed # Seed database with sample data
npm run backend:migrations # Run database migrations
npm run backend:user # Create admin usernpm run clean # Remove all dependencies and builds
npm run clean:backend # Remove backend only
npm run clean:storefront # Remove storefront dependenciesecommerce-starter/
├── backend/ # Medusa backend (auto-generated)
├── storefront/ # Angular storefront
│ ├── src/
│ ├── angular.json
│ └── package.json
├── scripts/ # Installation scripts
│ ├── install.js # Master installer
│ ├── install-backend.js
│ └── templates/
├── package.json # Workspace root
└── README.md
Configuration is in backend/.env:
DATABASE_URL=postgres://user:password@localhost:5432/medusa
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret
COOKIE_SECRET=your-secret
STORE_CORS=http://localhost:4200Angular environment files in storefront/src/environments/:
export const environment = {
production: false,
apiUrl: 'http://localhost:9000'
};Since this is an npm workspace, you can run commands in specific packages:
# Run command in storefront
npm run <script> --workspace=storefront
# Run command in backend
npm run <script> --workspace=backend
# Install package in storefront
npm install <package> --workspace=storefrontdocker-compose up -d # Start in background
docker-compose up # Start with logsdocker-compose down # Stop services
docker-compose down -v # Stop and remove volumes (deletes data!)docker-compose logs # All services
docker-compose logs postgres # PostgreSQL only
docker-compose logs redis # Redis only
docker-compose logs -f # Follow logsdocker-compose ps # List running servicesdocker-compose exec postgres psql -U medusa -d medusadocker-compose restart # Restart all
docker-compose restart postgres # Restart PostgreSQL only# Kill process on port 9000 (backend)
npx kill-port 9000
# Kill process on port 4200 (storefront)
npx kill-port 4200Using Docker:
# Check if services are running
docker-compose ps
# Restart database
docker-compose restart postgres
# View database logs
docker-compose logs postgresManual PostgreSQL:
- Ensure PostgreSQL is running
- Check
backend/.envdatabase URL - Verify database exists:
psql -l
npm run clean
npm run install:allMIT