A production-ready task manager application with user authentication, built with React and Node.js.
- 🔐 User authentication (Login/Register)
- 👑 Admin functionality (first user becomes admin)
- ⚙️ Database-backed settings management
- ✅ Create, read, update, and delete tasks
- 🎯 Task priorities (Low, Medium, High)
- 📊 Task status tracking (Pending, In Progress, Completed)
- 🔍 Filter tasks by status
- 💾 SQLite database for data persistence
- 🐳 Docker support with docker-compose
- 🎨 Beautiful and responsive UI
- 🏥 Health check endpoint
Frontend:
- React 18
- Vite
- Axios
- Modern CSS
Backend:
- Node.js
- Express
- SQLite (better-sqlite3)
- JWT for authentication
- bcryptjs for password hashing
The easiest way to run this application is using Docker. The app will be fully operational in under 2 minutes.
- Docker and Docker Compose installed
- Clone the repository
- Navigate to the project directory
- Run the application:
docker-compose up -dThat's it! The application will be available at http://localhost:8080
The first user to register will automatically become the admin.
# Check if the container is running
docker-compose ps
# Check application health
curl http://localhost:8080/health
# View logs
docker-compose logs -fdocker-compose downAll data (users, tasks, settings) is persisted in a Docker volume and will survive container restarts.
To completely remove all data:
docker-compose down -vIf you want to run the application in development mode:
- Node.js (v16 or higher)
- npm
- Install all dependencies:
npm run install-allThis will install dependencies for the root, backend, and frontend.
- Start both backend and frontend servers:
npm run devThis will start:
- Backend server on
http://localhost:5000 - Frontend server on
http://localhost:3000
If you prefer to run the servers separately:
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run dev- Open your browser and go to
http://localhost:8080(Docker) orhttp://localhost:3000(Dev) - Create a new account by clicking "Sign Up" (first user becomes admin)
- Log in with your credentials
- Start managing your tasks!
- Admin users can access Settings page to manage system configuration
The first user to register automatically becomes the admin. Admin users can:
- Access the Settings page via the "Settings" button in the header
- View and manage all system settings
- Add, update, and delete configuration values
- Control features like registration allowance, session timeout, etc.
All system configuration is stored in the database, not in environment variables (except for database connection and JWT secret).
POST /api/auth/register- Register a new userPOST /api/auth/login- Login user
GET /api/tasks- Get all tasks for the logged-in userGET /api/tasks/:id- Get a specific taskPOST /api/tasks- Create a new taskPUT /api/tasks/:id- Update a taskDELETE /api/tasks/:id- Delete a task
testapp2/
├── backend/
│ ├── middleware/
│ │ └── auth.js
│ ├── routes/
│ │ ├── auth.js
│ │ └── tasks.js
│ ├── database.js
│ ├── server.js
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Login.jsx
│ │ │ └── TaskManager.jsx
│ │ ├── App.jsx
│ │ ├── main.jsx
│ │ └── index.css
│ ├── index.html
│ └── package.json
└── package.json
The application requires the following environment variables (already configured in docker-compose.yml):
PORT- Port to run the application on (default: 8080)DATABASE_URL- SQLite database path (default: sqlite:///app/data/tasks.db)JWT_SECRET- Secret key for JWT token generation (change in production!)NODE_ENV- Environment mode (development/production)
The application exposes a health check endpoint at /health that returns:
{"status": "healthy"}This is used by Docker and orchestration systems to monitor application health.
- Passwords are hashed using bcryptjs
- JWT tokens are used for authentication
- Protected routes require valid JWT token
- First user automatically becomes admin
- Admin can manage system settings through the database-backed Settings page
- Important: Change the JWT_SECRET in production!
The project includes a GitHub Actions workflow for deployment to Google Kubernetes Engine (GKE). See .github/workflows/deploy-to-gke.yaml for configuration.
MIT