Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finalDone - Lumaa_Spring_2025 #79

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
183 changes: 64 additions & 119 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,64 @@
# Full-Stack Coding Challenge

**Deadline**: Sunday, Feb 23th 11:59 pm PST

---

## Overview

Create a “Task Management” application with **React + TypeScript** (frontend), **Node.js** (or **Nest.js**) (backend), and **PostgreSQL** (database). The application should:

1. **Register** (sign up) and **Log in** (sign in) users.
2. After logging in, allow users to:
- **View a list of tasks**.
- **Create a new task**.
- **Update an existing task** (e.g., mark complete, edit).
- **Delete a task**.

Focus on **correctness**, **functionality**, and **code clarity** rather than visual design.
This challenge is intended to be completed within ~3 hours, so keep solutions minimal yet functional.

---

## Requirements

### 1. Authentication

- **User Model**:
- `id`: Primary key
- `username`: Unique string
- `password`: Hashed string
- **Endpoints**:
- `POST /auth/register` – Create a new user
- `POST /auth/login` – Login user, return a token (e.g., JWT)
- **Secure the Tasks Routes**: Only authenticated users can perform task operations.
- **Password Hashing**: Use `bcrypt` or another hashing library to store passwords securely.
- **Token Verification**: Verify the token (JWT) on each request to protected routes.

### 2. Backend (Node.js or Nest.js)

- **Tasks CRUD**:
- `GET /tasks` – Retrieve a list of tasks (optionally filtered by user).
- `POST /tasks` – Create a new task.
- `PUT /tasks/:id` – Update a task (e.g., mark as complete, edit text).
- `DELETE /tasks/:id` – Delete a task.
- **Task Model**:
- `id`: Primary key
- `title`: string
- `description`: string (optional)
- `isComplete`: boolean (default `false`)
- _(Optional)_ `userId` to link tasks to the user who created them
- **Database**: PostgreSQL
- Provide instructions/migrations to set up:
- `users` table (with hashed passwords)
- `tasks` table
- **Setup**:
- `npm install` to install dependencies
- `npm run start` (or `npm run dev`) to run the server
- Document any environment variables (e.g., database connection string, JWT secret)

### 3. Frontend (React + TypeScript)

- **Login / Register**:
- Simple forms for **Register** and **Login**.
- Store JWT (e.g., in `localStorage`) upon successful login.
- If not authenticated, the user should not see the tasks page.
- **Tasks Page**:
- Fetch tasks from `GET /tasks` (including auth token in headers).
- Display the list of tasks.
- Form to create a new task (`POST /tasks`).
- Buttons/fields to update a task (`PUT /tasks/:id`).
- Button to delete a task (`DELETE /tasks/:id`).
- **Navigation**:
- Show `Login`/`Register` if not authenticated.
- Show `Logout` if authenticated.
- **Setup**:
- `npm install` then `npm start` (or `npm run dev`) to run.
- Document how to point the frontend at the backend (e.g., `.env` file, base URL).

---

## Deliverables

1. **Fork the Public Repository**: **Fork** this repo into your own GitHub account.
2. **Implement Your Solution** in the forked repository. Make sure you're README file has:
- Steps to set up the database (migrations, environment variables).
- How to run the backend.
- How to run the frontend.
- Any relevant notes on testing.
- Salary Expectations per month (Mandatory)
3. **Short Video Demo**: Provide a link (in a `.md` file in your forked repo) to a brief screen recording showing:
- Registering a user
- Logging in
- Creating, updating, and deleting tasks
4. **Deadline**: Submissions are due **Sunday, Feb 23th 11:59 pm PST**.

> **Note**: Please keep your solution minimal. The entire project is intended to be completed in around 3 hours. Focus on core features (registration, login, tasks CRUD) rather than polished UI or extra features.

---

## Evaluation Criteria

1. **Functionality**
- Does registration and login work correctly (with password hashing)?
- Are tasks protected by authentication?
- Does the tasks CRUD flow work end-to-end?

2. **Code Quality**
- Is the code structured logically and typed in TypeScript?
- Are variable/function names descriptive?

3. **Clarity**
- Is the `README.md` (in your fork) clear and detailed about setup steps?
- Easy to run and test?

4. **Maintainability**
- Organized logic (controllers/services, etc.)
- Minimal hard-coded values

Good luck, and we look forward to your submission!
### Task Management Application Setup Guide

#### 1. Setting Up the Database
- Ensure PostgreSQL is installed on your system.
- Create a new PostgreSQL database:
sql
CREATE DATABASE task_management;

- Set up environment variables:

DATABASE_URL=postgresql://username:password@localhost:5432/task_management

- Run database migrations:
sh
npm run migrate


#### 2. Running the Backend
- Navigate to the backend directory:
sh
cd backend

- Install dependencies:
sh
npm install

- Start the server on port 3001:
sh
npm run start


#### 3. Running the Frontend
- Navigate to the frontend directory:
sh
cd frontend

- Install dependencies:
sh
npm install

- Start the frontend application on port 3000:
sh
npm run dev


#### 4. Testing
- To run backend tests:
sh
npm run test

- To run frontend tests:
sh
npm run test

- Ensure unit and integration tests are included for key features.

#### 5. Salary Expectations
- Expected salary per month (Mandatory):2560-2800$




#### 6. Video Link
- https://www.loom.com/share/02eb20146a82440ebafe6900e6d68d4c
7 changes: 7 additions & 0 deletions backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=Anuj131103
DB_NAME=task_management
JWT_SECRET=your_random_secret_key_here
PORT=3000
Loading