TaskFlow is a full-stack task management application built with Fastify (Backend) and React (Frontend). It enables teams to collaborate on tasks, manage projects in rooms, and track progress in real-time.
- Task Management: Create, assign, and track tasks with due dates and priorities
- Team Collaboration: Work together in dedicated rooms with role-based access
- Real-time Updates: Live updates using Socket.IO for seamless collaboration
- Comments & Threads: Discuss tasks with threaded comments
- User Profiles: Customizable profiles with activity tracking
- Notifications: Stay updated with real-time notifications
- Runtime: Node.js
- Framework: Fastify
- Database: MongoDB with Mongoose
- Authentication: JWT
- Real-time: Socket.IO
- Validation: JSON Schema
- Framework: React
- State Management: Context API
- UI Components: Custom component library
- HTTP Client: Axios
- Routing: React Router
- Node.js (v14+)
- MongoDB (v4.4+)
- npm or yarn
# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create .env file and add environment variables
cp .env.example .env
# Start development server
npm run dev# Navigate to frontend directory
cd ../frontend/tasks
# Install dependencies
npm install
# Start development server
npm startCreate a .env file in the backend directory with the following variables:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=7d
NODE_ENV=development
POST /api/v1/auth/register- Register a new userPOST /api/v1/auth/login- User loginGET /api/v1/auth/me- Get current user profile
GET /api/v1/tasks- Get all tasksPOST /api/v1/tasks- Create a new taskGET /api/v1/tasks/:id- Get task detailsPUT /api/v1/tasks/:id- Update taskDELETE /api/v1/tasks/:id- Delete task
GET /api/v1/room/get/rooms- Get all roomsPOST /api/v1/room/add/rooms- Create a new roomPUT /api/v1/room/update/rooms/:roomId- Update roomDELETE /api/v1/room/delete/rooms/:roomId- Delete room
POST /api/v1/comment/add/comments- Add commentPUT /api/v1/comment/update/comments/:commentId- Update commentDELETE /api/v1/comment/delete/comments/:commentId- Delete commentPOST /api/v1/comment/reply/comments/:commentId/replies- Reply to comment
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Fastify Team
- MongoDB
- React Community
- Permettre la collaboration entre utilisateurs
- Offrir une API sécurisée et performante
- Proposer une interface utilisateur moderne et responsive
Tasks_api/
├── backend/ # API RESTful (Fastify + MongoDB)
│ ├── src/
│ │ ├── controllers/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── middleware/
│ │ └── utils/
│ ├── package.json
│ └── .env.example
├── frontend/ # Interface utilisateur (React + TypeScript)
│ └── tasks/
│ ├── src/
│ │ ├── pages/
│ │ ├── ui/
│ │ ├── context/
│ │ └── App.tsx
│ └── package.json
└── README.md
- Framework: Fastify (Node.js)
- Base de données: MongoDB
- Authentification: JWT (JSON Web Tokens)
- Validation: Joi/Yup
- Sécurité: bcrypt pour le hachage des mots de passe
- Framework: React 18 avec TypeScript
- Routage: React Router DOM
- Styling: Tailwind CSS
- Notifications: React Hot Toast
- Gestion d'état: Context API
- Node.js 22+ et npm
- MongoDB (local ou MongoDB Atlas)
- Git
-
Cloner le repository
git clone https://github.com/elhalj/Tasks_api.git cd Tasks_api/backend -
Installer les dépendances
npm install
-
Configuration des variables d'environnement
cp .env.example .env
Éditer le fichier
.env:PORT=3000 MONGODB_URI=mongodb://localhost:27017/tasks_db JWT_SECRET=votre_secret_jwt_très_sécurisé JWT_EXPIRES_IN=24h NODE_ENV=development
-
Démarrer le serveur
# Mode développement npm run dev # Mode production npm start
-
Naviguer vers le dossier frontend
cd ../frontend/tasks -
Installer les dépendances
npm install
-
Démarrer l'application
npm start
L'application sera accessible sur http://localhost:3000 (frontend) et l'API sur http://localhost:3000/api (backend).
http://localhost:3000/api
Toutes les routes protégées nécessitent un token JWT dans l'en-tête :
Authorization: Bearer <token>
Inscription d'un nouvel utilisateur
Body (JSON):
{
"userName": "john_doe",
"email": "[email protected]",
"password": "motdepasse123"
}Réponse (201):
{
"success": true,
"data": {
"user": {
"id": "507f1f77bcf86cd799439011",
"userName": "john_doe",
"email": "[email protected]"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}Connexion utilisateur
Body (JSON):
{
"email": "[email protected]",
"password": "motdepasse123"
}Réponse (200):
{
"success": true,
"data": {
"user": {
"id": "507f1f77bcf86cd799439011",
"userName": "john_doe",
"email": "[email protected]"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}Récupérer toutes les tâches de l'utilisateur connecté
Headers:
Authorization: Bearer <token>
Réponse (200):
{
"success": true,
"data": [
{
"_id": "507f1f77bcf86cd799439012",
"title": "Finaliser le rapport",
"description": "Terminer le rapport mensuel",
"completed": false,
"status": "pending",
"priority": "high",
"createdAt": "2025-08-03T10:00:00.000Z",
"updatedAt": "2025-08-03T10:00:00.000Z"
}
]
}Récupérer une tâche spécifique
Paramètres:
id: ID de la tâche
Réponse (200):
{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439012",
"title": "Finaliser le rapport",
"description": "Terminer le rapport mensuel",
"completed": false,
"status": "pending",
"priority": "high",
"createdAt": "2025-08-03T10:00:00.000Z",
"updatedAt": "2025-08-03T10:00:00.000Z"
}
}Créer une nouvelle tâche
Body (JSON):
{
"title": "Nouvelle tâche",
"description": "Description de la tâche",
"completed": false,
"status": "pending",
"priority": "medium"
}Réponse (201):
{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439013",
"title": "Nouvelle tâche",
"description": "Description de la tâche",
"completed": false,
"status": "pending",
"priority": "medium",
"userId": "507f1f77bcf86cd799439011",
"createdAt": "2025-08-03T11:00:00.000Z",
"updatedAt": "2025-08-03T11:00:00.000Z"
}
}Mettre à jour une tâche
Body (JSON):
{
"title": "Tâche mise à jour",
"description": "Description modifiée",
"completed": true,
"status": "done",
"priority": "low"
}Réponse (200):
{
"success": true,
"data": {
"_id": "507f1f77bcf86cd799439013",
"title": "Tâche mise à jour",
"description": "Description modifiée",
"completed": true,
"status": "done",
"priority": "low",
"updatedAt": "2025-08-03T12:00:00.000Z"
}
}Supprimer une tâche
Réponse (200):
{
"success": true,
"message": "Tâche supprimée avec succès"
}- LoginPage (
/) - Connexion utilisateur - RegisterPage (
/register) - Inscription utilisateur - Dashboard (
/dashboard) - Tableau de bord principal - AddTask (
/dashboard/add/task) - Création de tâche - UpdatePage (
/dashboard/tasks/:id/edit) - Modification de tâche
- Login - Formulaire de connexion
- Register - Formulaire d'inscription
- Tasks - Liste des tâches
- CreateTask - Formulaire de création de tâche
Gère l'authentification utilisateur :
interface AuthContextType {
user: User | null;
login: (email: string, password: string) => Promise<void>;
register: (
userName: string,
email: string,
password: string
) => Promise<void>;
logout: () => void;
}Gère les opérations sur les tâches :
interface TaskContextType {
tasks: Task[];
getTasks: () => Promise<void>;
addTask: (
title: string,
description: string,
completed: boolean,
status: string,
priority: string
) => Promise<void>;
deleteTask: (id: string) => Promise<void>;
}interface User {
id: string;
userName: string;
email: string;
}interface Task {
_id?: string;
title: string;
description: string;
completed: boolean;
status: "pending" | "in_progress" | "done" | "canceled";
priority: "low" | "medium" | "high" | "critical";
createdAt?: string;
updatedAt?: string;
}- Génération : Token JWT signé avec secret
- Durée de vie : Configurable (par défaut 24h)
- Protection : Middleware de vérification sur toutes les routes protégées
- Frontend : Validation TypeScript et React
- Backend : Validation des schémas avec middleware
- Hachage : bcrypt avec salt rounds configurables
- Stockage : Jamais en plain text dans la base de données
npm run dev # Démarrage en mode développement
npm start # Démarrage en mode production
npm test # Exécution des tests
npm run lint # Vérification du codenpm start # Démarrage du serveur de développement
npm run build # Build de production
npm test # Exécution des tests- Code Style : ESLint + Prettier
- TypeScript : Types stricts pour le frontend
- Validation : Validation des données côté client et serveur
- Gestion d'erreurs : Try/catch et middleware d'erreur
NODE_ENV=production
PORT=3000
MONGODB_URI=mongodb+srv://user:[email protected]/tasks_prod
JWT_SECRET=super_secret_production_key
JWT_EXPIRES_IN=24hFROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]-
Notifications Push
- Alertes d'échéance
- Notifications de collaboration
-
Collaboration Avancée
- Partage de tâches
- Commentaires et mentions
- Historique des modifications
-
Intégrations
- Calendrier (Google Calendar, Outlook)
- Slack/Discord
- Email (SMTP)
-
Analytics
- Statistiques de productivité
- Rapports personnalisés
- Tableaux de bord d'équipe
-
Mobile
- Application React Native
- Synchronisation offline
- Notifications push natives
- Vérifier les issues existantes
- Créer une nouvelle issue avec :
- Description détaillée
- Steps to reproduce
- Environnement (OS, Node.js, etc.)
- Fork le repository
- Créer une branche feature (
git checkout -b feature/nouvelle-fonctionnalite) - Commit les changements (
git commit -m 'Ajout nouvelle fonctionnalité') - Push vers la branche (
git push origin feature/nouvelle-fonctionnalite) - Ouvrir une Pull Request
- Suivre les conventions de code existantes
- Ajouter des tests pour les nouvelles fonctionnalités
- Mettre à jour la documentation
- Respecter les principes SOLID
Ce projet est distribué sous la licence MIT. Voir le fichier LICENSE pour plus d'informations.
- Fastify - Framework web ultra-rapide
- MongoDB - Base de données NoSQL flexible
- React - Bibliothèque UI moderne
- TypeScript - JavaScript typé pour un développement robuste
- Tailwind CSS - Framework CSS utilitaire
Développé avec ❤️ par elhalj
Pour plus d'informations, consultez le repository GitHub ou ouvrez une issue.
