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