A comprehensive social media platform designed specifically for university graduates and guests to connect, share memories, and maintain relationships post-graduation.
- Dual Registration System: Separate registration flows for graduates and guests
- Role-Based Access Control: Different permissions for graduates, guests, and admins
- Profile Management: Comprehensive profile system with privacy controls
- Social Links Integration: Support for multiple social media platforms
- Profile Interactions: Like, save, and comment on profiles
- Post System: Create, share, and interact with posts
- Last Words: Special graduation messages from graduates
- Real-time Notifications: Live updates for all interactions
- User Tagging: Predefined tags for user characteristics
- Advanced Search: Full-text search with multiple filters
- Academic Filtering: Filter by campus, college, and department
- Personalized Feed: AI-driven content personalization
- Suggested Users: Smart user recommendations
- Hierarchical Organization: Campus โ College โ Department structure
- Category Pages: Dedicated pages for each academic unit
- Statistics: Comprehensive analytics for each level
- Granular Privacy Controls: Control who can see profiles and contact info
- Content Moderation: Report system for inappropriate content
- Secure Authentication: JWT-based authentication with refresh tokens
- Rate Limiting: Protection against abuse
- Real-time Counters: Live view, like, and comment counts
- User Analytics: Detailed interaction statistics
- Popular Content: Trending posts and users
- Admin Dashboard: Comprehensive system analytics
- Runtime: Node.js with TypeScript
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Real-time: Socket.IO for live features
- File Storage: Firebase Storage
- Authentication: JWT tokens
- Validation: Joi schemas
- Logging: Winston logger
- Testing: Jest (configured)
src/
โโโ config/ # Database and Firebase configuration
โโโ controllers/ # Request handlers
โโโ middleware/ # Authentication, validation, error handling
โโโ models/ # Mongoose schemas and models
โโโ routes/ # API route definitions
โโโ services/ # Business logic and external services
โโโ types/ # TypeScript type definitions
โโโ utils/ # Utility functions and helpers
โโโ server.ts # Main application entry point
scripts/ # Database seeding and utilities
postman/ # API testing collections
docs/ # Additional documentation
- Node.js (v18 or higher)
- MongoDB (local or cloud)
- Firebase project (for file storage)
-
Clone the repository
git clone <repository-url> cd gradbook-backend
-
Install dependencies
npm install
-
Environment Setup
cp .env.example .env
Configure your
.envfile with:# Database MONGODB_URI=mongodb://localhost:27017/gradbook # JWT JWT_SECRET=your-super-secret-jwt-key JWT_EXPIRES_IN=7d # Firebase Configuration FIREBASE_PROJECT_ID=your-project-id FIREBASE_PRIVATE_KEY=your-private-key FIREBASE_CLIENT_EMAIL=your-client-email FIREBASE_STORAGE_BUCKET=your-storage-bucket # Server PORT=3000 NODE_ENV=development FRONTEND_URL=http://localhost:3000
-
Database Setup
# Seed the database with sample data npm run seed -
Start Development Server
npm run dev
The API will be available at http://localhost:3000
POST /api/v1/auth/register # User registration
POST /api/v1/auth/login # User login
GET /api/v1/auth/profile # Get current user profile
PUT /api/v1/auth/profile # Update user profile
POST /api/v1/auth/refresh # Refresh JWT token
GET /api/v1/users/:id # Get user profile
POST /api/v1/users/:id/like # Like/unlike user profile
POST /api/v1/users/:id/save # Save/unsave user profile
POST /api/v1/users/:id/comment # Comment on user profile
POST /api/v1/users/:id/tag # Tag user with predefined tags
GET /api/v1/users/me/liked # Get liked profiles
GET /api/v1/users/me/saved # Get saved profiles
GET /api/v1/posts # Get personalized feed
POST /api/v1/posts # Create new post (graduates only)
GET /api/v1/posts/:id # Get specific post
POST /api/v1/posts/:id/like # Like/unlike post
POST /api/v1/posts/:id/comment # Comment on post
POST /api/v1/posts/:id/share # Share post
GET /api/v1/posts/lastwords # Get last words posts
GET /api/v1/search/users # Search users with filters
GET /api/v1/search/posts # Search posts
GET /api/v1/search/suggested # Get suggested users
GET /api/v1/search/filters # Get available filters
GET /api/v1/categories/campuses # Get all campuses
GET /api/v1/categories/campuses/:id/colleges # Get campus colleges
GET /api/v1/categories/colleges/:id/departments # Get college departments
GET /api/v1/categories/structure # Get complete academic structure
- Import the collection from
postman/GradBook_API.postman_collection.json - Set up environment variables for your local setup
- Start with authentication endpoints to get JWT tokens
Admin: admin@gradbook.com / password123
Graduate: john.smith0@university.edu / password123
Guest: guest0@example.com / password123
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coveragenpm run dev # Start development server with hot reload
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run lint:fix # Fix ESLint issues
npm run seed # Seed database with sample data
npm run clean # Clean build directory- TypeScript: Strict mode enabled
- ESLint: Configured with TypeScript rules
- Prettier: Code formatting (configure as needed)
- Path Aliases: Use
@/for src directory imports
- Complete profile information
- Privacy settings
- Social links
- Academic affiliations
- Interaction tracking
- Question-based content
- Like/comment/share system
- View tracking
- Type classification (lastword/question)
- Campus โ College โ Department hierarchy
- Search point tracking
- User statistics
NODE_ENV=production
MONGODB_URI=mongodb+srv://...
JWT_SECRET=strong-production-secret
FIREBASE_PROJECT_ID=production-project
# ... other production configs# Dockerfile example
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Winston Logger: Structured logging with multiple transports
- Error Tracking: Comprehensive error handling and logging
- Performance Monitoring: Request timing and database query optimization
- Health Checks:
/healthendpoint for monitoring
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript best practices
- Write comprehensive tests
- Update documentation
- Follow conventional commit messages
- Ensure all tests pass
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Check the documentation in
/docs - Review the API collection in Postman
- Email notifications
- OAuth integration (Google, Facebook)
- Advanced analytics dashboard
- Mobile app API optimizations
- Caching layer (Redis)
- GraphQL API option
- Microservices architecture
- Advanced search with Elasticsearch
Built with โค๏ธ for university communities