A modern e-commerce platform for discovering and selling unique fashion items with an emphasis on aesthetic categories. Built with a modern tech stack for optimal performance and developer experience.
- ποΈ Browse products by aesthetic categories
- π Advanced product filtering and search functionality
- π Shopping cart and secure checkout process
- π± Mobile-first responsive design
- π Secure user authentication
- π Order tracking and history
- πͺ Seller dashboard for product management
- π Product listing with image uploads
- π Sales analytics and reporting
- π€ Real-time inventory management
- π·οΈ Category and collection management
- π Responsive design with modern UI components
- β‘ Optimized performance with Vite
- π Secure JWT-based authentication
- π± Mobile-friendly interface
| Technology | Description |
|---|---|
| React 18 | Frontend library for building user interfaces |
| TypeScript | Static type checking |
| Vite | Next Generation Frontend Tooling |
| Tailwind CSS | Utility-first CSS framework |
| shadcn/ui | Beautifully designed components |
| React Query | Server state management |
| React Hook Form | Form handling with Zod validation |
| React Router v6 | Client-side routing |
| Lucide React | Beautiful & consistent icons |
| Playwright | End-to-end testing |
| Technology | Description |
|---|---|
| Node.js 18+ | JavaScript runtime |
| Express | Web application framework |
| PostgreSQL | Relational database |
| node-pg-migrate | SQL migration tool |
| JWT | Authentication with refresh tokens |
| Express Validator | Request validation |
| Winston | Logging |
| RESTful API | Resource-based API design |
Before you begin, ensure you have the following installed:
- Node.js 18+ (LTS version recommended)
- npm 9+ or yarn 1.22+
- PostgreSQL 13+ (with pgAdmin for database management)
- Git for version control
- Modern web browser (Chrome, Firefox, Safari, or Edge)
- Code editor (VS Code, WebStorm, etc.)
git clone https://github.com/yourusername/byblos.git
cd byblos# Install frontend dependencies
npm install
# Install server dependencies
cd server && npm install && cd ..Create the following files with the required environment variables:
VITE_API_URL=http://localhost:3002/api
NODE_ENV=development
# VITE_GA_MEASUREMENT_ID=G-XXXXXXXXXX # Uncomment for Google Analytics# Server
PORT=3002
NODE_ENV=development
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=byblos
DB_USER=your_db_user
DB_PASSWORD=your_secure_password
# JWT
JWT_SECRET=generate_a_strong_secret_here
JWT_EXPIRES_IN=24h
JWT_REFRESH_EXPIRES_IN=7d
# Payment providers
PAYMENT_PROVIDER=paystack
PAYOUT_PROVIDER=paystack
PAYSTACK_SECRET_KEY=
PAYSTACK_PUBLIC_KEY=
PAYSTACK_BASE_URL=https://api.paystack.co
PAYSTACK_WEBHOOK_IPS=52.31.139.75,52.49.173.169,52.214.14.220
PAYSTACK_WEBHOOK_URL=https://bybloshq.space/api/webhooks/paystack
PAYSTACK_PAYMENT_CALLBACK_URL=https://bybloshq.space/api/webhooks/paystack
PAYSTACK_PAYOUT_CALLBACK_URL=https://bybloshq.space/api/webhooks/paystack
# Email (optional)
# SMTP_HOST=smtp.example.com
# SMTP_PORT=587
# SMTP_USER=your_email@example.com
# SMTP_PASS=your_email_password
# EMAIL_FROM=noreply@bybloshq.space-
Create a new PostgreSQL database
# Connect to PostgreSQL psql -U postgres # Create database and user CREATE DATABASE byblos; CREATE USER your_db_user WITH PASSWORD 'your_secure_password'; GRANT ALL PRIVILEGES ON DATABASE byblos TO your_db_user;
-
Run database migrations
# From the server directory cd server # Run migrations and seeds npm run migrate npm run seed # Optional: for sample data
# From project root
npm run dev# From server directory
cd server && npm run dev- Frontend:
http://localhost:5173 - API:
http://localhost:3002/api - API Docs:
http://localhost:3002/api-docs(if Swagger is configured) - PgAdmin:
http://localhost:5050(if using Docker)
- Customer View:
http://localhost:5173 - Seller Dashboard:
http://localhost:5173/seller/dashboard - Admin Dashboard:
http://localhost:5173/admin/dashboard
# Run all tests
npm test
# Run frontend tests
npm run test:frontend
# Run backend tests
cd server && npm test
# Run E2E tests
npm run test:e2e# Build the frontend for production
npm run build
# Start production server (from server directory)
cd server && NODE_ENV=production npm start
# Or using PM2 (recommended for production)
npm install -g pm2
pm2 start server/dist/index.js --name "byblos-api"Run the entire stack with Docker Compose:
docker-compose up -dThis will start:
- Frontend (port 80)
- Backend API (port 3002)
- PostgreSQL (port 5432)
- PgAdmin (port 5050)
.
βββ public/ # Static files
βββ server/ # Backend server code
β βββ src/
β β βββ config/ # Configuration files
β β βββ controllers/ # Request handlers
β β βββ loaders/ # Startup loaders
β β βββ middleware/ # Express middleware
β β βββ models/ # Database models
β β βββ routes/ # API routes
β β βββ services/ # Business logic
β β βββ utils/ # Utility functions
β β βββ index.js # Server entry point
β βββ migrations/ # Database migrations
β
βββ src/ # Frontend source
β βββ api/ # API service functions
β βββ assets/ # Static assets
β βββ components/ # Reusable components
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ store/ # State management
β βββ styles/ # Global styles
β βββ types/ # TypeScript type definitions
β βββ utils/ # Utility functions
β βββ App.tsx # Main application component
β
βββ .env # Frontend environment variables
βββ .env.example # Example environment variables
βββ package.json # Frontend dependencies
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
β βββ assets/ # Static assets
β βββ components/ # Reusable UI components
β βββ contexts/ # React contexts
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ routes/ # Application routes
β βββ styles/ # Global styles
β βββ types/ # TypeScript type definitions
βββ .gitignore
βββ package.json
βββ README.md
βββ tsconfig.json
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- shadcn/ui - Beautifully designed components
- Vite - Next generation frontend tooling
- Tailwind CSS - Utility-first CSS framework
- React Query - Server state management
- node-pg-migrate - SQL migration tool
- Express - Fast, unopinionated web framework
- API Documentation (available when server is running)
- Frontend Architecture
- API Reference
- Database Schema
The site uses Let's Encrypt certificates managed by Certbot. Certificates expire every 90 days and must be renewed. The nginx container reads certs from ./ssl/ on the VPS.
SSH into the VPS and run:
cd /path/to/bybloshq
sudo ./scripts/renew-ssl.shThis stops nginx, renews via certbot standalone, copies certs to ./ssl/, and restarts nginx.
sudo ./scripts/setup-ssl-auto-renewal.sh /path/to/bybloshqThis installs:
- A certbot deploy hook that copies new certs to
./ssl/and reloads nginx after every renewal - A daily cron job (
0 3 * * *) that attempts renewal (certbot only acts when cert is < 30 days from expiry)
Test the auto-renewal config at any time:
sudo certbot renew --dry-runFor support, please open an issue or reach out to our team at support@bybloshq.space