A mobile social networking application built with React Native and Expo, allowing students to share posts with images and captions, connect with peers, and manage their profiles.
- User Authentication: Secure registration and login with JWT tokens
- Username System: Unique usernames for user identification
- Social Feed: View posts from all students in chronological order
- Create Posts: Share images with captions using camera or photo library
- Profile Management: View and edit student profiles
- Event Feed: Browse upcoming events with capacity tracking
- My Tickets: Track event tickets
- Event Capacity: Organisers can set ticket limits; students see remaining spots and "fully booked" status
- Real-time Updates: Posts automatically sync with the database
- Follow System: Follow/unfollow students and organisations, view follower/following counts
- In-App Notifications: Notification center for likes, comments, ticket confirmations, and new events from followed organisations
- Notification Settings: Toggle notifications on/off with persistent settings
- React Native with Expo (~54.0)
- Expo Router for file-based navigation
- TypeScript for type safety
- expo-image-picker for media selection
- expo-secure-store for secure token storage
- Context API for state management
- Node.js with Express.js
- TypeScript
- Prisma ORM for database management
- PostgreSQL database (Neon DB)
- JWT for authentication
- bcryptjs for password hashing
comp2003-2025-2026-team-21/
βββ docs/ # Documentation and design files
β βββ design/ # Design documents
β βββ trello/ # Trello board snapshots
βββ scripts/ # Utility scripts
β βββ init-env.sh # Environment initialization
βββ SourceCode/
βββ backend/ # Node.js/Express backend
β βββ prisma/ # Database schema and migrations
β β βββ schema.prisma # Database models
β β βββ migrations/ # Migration history
β βββ src/
β βββ controllers/ # Business logic
β βββ middleware/ # Auth & role middleware
β βββ routes/ # API routes
β βββ types/ # TypeScript definitions
β βββ utils/ # Utilities (Prisma client)
β βββ server.ts # Express server entry point
βββ frontend/ # React Native/Expo app
βββ app/ # Expo Router pages
β βββ components/ # Reusable components
β βββ contexts/ # Context providers
β βββ createPost.tsx # Post creation page
β βββ socialStudent.tsx # Social feed
β βββ profileStudent.tsx # Profile view
β βββ ...
βββ assets/ # Images and static files
βββ lib/ # API helpers
βββ api.ts # API configuration
βββ apiBase.ts # Base URL handler
βββ postsApi.ts # Posts API functions
- Node.js (v18 or higher)
- npm or yarn
- Expo CLI
- PostgreSQL database (or Neon DB account)
-
Clone the repository
git clone <repository-url> cd comp2003-2025-2026-team-21
-
Backend Setup
cd SourceCode/backend npm install -
Configure Environment Variables
Create a
.envfile in the backend directory:DATABASE_URL="your-postgres-connection-string" JWT_SECRET="your-secret-key" PORT=3001
-
Run Database Migrations
npx prisma migrate dev npx prisma generate
-
Start Backend Server
npm run dev
Server will run on
http://localhost:3001 -
Frontend Setup
cd ../frontend npm install -
Start Expo App
npx expo start --tunnel
Use the Expo Go app on your phone to scan the QR code, or:
- Press
afor Android emulator - Press
ifor iOS simulator - Press
wfor web
- Press
-
Make 3001 Port Public if Need Be
-Right Click on Port -Port Visability -Select Public
id: UUID (primary key)email: String (unique)username: String (unique)name: Stringpassword: String (hashed)role: Enum (STUDENT, SOCIETY_ORGANIZER)- Posts relationship (one-to-many)
id: UUID (primary key)title: Stringdescription: Stringdate: DateTimelocation: Stringprice: Decimalcategory: Stringcapacity: Int? (optional, null = unlimited tickets)eventImageUrl: String?organiserId: String (foreign key to Organisation)- Tickets relationship (one-to-many)
id: UUID (primary key)caption: Stringimage: Bytes (binary image data)imageMimeType: StringauthorId: String (foreign key to User)createdAt: DateTime- User relationship (many-to-one)
id: UUID (primary key)followerId: String (who is following)followerType: String (STUDENT or ORGANISATION)followingId: String (who is being followed)followingType: String (STUDENT or ORGANISATION)createdAt: DateTime
id: UUID (primary key)type: String (POST_LIKE, POST_COMMENT, TICKET_CONFIRMED, NEW_EVENT)title: Stringbody: Stringdata: JSON (optional payload with postId, eventId, etc.)read: BooleanuserId: StringuserRole: StringcreatedAt: DateTime
id: UUID (primary key)token: String (unique, Expo push token)userId: StringuserRole: StringcreatedAt: DateTime
The app uses JWT-based authentication:
- Registration: Users create an account with email, username, name, and password
- Login: Returns a JWT token stored securely using expo-secure-store
- Protected Routes: Backend routes use
authMiddlewareto verify tokens - Token Storage: Tokens persisted securely on the device
POST /auth/register- Create new user accountPOST /auth/login- Login and receive JWT tokenGET /auth/me- Get current user information
POST /posts- Create a new post (requires auth)GET /posts- Get all posts with author informationGET /posts/user/:userId- Get posts by specific userDELETE /posts/:postId- Delete a post (requires auth)
POST /follow/:targetId- Follow a user or organisationDELETE /follow/:targetId- Unfollow a user or organisationGET /follow/check/:targetId- Check if current user is following targetGET /follow/counts/:userId- Get follower and following countsGET /follow/followers/:userId- Get list of followersGET /follow/following/:userId- Get list of following
POST /notifications/register-token- Register push notification tokenDELETE /notifications/register-token- Unregister push tokenGET /notifications- Get user's notificationsPATCH /notifications/:id/read- Mark notification as readPATCH /notifications/read-all- Mark all notifications as readDELETE /notifications/:id- Delete a notificationGET /notifications/settings- Get notification preferencesPUT /notifications/settings- Update notification preferences
View and edit database records:
cd SourceCode/backend
npx prisma studioCheck migration status:
npx prisma migrate statusReset database (development only):
npx prisma migrate resetexpo- React Native frameworkexpo-router- File-based routingexpo-image-picker- Media selectionexpo-secure-store- Secure storageexpo-file-system- File operations
express- Web framework@prisma/client- Database ORMjsonwebtoken- JWT authenticationbcryptjs- Password hashingcors- Cross-origin requests
Backend not connecting:
- Verify DATABASE_URL in
.env - Check if PostgreSQL is running
- Ensure migrations are up to date:
npx prisma migrate dev
Frontend can't reach backend:
- Use
--tunnelflag with expo start for remote testing - Check API_URL configuration in
lib/apiBase.ts - Verify backend is running on port 3001
Image upload failing:
- Check backend JSON limit (set to 10mb in server.ts)
- Verify image is being converted to base64 properly
- Check file permissions for camera/library access
MIT
Team 21 - COMP2003 2025-2026
For more details, see documentation in the docs/ directory.