A modern, full-stack e-commerce application built with cutting-edge technologies for scalability and performance.
- Framework: Fastify (high-performance Node.js web framework)
- Database: PostgreSQL with Prisma ORM
- Language: TypeScript
- Authentication: JWT-based auth system
- Integration: Shopify webhooks and API
- Framework: Next.js 14 with React 18
- Language: TypeScript
- Styling: Modern CSS with responsive design
- State Management: React Context API
- HTTP Client: Axios
barebones/
βββ apps/
β βββ api/ # Backend API Server
β β βββ prisma/
β β β βββ schema.prisma # Database schema
β β βββ src/
β β β βββ routes/ # API route handlers
β β β β βββ auth.ts # Authentication routes
β β β β βββ products.ts # Product management
β β β β βββ orders.ts # Order processing
β β β β βββ checkout.ts # Checkout flow
β β β βββ services/ # Business logic
β β β βββ utils/ # Utility functions
β β β βββ prisma/ # Database client
β β β βββ seed.ts # Database seeding
β β β βββ index.ts # Server entry point
β β βββ package.json
β βββ web/ # Frontend Next.js App
β βββ components/ # React components
β β βββ AuthModal.tsx # User authentication
β β βββ CartSidebar.tsx # Shopping cart
β β βββ ProductGrid.tsx # Product display
β β βββ Header.tsx # Navigation
β βββ contexts/ # React contexts
β β βββ AuthContext.tsx # Authentication state
β β βββ CartContext.tsx # Cart management
β β βββ ToastContext.tsx# Notifications
β βββ pages/ # Next.js pages
β β βββ index.tsx # Home page
β β βββ products.tsx # Product catalog
β β βββ orders.tsx # Order history
β β βββ profile.tsx # User profile
β βββ package.json
βββ package.json # Root package.json (workspace)
βββ README.md
- Node.js 18+
- PostgreSQL database
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/billyndroid/barebones.git cd barebones -
Install dependencies
npm install
-
Set up environment variables
# Copy environment template cp .env.example .envConfigure your database connection and other settings in
.env -
Initialize the database
# Generate Prisma client npm run db:generate --workspace=apps/api # Push schema to database npm run db:push --workspace=apps/api # Seed with sample data (optional) npm run db:seed --workspace=apps/api
-
Start development servers
# Start both API and web servers npm run dev # Or start individually: npm run dev:api # API server only npm run dev:web # Web app only
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
- API Health Check: http://localhost:3001/health
GET /api/products- List all productsGET /api/products/:id- Get single productPOST /api/products- Create product (admin)PUT /api/products/:id- Update product (admin)DELETE /api/products/:id- Delete product (admin)
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/profile- Get user profile
GET /api/orders- Get user ordersPOST /api/orders- Create new orderGET /api/orders/:id- Get specific order
POST /api/checkout/create-payment-intent- Create Stripe PaymentIntentPOST /api/checkout/confirm-payment/:orderId- Confirm payment completionPOST /api/checkout/complete/:orderId- Complete order (legacy/demo)POST /api/checkout/webhook/stripe- Handle Stripe webhooksGET /api/checkout/order-status/:orderId- Get order payment status
- β Product catalog with search and filtering
- β User authentication (register/login)
- β Shopping cart functionality
- β Order management
- β Responsive design
- β TypeScript throughout
- β Database with Prisma ORM
- β Error handling and validation
- β CORS configuration
- β Health monitoring
- β Payment integration foundation (Stripe-ready architecture)
- β Enhanced checkout flow with payment tracking
- β Order payment status management
- π Full Stripe Elements integration (see STRIPE_SETUP.md)
- π Admin dashboard
- π Product reviews and ratings
- π Email notifications
- π Inventory management
- π Shopify integration completion
The application uses PostgreSQL with the following main entities:
- Users: Customer accounts and authentication
- Products: Product catalog with pricing and descriptions
- Orders: Purchase orders and transaction history
- OrderItems: Individual items within orders
# Root level commands
npm run dev # Start both API and web servers
npm run dev:api # Start API server only
npm run dev:web # Start web server only
npm run build # Build both applications
npm run db:generate # Generate Prisma client
npm run db:push # Push schema to database
npm run db:seed # Seed database with sample data- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Port conflicts: If ports 3000 or 3001 are in use:
# Kill existing processes
taskkill /F /IM node.exe
# Or change ports in the configurationDatabase connection: Ensure PostgreSQL is running and connection string is correct in .env
CORS errors: The API is configured to allow requests from localhost:3000 and localhost:3002
For issues and questions, please open an issue on GitHub or contact the development team.