A Modern Full-Stack Pharmaceutical E-Commerce Platform
Features • Tech Stack • Getting Started • Documentation • Contributing
Zenvira is a comprehensive, production-ready pharmaceutical e-commerce platform that connects customers with verified medication sellers. Built with modern technologies and best practices, it provides a seamless shopping experience with robust seller management, order processing, and administrative controls.
- Multi-vendor Marketplace: Support for multiple sellers with individual dashboards
- Role-based Access Control: Customer, Seller, and Admin roles with specific permissions
- Real-time Stock Management: Automatic inventory tracking and prevention of overselling
- Secure Authentication: Email verification, password reset, and session management
- Production Ready: Optimized for deployment on Vercel with serverless architecture
- Browse and search medicines with advanced filtering
- Add products to cart and wishlist
- Place orders with multiple payment options
- Track order status in real-time
- Write and read product reviews
- Email-based account verification
- Apply to become a verified seller
- Manage product listings (CRUD operations)
- View and process orders
- Access sales analytics and statistics
- Track customer reviews
- Review and approve seller applications
- Manage all users, products, and orders
- Platform-wide analytics dashboard
- Category management
- Full access control
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 16.1.6 | React meta-framework with App Router |
| React | 19.2.3 | UI library |
| TypeScript | 5.x | Type safety |
| TailwindCSS | 4.x | Utility-first CSS |
| shadcn/ui | 3.8.0 | Component library |
| Radix UI | 1.4.3 | Accessible UI primitives |
| Better Auth | 1.4.18 | Authentication client |
| Technology | Version | Purpose |
|---|---|---|
| Express.js | 5.2.1 | Web framework |
| Prisma | 7.3.0 | ORM with PostgreSQL |
| PostgreSQL | 15+ | Primary database |
| Better Auth | 1.4.18 | Authentication server |
| Nodemailer | 7.0.13 | Email services |
| bcrypt | 6.0.0 | Password hashing |
Zenvira/
├── zenvira-client/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # App Router pages
│ │ ├── components/ # Reusable React components
│ │ ├── context/ # React Context providers
│ │ ├── lib/ # Utilities and configurations
│ │ └── data/ # Static data
│ └── public/ # Static assets
│
├── server/ # Express.js backend API
│ ├── src/
│ │ ├── routes/ # API route handlers
│ │ ├── middleware/ # Authentication middleware
│ │ └── lib/ # Prisma client and auth config
│ ├── prisma/ # Database schema and migrations
│ └── api/ # Vercel serverless functions
│
├── docs/ # Documentation
└── README.md # This file
- Node.js >= 20.0.0
- npm or yarn or pnpm
- PostgreSQL >= 15
- Git
git clone https://github.com/abnahid/Zenvira.git
cd Zenvira# Navigate to server directory
cd server
# Install dependencies
npm install
# Create environment file
cp .env.example .envConfigure your .env file:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/zenvira?schema=public"
# Authentication
BETTER_AUTH_SECRET="your-secret-key-min-32-characters"
BETTER_AUTH_URL="http://localhost:5000"
# CORS
TRUSTED_ORIGIN="http://localhost:3000"
# Email (Gmail SMTP)
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
SMTP_FROM_EMAIL="noreply@zenvira.com"# Run database migrations
npm run db:migrate
# Seed database (optional)
npx prisma db seed
# Start development server
npm run devThe API server will be running at http://localhost:5000
# Navigate to client directory (from root)
cd zenvira-client
# Install dependencies
npm install
# Create environment file
cp .env.example .env.localConfigure your .env.local file:
NEXT_PUBLIC_API_BASE_URL="http://localhost:5000"# Start development server
npm run devThe client will be running at http://localhost:3000
- Development:
http://localhost:5000/api - Production:
https://your-domain.vercel.app/api
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/sign-up/email |
Register new user |
| POST | /api/auth/sign-in/email |
Login user |
| POST | /api/auth/sign-out |
Logout user |
| GET | /api/auth/session |
Get current session |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/medicines |
Get all medicines (with filters) |
| GET | /api/medicines/:slug |
Get medicine by slug |
| POST | /api/medicines |
Create medicine (seller/admin) |
| PUT | /api/medicines/:id |
Update medicine |
| DELETE | /api/medicines/:id |
Delete medicine |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/orders |
Get user's orders |
| POST | /api/orders |
Create new order |
| PUT | /api/orders/:id/status |
Update order status |
| DELETE | /api/orders/:id |
Cancel order |
For complete API documentation, see docs/api-contract.md
cd server
vercel --prodRequired environment variables in Vercel:
DATABASE_URL(with?sslmode=require)BETTER_AUTH_SECRETBETTER_AUTH_URLTRUSTED_ORIGINSMTP_USERSMTP_PASS
cd zenvira-client
vercel --prodRequired environment variables:
NEXT_PUBLIC_API_BASE_URL
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ User │────<│ Order │────<│ OrderItem │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
│ 1:N │ N:1
▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Review │ │ Category │────<│ Medicine │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
└────────────────────────────────────────┘
N:1
| Script | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build for production |
npm start |
Start production server |
npm run db:migrate |
Run database migrations |
npm run db:push |
Push schema changes |
npm run db:studio |
Open Prisma Studio |
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm start |
Start production server |
npm run lint |
Run ESLint |
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- 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
For security vulnerabilities, please see our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
Abdul Jabbar Al Nahid
Student of Level-6
abnahid.com
- Next.js - The React Framework
- Prisma - Next-generation ORM
- TailwindCSS - Utility-first CSS framework
- shadcn/ui - Beautiful UI components
- Better Auth - Authentication library
- Vercel - Deployment platform
Made with ❤️ by abnahid
