A full-stack e-commerce web application for online book sales, built with modern web technologies and following best practices in database design and software architecture.
This project is a comprehensive online bookstore management system that simulates real-world e-commerce operations. It features a dual-interface design separating customer-facing store functionality from administrative management tools, all backed by a robust PostgreSQL database.
Customer Interface:
- Browse and search books by title, author, ISBN, or category
- View detailed book information with real-time inventory
- Persistent shopping cart across sessions
- Complete order checkout and tracking
- User account management
Admin Interface:
- Book catalog management (CRUD operations)
- Inventory tracking with full audit trail
- Order processing and fulfillment
- User management and access control
- Sales analytics and low-stock alerts
- Frontend: Vue.js 3 + Vike (SSR) + Tailwind CSS + DaisyUI
- Backend: Node.js + Express + TypeScript
- Database: PostgreSQL + Prisma ORM
- Deployment: Vercel
- Authentication: Auth.js
- Node.js 20.x or higher
- pnpm (recommended) or npm
- PostgreSQL database (local or cloud)
-
Install dependencies
pnpm install
-
Set up environment variables
Create a
.envfile in the root directory:DATABASE_URL="postgresql://user:password@host:port/database" AUTH_SECRET="your-auth-secret-here"
-
Initialize the database
# Generate Prisma client pnpm prisma:generate # Push schema to database pnpm prisma:push # Seed initial data (books, categories, test users) pnpm prisma:seed
Or run all steps at once:
pnpm db:setup
-
Start the development server
pnpm dev
The application will be available at
http://localhost:3000
After seeding the database, you can use these test accounts:
- Regular User:
testuser/123456 - Administrator:
admin/admin123
- View/Edit data:
pnpm prisma:studio - Update schema: Modify
prisma/schema.prisma, then runpnpm prisma:push - Reset database: Delete and re-run
pnpm db:setup
pnpm buildpnpm previewThe project is configured for Vercel deployment. Simply connect your GitHub repository to Vercel and it will automatically deploy on push.
Make sure to set the following environment variables in Vercel:
DATABASE_URL- Your production PostgreSQL connection stringAUTH_SECRET- Your authentication secret
├── pages/ # Vike pages (routes)
├── server/ # Express server and API routes
├── prisma/ # Database schema and migrations
│ ├── schema.prisma # Database schema definition
│ └── seed.ts # Initial data seeding
├── components/ # Vue components
├── layouts/ # Page layouts
└── docs/ # Project documentation
pnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm lint- Run ESLintpnpm prisma:studio- Open Prisma Studiopnpm prisma:generate- Generate Prisma Clientpnpm prisma:push- Push schema to databasepnpm prisma:seed- Seed database with initial data
- 伍浩 (71123141) - Database design, Backend development
- 吴榜 (71123323) - Frontend development, Deployment
- 马芝兰 (71123143) - Requirements analysis, Testing
- 陈昱衡 (71123144) - Architecture design, Optimization
This project is developed as part of a database systems course at Southeast University.