-
Setup project with TypeScript and Node.js
- Initialized
tsconfig.json - Installed essential dev dependencies (e.g., ts-node, typescript, nodemon)
- Initialized
-
Express Server Setup
- Configured Express app in
server.ts - Setup CORS and JSON parsing middleware
- Configured environment variables with
dotenv
- Configured Express app in
-
Database Setup
- Chose Neon as PostgreSQL provider
- Used Drizzle ORM for schema management and migrations
- Defined models:
users,challenges
-
Authentication
- Setup routes:
/api/auth/signup,/api/auth/login - Implemented JWT-based token system
- Hashed passwords using
bcrypt - Middleware to protect routes by verifying JWT
- Setup routes:
-
Challenges API
- Routes under
/api/challenges - Endpoints:
POST /create: Create challenge (protected)GET /: List all challenges with pagination supportGET /mine: Fetch challenges user has joinedPOST /join/:id: Join challenge by IDDELETE /leave/:id: Leave challenge by ID
- Routes under
-
Image Upload
- Integrated Cloudinary
- Backend expects base64 string from frontend
- Stores returned Cloudinary URL in
imagecolumn
-
Zod Input Validation
- Defined validators for all request payloads in
challengeValidator.ts - Used
safeParsefor error-safe validation in controllers - Errors returned in consistent format to frontend
- Defined validators for all request payloads in
-
Cron Jobs (Optional)
- Setup basic cron job (e.g., for scheduled challenge cleanup)
-
Security Measures
- JWT Auth middleware protects routes
- Zod ensures all inputs are validated
-
Initialized Expo project in
/mobilefolder- Set up folder structure using
expo-router
- Set up folder structure using
-
Navigation
- Used
expo-routerwith(auth)and(tabs)layouts - Tabs:
Home,Active, andCreate.
- Used
-
State Management
- Zustand store for:
authStorefor JWT and userchallengeStoreto manage challenge state across tabs (joined/left)
- Zustand store for:
-
Auth Flow
signup.tsxandlogin.tsxscreens under(auth)- Calls backend
/api/auth/*routes - Stores token in
AsyncStorage
-
Home Screen
- Lists all public challenges using FlatList
- Infinite scroll + pull-to-refresh
- Join/Leave actions with challengeStore updates
-
Active Screen
- Shows challenges user has joined
- Real-time sync using challengeStore
- Leave challenge updates both active and home tabs
-
Image Upload
- Images uploaded from mobile as base64
- Cloudinary used in backend to save and return image URL
-
UI Components
- Custom
ChallengeCardwith title, description, image, and join/leave buttons - Responsive styling and loading indicators
- Custom
-
Error Handling + UX
- Toast or alert for join/leave feedback
- Loading spinners on API calls
-
Validation Feedback
- Errors from Zod shown in form screens (e.g.
title is required)