This is a Task Management Application that enables users to manage buckets and their associated tasks. The project is split into two parts:
Clone the repository:
git clone https://github.com/Muhammad-Taha-Qader/Task-Management
cd rails_backend
Install dependencies:
bundle install
Set up the database:
rails db:create db:migrate
Start the Rails server:
rails server
The Rails API will run on http://localhost:3000
.
Clone the repository:
cd next_frontend
Install dependencies:
npm install
Configure the API base URL:
Update the baseURL
in services/api.ts
to point to the Rails backend:
const API = axios.create({
baseURL: "http://localhost:3000/api/v1",
headers: {
"Content-Type": "application/json",
},
});
Start the Next.js development server:
npm run dev
The Next.js app will run on http://localhost:3001
(default port).
The Rails backend provides the following API endpoints:
Method | Endpoint | Description |
---|---|---|
GET | /api/v1/buckets |
Fetch all buckets |
GET | /api/v1/buckets/:id |
Fetch a specific bucket |
POST | /api/v1/buckets |
Create a new bucket |
PUT | /api/v1/buckets/:id |
Update a specific bucket |
DELETE | /api/v1/buckets/:id |
Delete a specific bucket |
Method | Endpoint | Description |
---|---|---|
POST | /api/v1/buckets/:bucket_id/tasks |
Add a task to a bucket |
PUT | /api/v1/buckets/:bucket_id/tasks/:id |
Update a task in a bucket |
DELETE | /api/v1/buckets/:bucket_id/tasks/:id |
Delete a task from a bucket |
task-management-backend/
āāā app/
ā āāā controllers/
ā ā āāā api/
ā ā ā āāā v1/
ā ā ā ā āāā buckets_controller.rb
ā ā ā ā āāā tasks_controller.rb
ā āāā models/
ā ā āāā bucket.rb
ā ā āāā task.rb
āāā config/
ā āāā routes.rb # Defines API routes
āāā db/
ā āāā migrate/ # Database migration files
ā āāā schema.rb # Database schema
task-management-frontend/
āāā app/
ā āāā page.tsx # Home page (list buckets)
ā āāā bucket/
ā ā āāā [id]/
ā ā āāā page.tsx # Bucket details and tasks
āāā components/
ā āāā BucketForm.tsx # Form for creating/updating buckets
ā āāā BucketList.tsx # List of buckets
ā āāā TaskForm.tsx # Form for creating/updating tasks
ā āāā TaskList.tsx # List of tasks
āāā services/
ā āāā api.ts # Axios API service
āāā styles/
ā āāā globals.css # Tailwind CSS styles
āāā types.ts # TypeScript type definitions
Frontend:
Backend:
Data Flow:
git checkout -b feature-name
git commit -m "Add feature name"
git push origin feature-name
This project is licensed under the MIT License. See the LICENSE file for details.