<<<<<<< HEAD
Platform kolaborasi untuk mengelola proyek dan pembayaran dengan fitur chat real-time. Memungkinkan freelancer dan klien untuk berkolaborasi dalam proyek dengan sistem escrow dan pembayaran yang aman.
StairLifeWeb/ βββ backend/ - NestJS REST API Server βββ frontend/ - Vite + Vanilla JavaScript Frontend βββ README.md - Project Documentation
- Framework: NestJS
- Database: Supabase (PostgreSQL)
- ORM: Prisma
- Authentication: JWT + Passport.js
- Real-time: WebSocket (Socket.io)
β User Authentication (Register/Login) β Project Management (CRUD) β Application Management β Contract Management β Payment & Escrow System β Real-time Chat with WebSocket β Admin Dashboard β Email Verification
cd backend
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env dengan Supabase credentials
# Run migrations
npx prisma migrate dev
# Start development server
npm run start:devnpm run start:dev # Development mode
npm run build # Build
npm run start:prod # ProductionBase URL: http://localhost:3000/api/v1
POST /auth/register- Register userPOST /auth/login- Login user
GET /users/me- Get profilePATCH /users/me- Update profilePOST /users/me/verification- Email verification
GET /projects- List all projectsGET /projects/my- My projectsPOST /projects- Create projectPATCH /projects/:id- Update projectDELETE /projects/:id- Delete project
POST /applications- Apply to projectGET /applications/my- My applicationsPATCH /applications/:id/status- Update status
POST /contracts- Create contractGET /contracts/my- My contractsPATCH /contracts/:id/approve- Approve contract
POST /payments/escrow- Create escrowPATCH /payments/escrow/:id/release- Release payment
GET /chat/rooms- List chat roomsGET /chat/:contractId/messages- Get messagesPOST /chat/:contractId/messages- Send messagePOST /chat/direct- Send direct message- WebSocket:
ws://localhost:3000/chat
GET /admin/stats- StatisticsGET /admin/users- List usersPATCH /admin/users/:id/suspend- Suspend userGET /admin/verifications- Verification requestsGET /admin/disputes- Disputes
- Build Tool: Vite
- Language: Vanilla JavaScript
- Styling: CSS
- HTTP Client: Fetch API
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run buildnpm run dev # Development mode
npm run build # Build
npm run preview # Preview buildfrontend/ βββ assets/ - Images, fonts, etc βββ styles/ - CSS files βββ scripts/ - JavaScript files βββ index.html - Main HTML βββ vite.config.js - Vite configuration
- users - User profiles & authentication
- projects - Project listings
- applications - Project applications from freelancers
- contracts - Contracts between client & freelancer
- payments - Payment records & escrow
- chat_rooms - Chat room data
- messages - Chat messages
Database DATABASE_URL=postgresql://user:password@host/dbname JWT JWT_SECRET=your_secret_key JWT_EXPIRATION=3600 Supabase SUPABASE_URL=https://your-project.supabase.co SUPABASE_ANON_KEY=your_anon_key Server PORT=3000 NODE_ENV=development
cd backend
npm run start:devServer akan berjalan di: http://localhost:3000/api/v1
cd frontend
npm run devFrontend akan berjalan di: http://localhost:5173
Gunakan Postman atau Thunder Client:
- Set Base URL:
http://localhost:3000/api/v1 - Set Authorization header dengan JWT token
-
Register User POST http://localhost:3000/api/v1/auth/register Content-Type: application/json { "email": "user@example.com", "password": "password123", "firstName": "John", "lastName": "Doe", "role": "freelancer" }
-
Login POST http://localhost:3000/api/v1/auth/login Content-Type: application/json { "email": "user@example.com", "password": "password123" }
-
Get Profile (Butuh JWT Token) GET http://localhost:3000/api/v1/users/me Authorization: Bearer {token_dari_login}
const socket = io('http://localhost:3000/chat', {
auth: {
token: 'your_jwt_token'
}
});
// Join room
socket.emit('join_room', { contractId: 'xxx' });
// Send message
socket.emit('send_message', {
contractId: 'xxx',
message: 'Hello!'
});
// Listen for messages
socket.on('receive_message', (data) => {
console.log(data);
});- Port 3000 already in use:
npx lsof -i :3000 # Check what's using port
kill -9 <PID> # Kill process- Database connection error:
- Check DATABASE_URL di .env
- Pastikan Supabase project aktif
- Port 5173 already in use:
npm run dev -- --port 3001| Layer | Technology |
|---|---|
| Frontend | Vite + Vanilla JavaScript |
| Backend | NestJS + TypeScript |
| Database | PostgreSQL (Supabase) |
| ORM | Prisma |
| Real-time | WebSocket (Socket.io) |
| Auth | JWT + Passport.js |
- TypeScript v5.x
- Node.js v16+
- Prisma untuk database management
- Escrow system untuk secure payments
- Austin Yang - Full Stack Developer
- Email: austin.yang@binus.ac.id
MIT License - Feel free to use this project!
- GitHub Repository: https://github.com/TinnTunn/StairLifeWeb
- Supabase Console: https://supabase.com
- NestJS Docs: https://docs.nestjs.com
- Vite Docs: https://vitejs.dev
StairsLife - Step Up Your Life
d1915ee255dd3be928112fa722ef6c3a24fe94a8