This is the frontend webapp for WellPath, the Rainbow Devs Health Tracker application. For the backend app, that can be found at Rainbow-Devs/health-tracker-backend.
Please follow the guides in Notion for setting up your computer for web development. There are separate guides for macOS and Windows. Once your environment is set up, follow these steps to start work on this repository:
To get started, we need to install the dependent packages for running the frontend. This should only need to be done once.
corepack enable
corepack prepare pnpm@latest --activate
pnpm install
First, run the development server:
pnpm dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx
. The page
auto-updates as you edit the file.
This project uses
next/font
to
automatically optimize and load Inter, a custom Google Font.
There are two ways to create and run the Docker container image: building and
running manually with Docker or by creating a docker-compose.yml
file and
using Docker Compose to start the webapp.
For Docker Compose, this is a minimal configuration that will get you started:
services:
ht-frontend:
build:
context: .
dockerfile: Dockerfile
container_name: ht-frontend
image: rainbow-devs/ht-frontend
ports:
- "3000:3000"
From there, you can follow these steps to build and run the container image:
docker compose build --pull
docker compose up -d
Finally, when you're done, use this command to stop the container and remove the container image:
docker compose down
To run tests run pnpm test
.
Please write unit tests for components where applicable. Make the components as testable as possible by structuring them as presentational vs container components.
Testing will ensure that our code is maintainable in the future.
To learn more about Next.js, take a look at the following resources:
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The mock server provides a simulated backend for various API endpoints in your Next.js project. It allows you to develop and test different functionality without the need for a real backend server.
GET
/api/users
POST
/api/users
PUT
/api/users/:id
GET
/api/activities
POST
/api/activities
PUT
/api/activities/:id
GET
/api/goals
POST
/api/goals
PUT
/api/goals/:id
GET
/api/reminders
POST
/api/reminders
PUT
/api/reminders/:id
To interact with the mock server, make HTTP requests to the appropriate endpoints using your preferred method (e.g., fetch, axios, etc.). Pass any required request parameters or data in the request body and handle the response accordingly.
Please refer to the specific endpoint details mentioned above for the expected request method, endpoint URL, request body format, and response format.
mockServer.js
file is included in your project's root directory.npm install
.npm run mock
.http://localhost:8000
.