https://github.com/espinbrandon49/swap-meet-react
Full Stack Ecommerce - Swap Meet React
https://github.com/espinbrandon49/swap-meet-react
axios-rest bcrypt-nodejs bootstrap expressjs formik formik-yup heroku jwt-authentication multer mysql nodejs react react-bootstrap react-dom react-router react-router-dom react-toastify sequelize-orm
Last synced: 5 months ago
JSON representation
Full Stack Ecommerce - Swap Meet React
- Host: GitHub
- URL: https://github.com/espinbrandon49/swap-meet-react
- Owner: espinbrandon49
- License: mit
- Created: 2023-08-21T14:55:49.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-24T00:10:22.000Z (6 months ago)
- Last Synced: 2025-09-24T02:23:14.462Z (6 months ago)
- Topics: axios-rest, bcrypt-nodejs, bootstrap, expressjs, formik, formik-yup, heroku, jwt-authentication, multer, mysql, nodejs, react, react-bootstrap, react-dom, react-router, react-router-dom, react-toastify, sequelize-orm
- Language: JavaScript
- Homepage: https://jovial-belekoy-f030f6.netlify.app/login
- Size: 5.32 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# Swap Meet React API
A fully functional RESTful API for managing users, categories, products, tags, and shopping carts. Built with Node.js, Express, Sequelize, and MySQL.
---
## π EntityβRelationship Diagram (ERD)

---
## π Features
- User authentication with JWT
- Category + Product ownership scoped to users
- Tagging system (many-to-many between products and tags)
- Shopping cart with item quantities
- Full CRUD support across all entities
- Sequelize models with associations and alias consistency
---
## π οΈ Tech Stack
- Backend: Node.js, Express
- Database: MySQL with Sequelize ORM
- Auth: JWT-based authentication
- Testing: Insomnia REST client
---
## π Project Structure
server/
βββ models/ # Sequelize models
βββ routes/ # Express routes
βββ seeds/ # Database seeding script
βββ config/ # DB connection
βββ server.js # Express entry point
---
## βοΈ Setup
1. Clone Repo
git clone
cd Swap-Meet-React
2. Install Dependencies
npm install --workspaces
3. Configure Environment
Create a `.env` file:
NODE_ENV=development
DB_NAME=swapmeetreact
DB_USER=root
DB_PW=password
DB_HOST=127.0.0.1
DB_PORT=3306
JWT_SECRET=your-secret-key
4. Setup Database
mysql -u root -p
DROP DATABASE IF EXISTS swapmeetreact;
CREATE DATABASE swapmeetreact;
EXIT;
5. Seed Database
npm run seed --workspace server
6. Start Server
npm run dev --workspace server
Server will run at:
http://localhost:3001/api
---
## π§ͺ API Endpoints
### Users
- POST /users β Register
- POST /users/login β Login (returns JWT)
- GET /users/auth β Validate token
- GET /users/basicinfo/:id β Public profile
### Categories
- GET /categories β All categories (with products)
- GET /categories/:id β Single category (with products)
- POST /categories β Create category
- PUT /categories/:id β Update category
- DELETE /categories/:id β Delete category
### Products
- GET /products β All user products
- GET /products/:id β Single product
- GET /products/by-category/:category_id β Products by category
- POST /products β Create product
- PATCH /products/:id β Update product
- DELETE /products/:id β Delete product
### Tags
- GET /tags β All tags (with products)
- GET /tags/:id β Single tag (with products)
- POST /tags β Create tag
### Cart
- POST /cart β Create or return userβs cart
- GET /cart/me β Get userβs cart (with products)
- POST /cart/items β Add product to cart
- DELETE /cart/items β Remove product from cart
---
## π§ͺ Testing with Insomnia
Import the provided Insomnia collection (Insomnia_2025-09-23.yaml) to test all endpoints.
Workflow:
1. Register or log in a user
2. Copy JWT β set as {{ accessToken }}
3. Run category/product/cart requests
---
## π License
MIT License β free to use and modify.