A platform for course and professor reviews with institutional authentication.
Whispr is a comprehensive review platform that allows users to review and rate courses and professors. It features institutional email verification, ensuring that reviews come from actual students. The platform includes social features such as following other users, upvoting/downvoting reviews, and replying to reviews.
The project is built with a modern three-tier architecture:
- Frontend: Next.js with TypeScript for a responsive, SSR-capable UI
- Backend: FastAPI Python API with PostgreSQL database
- Database: PostgreSQL for reliable, relational data storage
All components are containerized using Docker, making development and deployment consistent across environments.
whispr/
├── backend/ # FastAPI application
│ ├── app/
│ │ ├── api/ # API endpoints
│ │ ├── auth/ # Authentication utilities
│ │ ├── core/ # Core settings and config
│ │ ├── db/ # Database connection and utilities
│ │ ├── models/ # SQLAlchemy ORM models
│ │ ├── schemas/ # Pydantic schemas for API
│ │ └── utils/ # Utility functions
│ ├── main.py # Application entry point
│ ├── Dockerfile # Backend container definition
│ └── requirements.txt # Python dependencies
├── frontend/ # Next.js application (to be implemented)
│ └── Dockerfile # Frontend container definition
├── nginx/ # Nginx configuration
│ └── conf.d/ # Server configuration
├── init-scripts/ # Database initialization scripts
│ └── 01-init.sql # Schema creation script
├── docker-compose.yml # Docker composition file
├── .env.example # Environment variable template
└── README.md # This file
- Docker and Docker Compose
- Git
- Clone the repository:
git clone https://github.com/yourusername/whispr.git
cd whispr
- Create a
.env
file from the template:
cp .env.example .env
- Start the development environment:
docker-compose up -d
- Access the applications:
- Frontend: http://localhost
- Backend API: http://localhost/api
- API Documentation: http://localhost/api/docs
The backend is a FastAPI application with hot reloading enabled. Changes to Python files will automatically reload the server.
- Make changes to the backend code
- The changes will be automatically detected and the server will reload
- Access the API documentation at http://localhost/api/docs to test your endpoints
The frontend is a Next.js application with TypeScript. To start implementing the frontend:
- Navigate to the frontend directory:
cd frontend
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Make changes to the frontend code
- The changes will be automatically detected and the UI will update
- ✅ Database models and schema
- ✅ Authentication system with JWT tokens and cookies
- ✅ Docker containerization
- ✅ Nginx reverse proxy configuration
- ⬜ User management endpoints
- ⬜ Course and professor endpoints
- ⬜ Review and reply endpoints
- ⬜ Search functionality
- ⬜ Frontend implementation
When the backend is running, the full API documentation is available at http://localhost/api/docs.
The following endpoints are currently implemented:
POST /api/auth/register
: Register a new userPOST /api/auth/login
: Login and get access tokenPOST /api/auth/logout
: Logout and clear authentication
Variable | Description | Default Value |
---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql://postgres:postgres@db:5432/whispr |
DATABASE_NAME | Database name | whispr |
JWT_SECRET | Secret key for JWT tokens | changeme_in_production |
JWT_ALGORITHM | Algorithm for JWT tokens | HS256 |
JWT_EXPIRATION | Token expiration in seconds | 86400 |
CORS_ORIGINS | Allowed origins for CORS | http://localhost:3000,http://localhost |
FRONTEND_URL | URL of the frontend | http://localhost:3000 |
COOKIE_DOMAIN | Domain for cookies | localhost |
COOKIE_SECURE | Use secure cookies | False |
COOKIE_SAMESITE | SameSite cookie policy | lax |
ALLOWED_EMAIL_DOMAINS | Domains allowed for email verification | example.edu,students.example.edu |
The database schema is defined in init-scripts/01-init.sql
and includes the following tables:
users
: User accounts and profilesprofessors
: Professor informationcourses
: Course informationcourse_instructors
: Links professors to courses they teachreviews
: Reviews of courses and professorsreplies
: Replies to reviewsvotes
: Upvotes and downvotes on reviews and repliesuser_followers
: Tracks which users follow other usersverified_emails
: Tracks verified email addressesnotifications
: User notifications
- Create a feature branch:
git checkout -b feature/my-feature
- Make your changes
- Run tests (once implemented)
- Submit a pull request
For production deployment, make sure to:
-
Set secure values in
.env
:- Generate a strong
JWT_SECRET
- Set
COOKIE_SECURE=True
- Update
ALLOWED_EMAIL_DOMAINS
with your institution's domains
- Generate a strong
-
Configure HTTPS in Nginx by providing SSL certificates in
nginx/certs/
-
Build and start the containers:
docker-compose up -d --build