This is a production-ready full-stack bookstore platform built with modern web technologies.
- Docker Desktop (or Docker Engine + Compose plugin)
- Create backend environment file:
cp backend/.env.example backend/.env-
Fill in OAuth credentials in backend/.env
-
Start everything:
docker compose up --buildServices will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:4000
- MongoDB: mongodb://localhost:27017
cd backend
npm install
npm run devcd frontend
npm install
npm run devSee .env.example files in backend/ and frontend/ directories.
BookStore/
├── Backend/ # Node.js/Express API
│ ├── models/ # Mongoose schemas
│ ├── controllers/ # Business logic
│ ├── routes/ # API endpoints
│ ├── middleware/ # Auth, validation, errors
│ ├── config/ # Database connection
│ └── utils/ # Helpers
├── Frontend/ # React + Vite SPA
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── services/ # API client
│ │ ├── context/ # Auth context
│ │ └── utils/ # Utilities
│ └── public/ # Static assets
└── docker-compose.yml # Docker orchestration
- Frontend: React 18, Vite, Tailwind CSS, Axios, React Router
- Backend: Node.js 18, Express, Mongoose, Passport
- Database: MongoDB 7
- Deployment: Docker & Docker Compose
- Web Server: Nginx
- User authentication (JWT + local)
- OAuth login (Google, Discord, Facebook)
- Role-based access control (Admin/Client)
- Books catalog with search
- Categories management
- Order management
- Rate limiting & security headers
- File uploads support
- Responsive UI
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/profile- Get current userPUT /api/auth/profile- Update profile
GET /api/books- Get all books (with pagination & search)GET /api/books/:id- Get book detailsPOST /api/books- Create book (admin only)PUT /api/books/:id- Update book (admin only)DELETE /api/books/:id- Delete book (admin only)
GET /api/categories- Get all categoriesPOST /api/categories- Create category (admin only)PUT /api/categories/:id- Update category (admin only)DELETE /api/categories/:id- Delete category (admin only)
POST /api/orders- Create orderGET /api/orders/my-orders- Get user's ordersGET /api/orders/:id- Get order detailsGET /api/orders- Get all orders (admin only)PUT /api/orders/:id/status- Update order status (admin only)
- Admin User: admin@bookstore.local / Admin123!
- Client User: client@bookstore.local / Client123!
- Helmet.js for security headers
- CORS protection
- JWT token authentication
- Rate limiting
- Password hashing with bcryptjs
- MongoDB data persistence
- Environment variable configuration
- Docker compose may fail if ports 4000, 5173, or 27017 are already in use
- OAuth callbacks must match Backend URL exactly
- Discord email fallback:
<discord_id>@discord.localif not provided
- Implement OAuth flow (Google, Discord, Facebook)
- Add automated tests (unit + integration)
- Add CI/CD pipeline (GitHub Actions)
- Implement payment processing
- Add image upload management
- Add email notifications
- Implement search and filtering