@@ -10,6 +10,7 @@ A Node.js/Express backend server for the WTWR application with user authenticati
1010## 🚀 Quick Start
1111
1212### Prerequisites
13+
1314- Node.js (v22+)
1415- MongoDB
1516- Git
@@ -73,20 +74,21 @@ npm run dev
7374
7475## 🛠️ Available Scripts
7576
76- | Command | Description |
77- | ---------| -------------|
78- | ` npm start ` | Start production server |
79- | ` npm run dev ` | Start development server with nodemon |
80- | ` npm run prebuild ` | Clean install dependencies |
81- | ` npm run seedUser ` | Seed database with test users |
82- | ` npm run seedClothing ` | Seed database with clothing items |
83- | ` npm run lint ` | Run ESLint |
84- | ` npm run db:start ` | Start MongoDB and open shell |
85- | ` npm run db:stop ` | Stop MongoDB |
77+ | Command | Description |
78+ | ---------------------- | ------------------------------------- |
79+ | ` npm start ` | Start production server |
80+ | ` npm run dev ` | Start development server with nodemon |
81+ | ` npm run prebuild ` | Clean install dependencies |
82+ | ` npm run seedUser ` | Seed database with test users |
83+ | ` npm run seedClothing ` | Seed database with clothing items |
84+ | ` npm run lint ` | Run ESLint |
85+ | ` npm run db:start ` | Start MongoDB and open shell |
86+ | ` npm run db:stop ` | Stop MongoDB |
8687
8788## 🗄️ Database Setup
8889
8990### Start MongoDB
91+
9092``` bash
9193# Start service
9294brew services start mongodb-community
@@ -99,6 +101,7 @@ mongosh
99101```
100102
101103### Seed Database
104+
102105``` bash
103106# Create test users
104107npm run seedUser
@@ -120,14 +123,17 @@ NODE_ENV=development
120123## 📚 API Endpoints
121124
122125### Authentication
126+
123127- ` POST /signin ` - User login
124128- ` POST /signup ` - User registration
125129
126130### Users
131+
127132- ` GET /users/me ` - Get current user
128133- ` PATCH /users/me ` - Update user profile
129134
130135### Clothing Items
136+
131137- ` GET /items ` - Get all clothing items
132138- ` POST /items ` - Create new clothing item
133139- ` DELETE /items/:itemId ` - Delete clothing item
@@ -151,6 +157,7 @@ NODE_ENV=development
151157## 🚀 Deployment
152158
153159The application is deployed using:
160+
154161- ** Server:** Google Cloud VM
155162- ** Process Manager:** PM2
156163- ** Web Server:** Nginx
@@ -160,12 +167,15 @@ The application is deployed using:
160167## 🧪 Testing
161168
162169### Crash Recovery Test
170+
163171The application includes PM2 auto-recovery. Test with:
172+
164173``` bash
165174curl https://api.testwtwr.jumpingcrab.com/crash-test
166175```
167176
168177### Development Testing
178+
169179``` bash
170180# Test user credentials
171181Email: joshtarget@example.com
@@ -175,6 +185,7 @@ Password: mypassword123
175185## 🛠️ Troubleshooting
176186
177187### MongoDB Issues
188+
178189``` bash
179190# Restart MongoDB
180191brew services restart mongodb-community
@@ -184,6 +195,7 @@ brew services list | grep mongodb
184195```
185196
186197### PM2 Issues
198+
187199``` bash
188200# Restart application
189201pm2 restart app --update-env
@@ -208,4 +220,4 @@ Currently on Sprint 15 - Full deployment with authentication and security featur
208220---
209221
210222** Author:** Joshua Zimmerman
211- ** License:** ISC
223+ ** License:** ISC
0 commit comments