A modern web application for logging your daily activities with time tracking, built with React (TypeScript) and FastAPI (Python).
- ⏰ Time-based logging: Record activities with start and end times
- 📅 Date filtering: View logs for specific dates
- 🌙 Dark/Light theme: Toggle between themes with system default support
- 📱 Responsive design: Works seamlessly on desktop and mobile devices
- 🎨 Classic UI: Clean and intuitive interface
- ✅ CRUD operations: Create, view, and delete logs
- 🗃️ PostgreSQL database: Robust data storage
- React 18 with TypeScript
- React Router v6
- Axios for API calls
- CSS with CSS Variables for theming
- Font Awesome icons
- FastAPI (Python)
- Pydantic for data validation
Before you begin, ensure you have the following installed:
- Node.js (v14 or higher)
- Python (v3.8 or higher)
- npm or yarn
git clone <your-repo-url>
cd logcd backend
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtYou’ll need MongoDB credentials to connect your backend to the database.
- Go to MongoDB Atlas
- Create a free cluster (if you don’t already have one)
- In Database Access, create a new user with a secure password
- In Network Access, allow connections from your IP or
0.0.0.0/0 - Copy your connection string from
Database → Connect → Drivers
Create a .env file in the backend directory with the following content:
MONGO_USERNAME=example
MONGO_PASSWORD=example
MONGO_CLUSTER=example
MONGO_DBNAME=example
cd frontend
# Install dependencies
npm installIn the backend directory with virtual environment activated:
uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
In the frontend directory:
npm startThe application will open at http://localhost:3000
- View Logs: Navigate to the home page (
/) to see all your logged activities - Create Log: Click "New Log" button or go to
/createto add a new time-based entry - Filter by Date: Use the date picker in the header to filter logs
- Toggle Theme: Click the moon/sun icon to switch between light and dark modes
- Delete Log: Click the trash icon on any log card to delete it
GET /api/logs- Get all logs (optional?date=YYYY-MM-DDparameter)GET /api/logs/{id}- Get a specific log by IDPOST /api/logs- Create a new logPUT /api/logs/{id}- Update a logDELETE /api/logs/{id}- Delete a log
log/
├── backend/
│ ├── main.py # FastAPI application
│ ├── database.py # Database configuration
│ ├── models.py # SQLAlchemy models
│ ├── schemas.py # Pydantic schemas
│ ├── crud.py # CRUD operations
│ ├── requirements.txt # Python dependencies
│ └── .env # Environment variables
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── api/ # API client
│ │ ├── components/ # React components
│ │ ├── contexts/ # React contexts
│ │ ├── pages/ # Page components
│ │ └── App.tsx
│ └── package.json
└── README.md
The backend uses FastAPI with auto-reload enabled. The database schema is automatically created when the application starts.
The React app uses Create React App with TypeScript. Hot reloading is enabled by default.
cd backend
pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 8000cd frontend
npm run buildThe built files will be in the frontend/build directory.
MIT
Contributions are welcome! Please feel free to submit a Pull Request.