A modern e-commerce platform for eco-friendly dining products built with React and Express.js.
- Responsive front-end built with React
- Complete admin dashboard with product, order, and customer management
- Data visualization with Chart.js
- SQLite database with better-sqlite3
- RESTful API endpoints for all data operations
- Search and filter functionality
- Cart management system
- Node.js (v14+)
- Bun
-
Clone the repository:
git clone https://github.com/yourusername/greendining.git cd greendining -
Install dependencies:
bun install -
Run the application (two options):
Option 1: Use the provided batch file:
start-app.batThis will open both the server and frontend in separate windows.
Option 2: Run the development server directly:
bun run dev:full -
Open your browser and navigate to:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001/api
/src- React frontend/server- Express.js backend/server/db- SQLite database and connection/server/routes- API routes
/public- Static assets
/api/products- Product management/api/customers- Customer management/api/orders- Order management/api/analytics- Analytics and reporting
bun run dev- Start the frontend development serverbun run server- Start the backend serverbun run dev:full- Start both frontend and backend concurrentlystart-app.bat- Windows batch file to start both services
This repository includes utility batch files to help with development and setup:
start-app.bat- Start the application with server and frontendcleanup-npm.bat- Remove npm-related files and ensure Bun-only setupinit-repo.bat- Initialize a new Git repository, clean up npm files, and prepare for first push
- The database file is included for demonstration purposes only
- In a production environment:
- Use environment variables for configuration (.env files)
- Implement proper authentication and authorization
- Consider using a more robust database solution
For any questions or support, please open an issue on GitHub.
This project is configured for deployment on Netlify:
-
Connect to GitHub:
- Sign up for Netlify and connect your GitHub account
- Select the repository containing this project
-
Configure the Build Settings:
- Build command:
bun run build - Publish directory:
dist - The
netlify.tomlfile already contains the necessary configuration
- Build command:
-
Environment Variables: Add these in the Netlify dashboard under Site settings → Environment variables:
- No environment variables are required for basic functionality
-
Deploy:
- Click 'Deploy site' in the Netlify dashboard
- Netlify will build and deploy your site automatically
-
Using Netlify Functions: The project is set up with Netlify Functions to handle backend APIs. When deployed, API calls will automatically be routed to the serverless functions in the
netlify/functionsdirectory.