A full-stack movie tracking application built with React, NestJS, and PostgreSQL.
Current Version: 2.0.0-alpha (Monorepo Migration in Progress)
-
Secure Authentication
-
Email/Password authentication with OTP verification
-
Google OAuth 2.0 integration
-
JWT-based access tokens (in-memory)
-
HttpOnly cookies for refresh tokens
-
Password reset functionality
-
Movie Management
-
Search movies (powered by TMDB API)
-
Mark movies as watched or planned to watch
-
Rate and review movies
-
Personal movie lists
-
Social Features
-
Friend system (follow/unfollow)
-
Friend requests (accept/reject)
-
View friends' movie lists
-
User Profile
-
Customizable username, name, and bio
-
Email change with verification
-
Password change
-
Profile pictures (Google OAuth avatars)
- React 18 with TypeScript
- Vite
- Redux Toolkit & RTK Query
- React Router v6
- Tailwind CSS
- Lucide React (icons)
- NestJS
- Prisma ORM
- PostgreSQL
- JWT authentication
- Bcrypt for password hashing
- Nodemailer for emails
- Node.js 18+
- PostgreSQL 14+
- TMDB API key
- Google OAuth credentials (optional)
-
Clone the repository
git clone https://github.com/ashish757/trackd.git cd trackd -
Install dependencies
# Install backend dependencies cd server npm install # Install frontend dependencies cd client npm install
-
Configure environment variables
Create
.envfiles in bothserverandclientdirectories: -
(an .env.example files are provided for reference)
server/.env:
ENV=development PORT=3000 FRONTEND_URL=http://localhost:5173 DATABASE_URL="postgresql://user:password@localhost:5432/trackd?schema=public" JWT_ACCESS_SECRET=your_access_secret_here JWT_REFRESH_SECRET=your_refresh_secret_here JWT_OTP_SECRET=your_otp_secret_here # Email configuration (Gmail example) EMAIL_USER=your.email@gmail.com EMAIL_PASSWORD=your_app_specific_password EMAIL_SMTP_HOST=smtp.gmail.com SMTP_PORT=587 # TMDB API TMDB_API_KEY=your_tmdb_api_key TMDB_READ_ACCESS_TOKEN=your_tmdb_token # Google OAuth (optional - see docs/GOOGLE_OAUTH_SETUP.md) GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback
client/.env:
VITE_ENV=development VITE_API_BASE_URL=http://localhost:3000
-
Set up the database
cd server npx prisma migrate dev npx prisma generate -
Start the development servers
Terminal 1 - Backend:
cd server npm run run devTerminal 2 - Frontend:
cd client npm run dev -
Open your browser
Navigate to
http://localhost:5173
For detailed instructions on setting up Google OAuth authentication, see:
This includes:
- Google Cloud Console configuration
- Environment variable setup
- Testing the OAuth flow
- Troubleshooting common issues
trackd/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── pages/ # Page components
│ │ ├── redux/ # Redux store and slices
│ │ ├── utils/ # Utility functions
│ │ └── config/ # Configuration files
│ └── ...
├── server/ # NestJS backend
│ ├── src/
│ │ ├── modules/ # Feature modules
│ │ ├── common/ # Shared code (guards, filters, etc.)
│ │ ├── config/ # Configuration
│ │ └── utils/ # Utility functions
│ ├── prisma/ # Database schema and migrations
│ └── ...
└── docs/ # Documentation
The backend provides the following main endpoints:
POST /auth/login- Email/password loginPOST /auth/register- User registrationPOST /auth/send-otp- Send OTP for email verificationPOST /auth/verify-otp- Verify OTPPOST /auth/refresh-token- Refresh access tokenPOST /auth/logout- Logout userGET /auth/google- Initiate Google OAuthGET /auth/google/callback- Google OAuth callbackPOST /auth/forget-password- Request password resetPOST /auth/reset-password- Reset password with token
GET /user/profile- Get current user profileGET /user/:id- Get user by IDPOST /user/change/username- Change usernamePOST /user/change/name- Change display namePOST /user/change/bio- Change bioPOST /user/change/password- Change passwordPOST /auth/change/email/request- Request email changePOST /auth/change/email- Confirm email change
GET /movies/search- Search movies via TMDBGET /movies/trending- Get trending moviesPOST /movies/add- Add movie to database
POST /user-movies/entry- Add/update movie status (watched/planned)DELETE /user-movies/entry/:movieId- Remove movie from listGET /user-movies/entries- Get user's movie listPOST /user-movies/data- Add/update movie rating and reviewGET /user-movies/data/:movieId- Get movie rating/review
POST /friend/request- Send friend requestPOST /friend/accept/:requestId- Accept friend requestPOST /friend/reject/:requestId- Reject friend requestDELETE /friend/cancel/:requestId- Cancel sent friend requestDELETE /friend/unfriend/:friendId- Unfriend userGET /friend/requests- Get friend requestsGET /friend/status/:userId- Get friendship status with user
- ✅ JWT access tokens (15 min expiry, stored in memory)
- ✅ Refresh tokens (7 days expiry, HttpOnly cookies)
- ✅ Token rotation on refresh
- ✅ Maximum 5 concurrent sessions per user
- ✅ CSRF protection with SameSite cookies
- ✅ Password hashing with bcrypt
- ✅ OTP-based email verification
- ✅ Rate limiting on sensitive endpoints
- ✅ Input validation with DTOs
- ✅ Global exception handling
Build and run with Docker Compose:
docker-compose -f docker-compose.dev.yml up --buildFor questions or support, please open an issue on GitHub.