You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A complete RESTful API for an e-commerce platform. Covers the full shopping flow: authentication, product and category management, shopping cart, and order checkout. Features data validation via Zod, token-based auth with JWT, transactional emails via Nodemailer, and the Prisma ORM connected to PostgreSQL. The entire infrastructure is containerized with Docker, including a pgAdmin panel for database administration. Code quality is enforced with ESLint, Prettier, and EditorConfig.
💡 A cart is created automatically on account registration.
Orders — /store/orders
Route
Method
Auth
Payload
Description
/
POST
🔒
—
Checkout all items in the cart
/
GET
🔒
—
List all orders for the user
/:id
GET
🔒
—
Get order by ID
💡 On checkout: the price is frozen at purchase time, stock is decremented, and the cart is cleared automatically.
🚀 Running Locally (Docker)
Make sure you have Docker Desktop installed and running.
# 1. Clone the repository
git clone https://github.com/seu-usuario/e-commerce-api.git
cd e-commerce-api
# 2. Set up environment variables
cp .env.example .env
# Fill in your values in .env# 3. Start the full infrastructure (API, Database, pgAdmin)
docker-compose up -d --build
# 4. Run database migrations
docker-compose exec api npx prisma migrate dev
API REST de e-commerce desenvolvida para compor meu portfólio e praticar Node.js, Express e PostgreSQL com Prisma, com ênfase em autenticação, lógica de negócios e boas práticas de backend.