Skip to content

Commit e863221

Browse files
committed
Initial commit: Added project files
0 parents  commit e863221

29 files changed

+11547
-0
lines changed

Backlog.MD

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
## Backlog 1: Notes CRUD Operations
2+
3+
**Description:**
4+
- **As a** user,
5+
- **I want** to create, read, update, and delete notes,
6+
- **So that** I can manage my personal information effectively.
7+
8+
**Acceptance Criteria:**
9+
10+
1. **Create Notes:**
11+
- Users should be able to add new notes with a title and content.
12+
- Each note should automatically store creation date and time.
13+
- After creating a note, it should appear in the notes list.
14+
15+
2. **Read Notes:**
16+
- Users should be able to view a list of all their notes.
17+
- Users should be able to click on a note to view its full content.
18+
- Notes should display title, partial content preview, and creation/modification date in the list view.
19+
20+
3. **Update Notes:**
21+
- Users should be able to edit the title and content of existing notes.
22+
- Notes should store the last modification date when updated.
23+
- Changes should be saved automatically or with an explicit save button.
24+
25+
4. **Delete Notes:**
26+
- Users should be able to delete notes they no longer need.
27+
- A confirmation dialog should appear before permanent deletion.
28+
- After deletion, the note should be removed from the notes list immediately.
29+
30+
5. **Testing:**
31+
- Write unit tests for creating, retrieving, updating, and deleting notes.
32+
- Ensure proper error handling when operations fail.
33+
- Test that notes belong to the correct user and cannot be accessed by others.
34+
35+
6. **Documentation:**
36+
- All functions should include JSDoc comments explaining purpose, parameters, and return values.
37+
- README should include setup instructions and CRUD API endpoints documentation.
38+
- Code should include inline comments for complex logic.
39+
40+
## Backlog 2
41+
42+
**Description:**
43+
- **As a** user,
44+
- **I want** to have a field for categories in the items,
45+
- **So that** I can filter and display items based on their categories.
46+
47+
**Acceptance Criteria:**
48+
49+
1. **Category Field:**
50+
- Each item should have a category field.
51+
- The category field should be a dropdown list with predefined categories - 'Home', 'Personal' and 'Work.
52+
53+
2. **Filtering:**
54+
- Categories should be displayed as tabs on the UI.
55+
- When a category tab is selected, only items belonging to that category should be displayed.
56+
57+
3. **Displaying:**
58+
- The filtered items should be displayed in a list or grid format under the selected category tab.
59+
- The UI should update dynamically to reflect the filtered items when a tab is selected.
60+
61+
4. **Testing:**
62+
- Write unit tests to verify that items can be created and edited with a category.
63+
- Write unit tests to ensure that filtering by category works correctly.
64+
65+
5. **Documentation:**
66+
- Create user documentation explaining how to use and manage categories.
67+
- Add comments to category-related components explaining their functionality.
68+
69+
## Backlog 3: Search Functionality
70+
71+
**Description:**
72+
- **As a** user,
73+
- **I want** to search through my notes quickly and efficiently,
74+
- **So that** I can find specific information without manually browsing through all notes.
75+
76+
**Acceptance Criteria:**
77+
78+
1. **Search Interface:**
79+
- A search bar should be prominently displayed at the top of the notes list.
80+
- The search bar should have a clear icon to reset the search.
81+
- Search should start automatically as the user types (after 3 characters).
82+
83+
2. **Search Capabilities:**
84+
- Search should check both note titles and content.
85+
- Search should be case-insensitive.
86+
- Search should support partial word matches.
87+
- Search results should highlight matching terms.
88+
89+
3. **Results Display:**
90+
- Search results should be displayed in real-time as the user types.
91+
- Results should be ordered by relevance (number of matches).
92+
- If no results are found, a friendly "No matches found" message should be displayed.
93+
- The total number of matching notes should be displayed.
94+
95+
4. **Advanced Search:**
96+
- Users should be able to filter search results by category.
97+
- Users should be able to sort search results by date created, date modified, or title.
98+
- Users should be able to search within a specific date range.
99+
100+
5. **Testing:**
101+
- Write unit tests for the search algorithm.
102+
- Test edge cases like empty search, special characters, and very long search terms.
103+
104+
6. **Documentation:**
105+
- Document the search algorithm with explanations of relevance scoring.
106+
- Add inline comments explaining regex patterns and search logic.
107+
108+
## Other things that can be tried
109+
110+
- Create new features in the code
111+
- Ask Copilot to make the UI better

README.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Notes App
2+
3+
This is a full-stack notes application with React frontend and Express backend, with upcoming features that allow users to create, edit, view, and delete notes.
4+
5+
## Downloading and installing Node.js and npm
6+
7+
[Installation instructions ](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
8+
9+
## Technology Stack
10+
11+
### Frontend
12+
- React.js with React Router for navigation
13+
- Tailwind CSS for styling
14+
- Jest for testing
15+
- Vite as the build tool
16+
17+
### Backend
18+
- Node.js
19+
- Express.js
20+
- REST API
21+
22+
## Prerequisites
23+
24+
- Node.js v14.0 or higher
25+
- npm or yarn
26+
27+
## Setup Instructions
28+
29+
### Backend Setup
30+
31+
1. Navigate to the backend directory:
32+
```bash
33+
cd backend
34+
```
35+
36+
2. Install dependencies:
37+
```bash
38+
npm install
39+
```
40+
41+
3. Start the development server:
42+
```bash
43+
npm run dev
44+
```
45+
46+
### Frontend Setup
47+
48+
1. Navigate to the frontend directory:
49+
```bash
50+
cd frontend
51+
```
52+
53+
2. Install dependencies:
54+
```bash
55+
npm install
56+
```
57+
58+
3. Start the development server:
59+
```bash
60+
npm run dev
61+
```
62+
63+
## Running Tests
64+
65+
To run tests for the frontend:
66+
67+
```bash
68+
cd frontend
69+
npm test
70+
```

backend/.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
25+
26+
.vercel

backend/app.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const express = require('express');
2+
const cors = require('cors');
3+
const app = express();
4+
const PORT = 5000;
5+
6+
app.use(cors());
7+
app.use(express.json());
8+
9+
let notes = [
10+
{ id: 0, title: 'Grocery List', content: 'Milk, eggs, bread' },
11+
{ id: 1, title: 'Meeting Notes', content: 'Discussed project deadlines' },
12+
{ id: 2, title: 'Ideas', content: 'New app features' }
13+
];
14+
// GET all notes
15+
app.get('/notes', (req, res) => {
16+
res.json(notes);
17+
});
18+
19+
// POST new note
20+
21+
// PUT update note
22+
23+
// DELETE note
24+
25+
app.listen(PORT, () => {
26+
console.log(`Server running on port ${PORT}`);
27+
});

0 commit comments

Comments
 (0)