A simple Task Manager application built with Next.js, Apollo GraphQL, KnexJS, and PostgreSQL.
- Docker and Docker Compose installed on your machine
- NodeJS
- Npm (or other NodeJS package manager)
- Clone this repository
- Run the following command:
docker compose up - Create the database tables
npm run migrate- Seed your database with initial data
npm run seed- Start backend service
> cd backend
> npm run dev- Start frontend service
> cd frontend
> npm run dev- Open your browser:
- Frontend: http://localhost:3000
- GraphQL Playground: http://localhost:4000/graphql
├── backend/
│ ├── server.js # Express + Apollo Server
│ ├── db.js # Database connection
│ ├── schema.js # GraphQL schema
│ ├── resolvers.js # GraphQL resolvers
│ ├── knexfile.js # Knex configuration
│ ├── migrations/ # Database migrations
│ └── seeds/ # Seed data
├── frontend/
│ ├── pages/
│ │ └── index.tsx # Main page
│ ├── next.config.js # Next.js configuration
│ └── tsconfig.json # TypeScript configuration
└── docker-compose.yml
The application has several bugs in both the backend and frontend. Your task is to:
- Identify the bugs
- Fix them
- Explain why they were bugs
After fixing the bugs, make at least two improvements from the following:
- Remove inefficient queries (N+1 problems)
- Add validation and error handling
- Fix database insert return values
- Proper async/await handling
- Frontend re-render optimization
- Optimistic UI updates or proper refetching
As you work, explain your thought process:
- What are you prioritizing and why?
- What trade-offs are you making?
- How would you approach this differently in a production environment?
- Working code with bugs fixed
- At least 2 meaningful improvements
- Clear explanation of changes made
- Frontend: Next.js, React, TypeScript
- Backend: Node.js, Express, Apollo Server
- Database: PostgreSQL with KnexJS
- Infrastructure: Docker, Docker Compose
Good luck!