MyPerseverance is a productivity and self-growth tracker that helps users log their daily tasks, visualize their consistency using a heatmap calendar, and build better habits through small, repeatable actions. Inspired by apps like LeetCode and GitHub's contribution graph, it encourages users to stay accountable by tracking real progress—one step at a time.
This project is built with a modern, decoupled architecture and is fully containerized for easy setup and deployment.
This project uses Docker to create a consistent and easy-to-run development environment. The following steps will get a local copy of the entire full-stack application up and running.
To build and run this project, you will need the following tools installed on your system:
- Git
- Java Development Kit (JDK) (Version 21 is recommended)
- Docker Desktop (which includes Docker Compose)
Note: While the final application runs entirely within Docker containers, a JDK is required on your local machine to initially build the backend application (.jar file). Please ensure Docker Desktop is running on your machine before you proceed with the setup steps, as it is needed for the build and testing phase.
Follow these simple steps to set up and run the entire project.
-
Clone the Repo
git clone https://github.com/JunLongling/MyPerseverance.git cd MyPerseverance -
Configure Environment Variables This project uses separate
.envfiles for backend and frontend configuration. Example files are provided in the repository to make this easy.-
Backend Configuration: From the project root, run:
cp backend/env.template backend/.env
(Note: The default values in the example file are ready for local development. You do not need to change anything).
-
Frontend Configuration: From the project root, run:
cp frontend/env.template frontend/.env
(Note: This file tells the frontend where to find the backend API, which is pre-configured for this Docker setup).
-
-
Build the Backend Application This is a required one-time step. Make sure you have Docker installed and running on your system before proceeding. The backend will be containerized later, and the build process assumes Docker is available. The Docker build process needs the compiled Java application (the
.jarfile) to exist.Navigate into the
backenddirectory and run the Maven wrapper to build the project:cd backend ./mvnw clean package cd ..
(Note: You only need to re-run this command if you make changes to the backend's
pom.xmldependencies or want to create a new final build). -
Build and Run the Full Application with Docker Now, from the project root directory, you can start the entire application stack (frontend, backend, and database) with a single command.
docker-compose up --build
- This command might take a few minutes the first time you run it, as it needs to download the necessary base images and build your application.
--buildensures that fresh Docker images are created for the frontend and backend.
-
Access the Application Once the containers are up and running, your application will be available at:
- Frontend App: http://localhost:5173
- Backend API:
http://localhost:8080
- Hot-Reloading: This setup is configured for hot-reloading. Any changes you make to the frontend or backend source code will automatically be detected, and the relevant service will restart or refresh in your browser.
- Stopping the Application: To stop all running services, press
Ctrl + Cin the terminal wheredocker-composeis running. - Running in the Background: To run the services in the background (detached mode), use:
docker-compose up -d
- Viewing Logs: To view the logs from the running services (especially in detached mode), use:
docker-compose logs -f
- Stopping Detached Services:
docker-compose down
