A full-stack social network application for universities, built with Encore.ts backend and React frontend.
- Authentication: University email-based registration and login
- Posts & Feed: Create, view, like, and comment on posts with hashtags and location tags
- Study Groups: Create and join study groups for courses
- Events: Create and view campus events
- Search: Search for users, posts, and campus locations
- Admin Panel: Basic content moderation and university settings
- Campus Integration: University-scoped content and locations
- Backend: Encore.ts with PostgreSQL
- Frontend: React 18, TypeScript, Tailwind CSS, React Query
- Database: PostgreSQL with migrations
- UI: shadcn/ui components
- Encore CLI
- Node.js 18+
- PostgreSQL (managed by Encore)
- Clone the repository:
git clone <repository-url>
cd campus-gram- Install backend dependencies:
cd backend
npm install- Install frontend dependencies:
cd frontend
npm install- Start the Encore development server:
encore run- In a new terminal, start the frontend:
cd frontend
npm run dev- Important: On first run, visit
http://localhost:5173and click "Seed Database" on the login page to populate with demo data.
After seeding the database, you can login with:
- Stanford Admin: [email protected] / password123
- Berkeley Admin: [email protected] / password123
- Student Example: [email protected] / password123
The application uses the following main entities:
- Universities: Multi-tenant university instances
- Users: Students and administrators with university affiliation
- Posts: User-generated content with images, hashtags, and locations
- Comments: Threaded comments on posts
- Study Groups: Course-based study groups with membership
- Events: Campus events with date/time and location
- Campus Locations: Predefined campus buildings and locations
POST /auth/register- Register new userPOST /auth/login- Login user
GET /posts- List posts (paginated)POST /posts- Create new postPOST /posts/:id/like- Toggle like on post
GET /comments/:postId- List comments for postPOST /comments- Create new comment
GET /study-groups- List study groupsPOST /study-groups- Create study groupPOST /study-groups/:id/join- Join study group
GET /events- List eventsPOST /events- Create event
GET /search- Search users, posts, and locations
POST /seed- Seed database with demo data
All data is scoped by university domain. Users can only see content from their own university.
- Rich text posts with hashtag support
- Image upload support (placeholder implementation)
- Location tagging with campus buildings
- Threaded comments with replies
- Like/unlike posts
- Follow hashtags
- Study group membership
- Event creation and discovery
- Content moderation
- User management
- University branding customization
- All API endpoints are automatically type-safe between frontend and backend
- Database migrations are handled automatically by Encore
- The frontend uses React Query for efficient data fetching and caching
- Authentication is handled with simple tokens (upgrade to JWT for production)
This application is designed to be easily deployable with Encore's built-in deployment system:
encore deploy --env productionFor production use, consider:
- Implementing proper JWT authentication
- Adding rate limiting
- Setting up proper image storage (S3/CloudFlare R2)
- Configuring email verification
- Adding push notifications
- Implementing real-time features with WebSockets
MIT License - see LICENSE file for details.