How aliraza372/asessmenttask-nextjs works
Movies is a web application for signing in and managing a personal movie list, including poster uploads. The main workflow is login, browse a paginated list, create a movie with an uploaded image, and edit movie details. The sampled source shows the dashboard and create flows plus API persistence; edit and some authentication wiring are inferred only from the tree and are shown conservatively.
Main entry points: route.ts Movie collection API · dbConnect.ts Database connector · dashboard/page.tsx Movie dashboard · create/page.tsx Create movie
Components 17
Web experience
- Login page
app/login/page.tsx - Movie dashboard
app/dashboard/page.tsx - Create movie
app/dashboard/create/page.tsx - Edit movie
app/dashboard/edit/[id]/page.tsx - Movie card
components/MovieCard.tsx
Application API
- Movie collection API
app/api/movies/route.ts - Movie item API
app/api/movies/[id]/route.ts - Poster upload API
app/api/upload/route.ts
Identity
- Login action
lib.ts - User lookup
app/api/users/route.ts - Seed account
app/api/seed/route.ts
Persistence
- User model
backend/models/User.ts - Movie model
backend/models/Movie.ts - Database connector
backend/lib/dbConnect.ts
Other components
- Visitor
- MongoDB
- Poster files
public
Connections 22
- Visitor → Login page: opens
- Visitor → Movie dashboard: browses
- Visitor → Create movie: submits
- Visitor → Edit movie: edits
- Login page → Login action: authenticates
- Login action → User lookup: fetches user
- User lookup → Database connector: connects
- User lookup → User model: queries
- Seed account → Database connector: connects
- Seed account → User model: creates account
- Movie dashboard → Movie collection API: fetches page
- Movie dashboard → Movie card: renders
- Create movie → Poster upload API: uploads poster
- Create movie → Movie collection API: creates movie
- Edit movie → Movie item API: updates movie
- Movie collection API → Database connector: connects
- Movie collection API → Movie model: queries and saves
- Movie item API → Database connector: connects
- Movie item API → Movie model: reads and updates
- User model → MongoDB: persists
- Movie model → MongoDB: persists
- Poster upload API → Poster files: writes file