This repository contains a time tracking application with a React frontend and a Node.js/Express backend.
- Frontend Application: https://harvest-a82c0.web.app
- Backend API: https://harvest-backend-sxoezkwvgq-an.a.run.app
- API Base URL:
https://harvest-backend-sxoezkwvgq-an.a.run.app/api/v2
- API Base URL:
- Email:
[email protected]
- Password:
admin123
Follow these instructions to set up and run the project locally.
- Node.js (LTS version recommended)
- npm or Yarn
- MongoDB (for backend data storage)
-
Navigate to the
server
directory:cd server
-
Install backend dependencies:
npm install
-
Build the backend:
npm run build
This will compile TypeScript files into JavaScript in the
dist
directory. -
Start the backend server:
npm start
The backend server will typically run on
http://localhost:5000
(or as configured in your environment variables).
-
Navigate back to the project root directory:
cd ..
-
Install frontend dependencies:
npm install
-
Build the frontend:
npm run build
This will create a production-ready build of your React application in the
dist
directory. -
Start the frontend development server:
npm run dev
The frontend development server will typically run on
http://localhost:5173
(or as configured by Vite).
You can start multiple services with a single command.
-
macOS interactive script (recommended):
./scripts/quick-start-local.sh
Menu options:
-
- Start MongoDB version (current)
-
- Start with Firestore emulator (testing)
-
- Start both (for migration testing)
-
- Stop all services
-
- Check service status
-
- Run Firestore tests only
-
-
Using npm scripts:
-
Start frontend and backend together (ensure MongoDB is running separately):
# Start MongoDB container (in another terminal) cd server && docker-compose up -d mongo && cd .. # Then, from project root npm run dev:all
-
Start Firestore emulator + backend + frontend together:
npm run dev:firestore # With automatic error monitoring and fixing agent (recommended) npm run dev:monitored
-
Stop all related processes and free ports:
npm run stop:all
-
Clear Firestore emulator data (when using dev:firestore):
# From server directory cd server && npm run firestore:clear # Or from project root with confirmation prompt ./scripts/clear-firestore-data.sh
-
Service URLs:
- Frontend: http://localhost:5173
- Backend (MongoDB mode): http://localhost:5001
- Firestore Emulator UI (when using dev:firestore): http://localhost:4000
To create a new admin user, run the following command from the server
directory:
npm run create-admin --name <your_name> --email <your_email> --password <your_password>
Replace <your_name>
, <your_email>
, and <your_password>
with the desired credentials.
A default admin user has been created with the following credentials:
- Email:
[email protected]
- Password:
password
server/
: Contains the Node.js/Express backend.src/
: Backend source code (TypeScript).dist/
: Compiled JavaScript files for the backend.
src/
: Contains the React frontend application.components/
: Reusable React components.pages/
: React components for different application pages.contexts/
: React Context API for state management.services/
: API service calls.types/
: TypeScript type definitions.
public/
: Static assets for the frontend.index.html
: Main HTML file for the frontend.package.json
: Project dependencies and scripts for the frontend.server/package.json
: Project dependencies and scripts for the backend.tsconfig.json
,tsconfig.node.json
: TypeScript configuration files.vite.config.ts
: Vite configuration for the frontend.
(Optional: Add guidelines for contributing to the project)
(Optional: Add license information)