This project is a React application built with Vite for the frontend and a Fastify server for the backend. The entire project is written in TypeScript. The backend does not use a database; instead, it stores all data in memory. This guide will help you set up and run the project on your local machine.
- Node.js >= 18.x
- pnpm package manager
Follow these steps to install dependencies and set up your project:
Install dependencies using pnpm:
pnpm installTo start the project, you need to run both the frontend and backend development servers. Open two terminal windows or use a terminal multiplexer like tmux or screen.
- Navigate to the project directory.
- Start the frontend server:
pnpm devThe frontend server will start on http://localhost:5173.
- Navigate to the project directory.
- Start the backend server:
pnpm dev:apiThe backend server will start on http://localhost:3000.
The project includes several npm scripts for common tasks:
pnpm dev: Starts the frontend development server.pnpm dev:api: Starts the backend development server.pnpm build: Compiles TypeScript and builds the frontend for production.pnpm lint: Lints the codebase using ESLint.pnpm format: Formats the code using Prettier.pnpm preview: Previews the built frontend.pnpm test: Runs the tests using Playwright.
To run the tests, ensure that both the frontend and backend servers are running. You can then run the test suite:
pnpm test- The backend does not use a database. All todos are stored in memory as
let todos = []. - To reset the todos state, you need to restart the backend development server.
- The project is set up using
pnpmfor package management to optimize the installation process and reduce disk space usage.