A production-ready REST API for an e-commerce boutique built with Node.js, Express, PostgreSQL, JWT Authentication and Stripe payments. Deployed on a VPS with a custom domain and HTTPS.
https://zakmt.dev
- Node.js
- Express.js
- PostgreSQL
- JWT Authentication
- Bcrypt
- Stripe
MVC (Model, View, Controller)
POST /auth/register→ Create an accountPOST /auth/login→ Login and get a token 🔑
GET /products→ Get all productsGET /products/:id→ Get a product by idPOST /products→ Create a product (admin only) 🔒PUT /products/:id→ Update a product (admin only) 🔒DELETE /products/:id→ Delete a product (admin only) 🔒
POST /orders→ Place an order 🛒GET /orders→ Get all your ordersGET /orders/:id→ Get an order by idPOST /orders/:id/pay→ Pay with Stripe 💳
- Clone the repository
- Run
npm install - Create a
.envfile with your credentials - Run
node server.js
DB_HOST=localhost
DB_USER=postgres
DB_PASSWORD=yourpassword
DB_NAME=yourdbname
DB_PORT=5432
JWT_SECRET=yoursecret
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
CLIENT_URL=https://yourdomaine.devDeployed on DigitalOcean VPS with :
- Nginx → reverse proxy
- PM2 → process manager
- Let's Encrypt → SSL certificate