Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogMeUp API

This is the backend API for the LogMeUp application, built with Go and PostgreSQL.

Prerequisites

  • Go 1.21 or later
  • PostgreSQL 14 or later
  • golang-migrate CLI tool

Setup

  1. Create a PostgreSQL database:
CREATE DATABASE logmeup;
  1. Copy the .env.example file to .env and update the values:
cp .env.example .env
  1. Run database migrations:
migrate -path migrations -database "postgresql://postgres:postgres@localhost:5432/logmeup?sslmode=disable" up
  1. Install dependencies:
go mod tidy
  1. Run the application:
go run cmd/api/main.go

API Endpoints

Notes

  • POST /api/notes - Create a new note
  • GET /api/notes/:id - Get a note by ID
  • GET /api/notes?date=YYYY-MM-DD - Get notes by date
  • PUT /api/notes/:id - Update a note
  • DELETE /api/notes/:id - Delete a note

Actions

  • POST /api/actions - Create a new action
  • GET /api/actions/:id - Get an action by ID
  • GET /api/actions/note/:note_id - Get actions by note ID
  • PUT /api/actions/:id - Update an action
  • DELETE /api/actions/:id - Delete an action

Development

To run the application in development mode with hot reload:

go install github.com/cosmtrek/air@latest
air

Testing

Run the tests:

go test ./...

About

logmeup backend and api service

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages