A full-stack task management application built with Next.js (frontend) and Express + Prisma (backend).
- User Authentication: JWT-based registration and login
- Task Management: Create, read, update, and delete tasks
- Task Status Tracking: Tasks can be in PENDING, IN_PROGRESS, or COMPLETED states
- Responsive UI: Built with Tailwind CSS for a modern look
- Secure Backend: Express server with authentication middleware
- Database: PostgreSQL with Prisma ORM
task-management-system/
โโโ backend/ # Express + Prisma API
โ โโโ src/
โ โ โโโ controllers/ # Route handlers
โ โ โโโ middleware/ # Auth & error handling
โ โ โโโ routes/ # API routes
โ โ โโโ server.ts # Express app setup
โ โโโ prisma/
โ โ โโโ schema.prisma # Database schema
โ โ โโโ migrations/ # Database migrations
โ โโโ package.json
โ
โโโ frontend/ # Next.js React app
โโโ app/ # Next.js app directory
โโโ components/ # React components
โโโ contexts/ # React contexts
โโโ lib/ # Utility functions
โโโ package.json
- Node.js with Express.js
- TypeScript for type safety
- Prisma as ORM
- PostgreSQL for database
- JWT for authentication
- bcrypt for password hashing
- Next.js 14 with App Router
- React 18 for UI components
- TypeScript for type safety
- Tailwind CSS for styling
- Axios for API calls
- Node.js 18+ and npm/yarn
- PostgreSQL database
- Git
-
Navigate to backend directory:
cd backend -
Install dependencies:
npm install
-
Create
.envfile with your database credentials:DATABASE_URL="postgresql://user:password@localhost:5432/taskdb" DIRECT_URL="postgresql://user:password@localhost:5432/taskdb" JWT_ACCESS_SECRET="your-secret-key" JWT_REFRESH_SECRET="your-refresh-secret-key" PORT=5000 NODE_ENV=development
-
Run database migrations:
npm run prisma:migrate
-
Start the development server:
npm run dev
Backend will run on http://localhost:5000
-
Navigate to frontend directory:
cd frontend -
Install dependencies:
npm install
-
Create
.env.localfile:NEXT_PUBLIC_API_URL=http://localhost:5000
-
Start the development server:
npm run dev
Frontend will run on http://localhost:3000
POST /auth/register- Register new userPOST /auth/login- Login userPOST /auth/refresh- Refresh access tokenPOST /auth/logout- Logout user
GET /tasks- Get all user tasksPOST /tasks- Create new taskPUT /tasks/:id- Update taskDELETE /tasks/:id- Delete task
- JWT tokens are stored in secure HTTP-only cookies
- Passwords are hashed with bcrypt
- CORS is configured for frontend origin
- Environment variables must be kept secret
npm run dev # Start development server with hot reload
npm run build # Build TypeScript to JavaScript
npm start # Start production server
npm run prisma:generate # Generate Prisma client
npm run prisma:migrate # Run database migrations
npm run prisma:studio # Open Prisma Studio UInpm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run lint # Run ESLint- Verify PostgreSQL is running
- Check DATABASE_URL in
.env - Ensure credentials are correct
- Verify FRONTEND_URL is set correctly in backend
- Check that frontend URL matches CORS origin in
server.ts
- Run
npm installin both backend and frontend directories - Clear node_modules and reinstall if issues persist
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit pull requests.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a pull request
For issues and questions, please open an issue in the GitHub repository.