The simple way to build habits that last.
- Clone or download the repository.
- Open terminal and navigate to
habit-tracker
folder (repository root directory) - For the server and database dev environments run
bash _script/startDev.sh
- Navigate to
client
folder and runnpm install
to install dependencies for the client
- Open terminal and navigate to
client
folder and runnpm run dev
- In the browser, go to
http://localhost:8080/
for the client. - To make requests directly to the server, use api root
http://localhost:3000/
- Open Terminal and navigate to the repository root directory
- To stop the containers run
bash _script/stop.sh
- For a complete teardown run
bash _script/teardown.sh
- Clone or download the repo
- Open terminal and navigate to
habit-tracker
folder - Navigate to the server folder and run
npm install
to install dependencies - Navigate to the client folder and run
npm install
to install dependencies
bash _scripts/startDev.sh
- starts server & db services
- runs db migrations
- seeds db for development
- serves to localhost:3000
bash _scripts/startTest.sh
- starts server & db services
- runs db migrations
- triggers full test run
bash _scripts/teardown.sh
- stop all running services
- removes containers
- removes volumes
Do not run both dev and test environment at the same time!
Client
- HTML
- CSS
- JavaScript
- NPM
Server
Database
Route name | Path | Method | Purpose |
---|---|---|---|
create | /auth/register |
POST |
Register a new account |
update | /auth/login |
POST |
Login to an account |
update | /auth/:email/password |
PATCH |
Update account password |
show | /user/:email |
GET |
Get user info |
update | /user/:email |
PATCH /PUT |
Update user name |
show | /user/:email/habit |
GET |
Get all users' habits |
create | /user/:email/habit/ |
POST |
Add a new habit |
show | /user/:email/habit/:id |
GET |
Get a single habit by id |
destroy | /user/:email/habit/:id |
DELETE |
Delete a single habit by id |
create | /user/:email/habit/:id/complete |
POST |
Add a habit completion instance |
destroy | /user/:email/habit/:id/complete/:completionId |
DELETE |
Delete a habit completion instance |
- Does not authenticate user token ownership
- Leaderboards
- More habit infographics
- Edit existing habits