https://github.com/murtaza99dev/task-tracker
A secure and scalable Task Tracker API built with TypeScript, Express, PostgreSQL, and Drizzle ORM.
https://github.com/murtaza99dev/task-tracker
drizzle-orm jwt postgresql reactjs tailwindcss tasktracker typescript zod
Last synced: 17 days ago
JSON representation
A secure and scalable Task Tracker API built with TypeScript, Express, PostgreSQL, and Drizzle ORM.
- Host: GitHub
- URL: https://github.com/murtaza99dev/task-tracker
- Owner: Murtaza99dev
- Created: 2025-06-26T21:01:13.000Z (10 months ago)
- Default Branch: Main
- Last Pushed: 2025-06-26T21:30:16.000Z (10 months ago)
- Last Synced: 2025-06-26T22:56:56.889Z (10 months ago)
- Topics: drizzle-orm, jwt, postgresql, reactjs, tailwindcss, tasktracker, typescript, zod
- Language: TypeScript
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Task Tracker
A full-featured **Task Tracker backend** built using **Node.js**, **TypeScript**, **Express**, **PostgreSQL**, and **Drizzle ORM**. The application supports user registration, authentication using JWT, and complete CRUD functionality for managing tasks.
---
## ๐ Features
- ๐ User Authentication (Register/Login with JWT)
- ๐ก๏ธ Middleware-based route protection
- ๐ Task management (Create, Read, Update, Delete)
- ๐ฑ Environment variable configuration with `dotenv`
- ๐งพ Type-safe schema with Drizzle ORM
- ๐งช Input validation using Zod
- โก TypeScript + tsx/ts-node-dev for smooth dev experience
---
## ๐งฐ Tech Stack
- **Node.js**
- **Express.js**
- **TypeScript**
- **PostgreSQL**
- **Drizzle ORM**
- **JWT (JSON Web Tokens)**
- **Zod**
- **dotenv**
- **tsx** / **ts-node-dev**
---
## ๐ Project Structure
```
task-tracker/
โโโ drizzle.config.ts
โโโ package.json
โโโ tsconfig.json
โโโ .env
โโโ src/
โ โโโ index.ts
โ โโโ db.ts
โ โโโ schema/
โ โโโ routes/
โ โโโ middleware/
โ โโโ utils/
```
---
## โ๏ธ Setup Instructions
### 1๏ธโฃ Clone the Repository
```bash
git clone https://github.com/Murtaza99dev/task-tracker.git
cd task-tracker/backend
yarn install
```
### 2๏ธโฃ Create .env File
```
PORT=5000
JWT_SECRET=your_jwt_secret_key
DB_HOST=localhost
DB_PORT=5432
DB_USER=your_postgres_user
DB_PASSWORD=your_postgres_password
DB_NAME=task_db
DATABASE_URL=postgresql://your_postgres_user:your_postgres_password@localhost:5432/task_db
```
### 3๏ธโฃ Run the Project
```bash
yarn dev
```
The server should now be running at: [http://localhost:5000](http://localhost:5000)
---
## ๐งช API Endpoints
### ๐ Auth Routes
| Method | Endpoint | Description |
|--------|----------------|-----------------------|
| POST | /api/register | Register new user |
| POST | /api/login | Login and get JWT |
### โ
Task Routes (Protected)
| Method | Endpoint | Description |
|--------|-----------------|---------------------|
| GET | /api/tasks | Get all tasks |
| POST | /api/tasks | Create new task |
| PUT | /api/tasks/:id | Update task |
| DELETE | /api/tasks/:id | Delete task |
> **Note:** All `/api/tasks` endpoints require a JWT token in the request header:
>
> ```
> Authorization: Bearer
> ```
---
## ๐งฐ Drizzle ORM Commands
Run after creating or modifying your schema in `src/schema`.
**Push Schema to DB**
```bash
npx drizzle-kit push
```
**Generate SQL from Schema**
```bash
npx drizzle-kit generate
```
---
## ๐งโ๐ป Development Tools
Start server in watch mode:
```bash
yarn dev
```
**Drizzle ORM setup config (`drizzle.config.ts`):**
```ts
import { defineConfig } from "drizzle-kit";
import * as dotenv from "dotenv";
dotenv.config();
export default defineConfig({
schema: "./src/schema",
out: "./drizzle",
driver: "pg",
dbCredentials: {
connectionString: process.env.DATABASE_URL!,
},
});
```
---
## ๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
---
## ๐โโ๏ธ Author
**Ghulam Murtaza**
- GitHub: [@Murtaza99dev](https://github.com/Murtaza99dev)
- Email: murtaza99.dev@gmail.com
- LinkedIn: [https://www.linkedin.com/in/im-ghulam-murtaza/](https://www.linkedin.com/in/im-ghulam-murtaza/)
---
## ๐ง Future Improvements
- ๐
Task due dates and prioritization
- ๐ Task analytics
- ๐ Frontend integration (React/Next.js)
- ๐งโ๐คโ๐ง Team/task sharing
---
Let me know if you want a separate Postman/Bruno collection JSON or frontend instructions added.