This project is a full-stack application for managing routines and tasks. It includes technical features such as caching, pagination, and toasts for user feedback.
- Framework: Express.js
- Database: Prisma with PostgreSQL
- Caching: Cache-manager with Keyv for in-memory caching
- Error Handling: Custom error middleware
- Framework: React with Vite
- State Management: Context API + React Query
- Styling: TailwindCSS + shadcn/ui
- Toasts: Sonner for user feedback
The backend is organized into several key directories to separate concerns and improve maintainability.
docker/: Contains Docker configuration files for development and production environments.prisma/: Includes Prisma schema and migration files for database management.scripts/: Contains shell scripts for various tasks such as starting the development server.src/: The main source code directory.controllers/: Handles incoming requests and returns responses to the client.dtos/: Data Transfer Objects for validating and transforming data.interfaces/: TypeScript interfaces for type checking.middleware/: Custom middleware functions for request handling.routes/: Defines the API endpoints and maps them to controller functions.services/: Business logic and data access layer.utils/: Utility functions and helpers.
The frontend is structured to separate concerns and improve maintainability.
public/: Contains static assets like the favicon.src/: The main source code directory.components/: Reusable UI components.custom/: Custom components specific to the application.cards/: Card components for displaying routines and tasks.dialogs/: Dialog components for creating and editing routines and tasks.
ui/: General UI components like buttons, forms, and inputs.
context/: React context for state management.lib/: Utility functions and helpers.services/: API service functions for communicating with the backend.types/: TypeScript types for type checking.
To create a new routine, click the "New Routine" button and fill out the form. The routine will be saved and displayed in the list.
To add a task to a routine, click the "Add Task" button within the routine card and fill out the form. The task will be saved and displayed within the routine.
- Node.js (v18 or later)
- npm or yarn
- Docker and Docker Compose
-
Download Docker Desktop:
- Go to the Docker Desktop for Windows page.
- Download and install Docker Desktop.
-
Install Docker Compose:
- Docker Compose is included with Docker Desktop, so no additional installation is required.
-
Download Docker Desktop:
- Go to the Docker Desktop for Mac page.
- Download and install Docker Desktop.
-
Install Docker Compose:
- Docker Compose is included with Docker Desktop, so no additional installation is required.
-
Install Docker:
- Follow the instructions for your Linux distribution on the Docker Engine installation guide.
-
Install Docker Compose:
- Follow the instructions on the Docker Compose installation guide.
-
Create Environment Variables:
- Create
.env.devand.env.prodfiles in theback-enddirectory. - Follow the format in
back-end/env.exampleto set the necessary environment variables.
- Create
-
Navigate to the
back-enddirectory:cd back-end -
Install dependencies:
npm install
-
Start the development server:
npm run docker:dev
-
Start the production server:
npm run docker:prod
npm run init: Initialize initial migrations scriptnpm run docker:dev: Start the backend application in development mode using Docker.npm run docker:prod: Start the backend application in production mode using Docker.
-
Create Environment Variables:
- Create
.envfile in thefront-enddirectory. - Follow the format in
front-end/.env.exampleto set the necessary environment variables.
- Create
-
Navigate to the
front-enddirectory:cd front-end -
Install dependencies:
npm install
-
Start the development server:
npm run dev
- Add WebSocket for real-time data
- Add Authentication so Users can have their own routines for their account
- Deploy the back-end in a serverless architecture (Azure or AWS)
- Deploy the front-end on Vercel
- Unit Testing for API endpoints