Thanks for wanting to help! TaskFlow is built for learning, so first-time contributors are very welcome. Never opened a pull request before? This guide walks you through every step.
By taking part, you agree to follow our Code of Conduct. In short: be kind and respectful.
Contents
- Find an issue to work on
- Set up the project
- Make your change
- Test your change
- Open a pull request
- Where things live
- Getting help
- Browse the open issues. If you're new, look for the
good first issuelabel: these are small, well-described tasks. - Comment on the issue before you start, for example: "Hi, I'd like to work on this!"
- Wait until a maintainer assigns the issue to you. This stops two people from accidentally doing the same work. Pull requests for issues that aren't assigned to you are closed.
- If you get stuck or can't finish, just say so in a comment. That's completely fine, and someone else can pick it up.
Good first issues are reserved for people making their first few open-source contributions. They're how newcomers get started here. If you've already had several pull requests merged in other projects, please pick a
help wantedissue instead.
Have an idea that isn't in an issue yet? Open an issue first and describe it, so we can agree on the approach before you write code. Small fixes like typos can go straight to a pull request.
- Node.js 22.12 or newer. Version 24 is recommended (it's in
.nvmrc). Check yours withnode --version. - Git.
- MongoDB, either:
- installed locally (MongoDB Community Server), or
- a free cloud database on MongoDB Atlas (step 1 of the deployment guide shows how to get a connection string).
A fork is your own copy of the repository on GitHub. You push your changes there, then ask for them to be merged into the original.
- Click Fork at the top right of the TaskFlow repository.
- Clone your fork (replace
<your-username>):git clone https://github.com/<your-username>/taskflow.git cd taskflow
- Connect it to the original repository, called
upstream, so you can get the latest changes later:git remote add upstream https://github.com/KEX-03/taskflow.git
All commands run from the repository root (the taskflow folder).
- Install everything (root, server and client):
npm run install:all
- Create your local settings files from the examples:
# macOS / Linux / Git Bash cp server/.env.example server/.env cp client/.env.example client/.envThe defaults work with a local MongoDB. Using Atlas? Put your connection string in# Windows PowerShell Copy-Item server/.env.example server/.env Copy-Item client/.env.example client/.env
MONGO_URIinserver/.env. Each setting is explained in the file. - Start the server and the client together:
You should see
npm run dev
[server] ✅ Server running on http://localhost:5000and a[client]line from Vite. - Open http://localhost:3000 and sign up for an account.
Other commands you can run from the root:
| Command | What it does |
|---|---|
npm run dev:server |
Start only the API (http://localhost:5000) |
npm run dev:client |
Start only the frontend (http://localhost:3000) |
npm run build |
Build the frontend for production |
npm test |
Run the automated tests (the backend, the Focus Timer and the release and merge scripts) |
npm run lint |
Check the client and server code for likely bugs with ESLint |
Something went wrong? The server prints a ❌ line explaining what's missing, for example an environment variable or a MongoDB connection. Port already in use? Stop the other program, or the other npm run dev, first.
Never work directly on main. First get the latest code, then create a branch for your issue:
git checkout main
git pull upstream main
git checkout -b fix/42-dashboard-task-countName branches <type>/<issue-number>-<short-description>, using the same types as commit messages (below):
| Example | When |
|---|---|
feat/17-due-dates |
A new feature |
fix/42-dashboard-task-count |
A bug fix |
docs/8-api-examples |
Documentation only |
We use Conventional Commits: type(scope): short description.
- type says what kind of change it is.
- scope (optional) says which part:
serverorclient. - description is written in lowercase, in the imperative ("add", not "added"), without a full stop at the end.
| Type | Use it for | Example |
|---|---|---|
feat |
A new feature | feat(client): add password visibility toggle |
fix |
A bug fix | fix(server): return 404 for invalid task ids |
docs |
Documentation | docs: add Windows setup notes to README |
style |
Formatting only, no logic change | style(client): fix indentation in Tasks page |
refactor |
Restructuring code without changing behavior | refactor(server): move auth validation into a helper |
test |
Adding or changing tests | test(server): add tests for task controller |
build |
Dependencies, scripts, build setup | build(client): upgrade vite |
ci |
GitHub Actions workflows | ci: run tests on pull requests |
chore |
Other maintenance | chore: update .gitignore |
Small, focused commits are easier to review than one giant commit.
Pull requests are squash-merged: all your commits become one commit on main, and your pull request's title becomes that commit's title. So give the pull request a title in this same format too (see Open a pull request).
If main has changed since you started, bring your branch up to date:
git fetch upstream
git merge upstream/mainThe backend has an automated test suite using Node.js's built-in test runner. The API tests need MongoDB running locally, the same as npm run dev; they use a separate taskflow_test database, so your own data is safe. Using Atlas? Put a connection string in TEST_MONGO_URI in server/.env, with a database name ending in _test (for example .../taskflow_test). The tests only cover part of the code so far, so please run them and check your change by hand before opening a pull request:
- The tests and the linter pass.
npm testfrom the repository root (or fromserver/) ends withℹ fail 0, andnpm run lintreports no problems. If you changed a helper inserver/src/utils/or an API endpoint, add or update its tests inserver/test/. Changes to the Focus Timer logic (client/src/utils/pomodoro*.js) need their tests inclient/test/updated. Changes to the scripts in.github/scripts/need their tests there updated too. - It builds.
npm run buildfinishes with✓ built in …. - It starts cleanly.
npm run devshows no errors in either the[server]or the[client]output. - Your change works. Try the exact thing your issue describes, including edge cases (empty input, very long text, and so on).
- Nothing else broke. Run through the main flow:
- sign up, log out, log back in
- create, edit, filter, search and delete a task
- update your profile
- The browser console is clean. Open the developer tools (F12) and check the Console tab for red errors.
- For API changes: call the endpoint with Postman (import
postman_collection.json) orcurl, including the error cases (missing fields, invalid values, no login token).
When you open a pull request, GitHub Actions runs the tests and the build automatically, and shows the result at the bottom of the PR. If a check fails, click Details to see why, fix it, and push again: the checks re-run on every push. (On your first pull request, a maintainer may need to approve the checks before they run.)
- Push your branch to your fork:
git push -u origin fix/42-dashboard-task-count
- GitHub will show a Compare & pull request button on your fork. Click it, and check that the base is
KEX-03/taskflow→main. - Give it a title in the Conventional Commits format, for example
fix(client): show every task on the Tasks page. It becomes the commit title onmain. - Fill in the pull request template:
- Link the issue with
Closes #42, so it closes automatically when merged. - Explain what you changed and why under "What does this PR do?". Write it for someone reading the project history later: this section becomes the commit's description on
main. - Explain how you tested it.
- Add screenshots (before and after) for anything visible in the UI.
- Update the docs if you changed setup steps, environment variables or API endpoints.
- Link the issue with
What to expect:
- Keep pull requests small: one issue per pull request.
- A maintainer will review it and may ask for changes. That's normal and part of learning! Push new commits to the same branch and the pull request updates automatically.
- Please be patient: maintainers review in their free time.
- Once it's approved, it's merged automatically as soon as the tests and the build pass. 🎉 The commit on
mainis made from your pull request: the title, the "What does this PR do?" section and aCloses #...line for the linked issue. A maintainer may tidy the title or description before approving.
For the bigger picture (how a request flows, how login works, and how the data is stored), read How TaskFlow works first.
taskflow/
├── server/src/ Express API
│ ├── server.js Entry point: connects to MongoDB, starts the server
│ ├── app.js The Express app: middleware, routes
│ ├── config/db.js MongoDB connection
│ ├── models/ Mongoose schemas: User, Task
│ ├── controllers/ Request handlers (the actual logic)
│ ├── routes/ URL → controller mapping
│ ├── middleware/auth.js `protect`: checks the login token
│ └── utils/ Helpers: tokens, errors, query parsing
├── server/test/ Automated tests (node:test)
└── client/src/ React app
├── App.jsx All page routes
├── pages/ One file per page
├── components/ Shared UI (Sidebar, Toast, Spinner, ...)
├── context/ AuthContext: the logged-in user
└── utils/api.js Axios instance that talks to the API
A request travels route → middleware → controller → model. To add an endpoint, work backwards through those files. Example: GET /api/v1/tasks/stats, which returns how many tasks the user has in each status.
1. Model (server/src/models/): only needed if you store new data. To add a field, add it to the schema in Task.js or User.js:
dueDate: {
type: Date,
default: null,
},The stats example only reads existing data, so it doesn't need this step.
2. Controller (server/src/controllers/taskController.js): write the function that handles the request. req.user is the logged-in user (set by protect). Always filter by owner, so users only ever see their own tasks:
// ── GET /api/v1/tasks/stats ──────────────────
const getTaskStats = async (req, res) => {
const owner = req.user._id;
const [todo, inProgress, done] = await Promise.all(
STATUSES.map((status) => Task.countDocuments({ owner, status }))
);
res.json({ success: true, stats: { todo, inProgress, done } });
};Then add getTaskStats to the module.exports at the bottom of the file.
3. Route (server/src/routes/tasks.js): connect a URL to the controller. Wrap it in protect (login required) and asyncHandler (passes errors to the error handler):
router.get("/stats", protect, asyncHandler(getTaskStats));
⚠️ Put it aboverouter.get("/:id", ...). Express checks routes from top to bottom, and/:idwould otherwise catch/statsand treat"stats"as a task id.
4. App (server/src/app.js): only needed for a new routes file. Mount it next to the others:
app.use("/api/v1/tasks", taskRoutes);5. Try it: log in through Postman (or curl), then call GET http://localhost:5000/api/v1/tasks/stats with the token. Also add the endpoint to postman_collection.json and to the API table in the README.
6. Add tests (server/test/tasks.test.js): send real requests to the endpoint, like the existing tests do, and check the responses, including the error cases. Run npm test and check that it ends with ℹ fail 0.
Example: an Archive page at /archive.
1. Create the page in client/src/pages/Archive.jsx. Use the shared api instance for requests (it adds the login token for you) and useToast for messages:
import React, { useEffect, useState } from "react";
import api from "../utils/api.js";
import { useToast } from "../components/Shared/Toast.jsx";
const Archive = () => {
const { addToast } = useToast();
const [tasks, setTasks] = useState([]);
useEffect(() => {
api.get("/tasks?status=done")
.then(({ data }) => setTasks(data.tasks))
.catch(() => addToast("Could not load tasks.", "error"));
}, [addToast]);
return (
<div className="flex-1 p-6 overflow-y-auto">
<h1 className="text-xl font-bold text-white mb-6">Archive</h1>
{tasks.map((task) => (
<p key={task._id} className="text-text-label text-sm">{task.title}</p>
))}
</div>
);
};
export default Archive;2. Add a route in client/src/App.jsx. Import the page at the top, then add a <Route> next to the others. Wrapping it in ProtectedRoute sends logged-out users to the login page, and DashLayout adds the sidebar:
import Archive from "./pages/Archive.jsx";<Route
path="/archive"
element={
<ProtectedRoute>
<DashLayout><Archive /></DashLayout>
</ProtectedRoute>
}
/>3. Add a sidebar link in client/src/components/Layout/Sidebar.jsx by adding an entry to the navItems array, with to: "/archive", a label and an icon (copy the SVG from another entry to start with). The small-screen menu reuses the sidebar, so the link shows up there too.
4. Try it: open http://localhost:3000/archive while logged in, then try it again while logged out (you should be sent to the login page).
Styling uses Tailwind CSS utility classes. Copy the classes from existing pages to keep the look consistent.
- Questions about the code or setup? Ask in GitHub Discussions.
- Stuck on an issue you're working on? Comment on the issue itself.
- Found a bug? Open an issue.
- Found a security problem? Please don't open a public issue; see SECURITY.md.
Thanks for contributing! 💙