Skip to content

marekzelinka/habit-tracker-api

Repository files navigation

Habit Tracker API

Overview

This project is a REST API backend server for a habit tracking application, that implements the core features like user auth, creating habits with tags, and completion logs.

Goals

The goal of this project was to learn Drizzle ORM while creating a habit tracking backend API.

Upcoming work

  • implement rate limiting to prevent abuse
  • endpoints that return lists should support pagination via ?page=2&limit=20
  • add support for getting habit stats like current streak

Tech Stack

Get started

Setup

Clone this repoository from GitHub:

git clone https://github.com/marekzelinka/habit-tracker-api/ && cd habit-tracker-api

Install deps using pnpm:

Important

You'll need to have Node LTS installed. You'll need to have pnpm installed.

pnpm install

Database setup

  1. Go to https://neon.new/
  2. Create new database in the browser and copy the DATABASE_URL
  3. Paste as DATABASE_URL in your .env file

First run

Copying the contents of the .env.exmaple file into a new .env file and fill in the required environment variables.

Paste the copied DATABASE_URL in your new .env file.

Push the application database schema to your new database:

pnpm db:push

(Optional step) Seed your database with dummy data:

pnpm db:seed

Credits

About

REST API backend for habit tracking app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published