Skip to content

Official REST API backend for Spendaro written in Typescript using Fastify

Notifications You must be signed in to change notification settings

TannerBarcelos/spendaro-api

Repository files navigation

Spendaro API

Welcome to the Spendaro API! This is the backend service for the Spendaro finance application, which helps users budget using the "Give Every Dollar a Job" methodology.

Table of Contents

Introduction

The Spendaro API is a RESTful service designed to manage financial data for the Spendaro application. It allows users to create budgets, track expenses, and allocate funds to specific categories.

Features

  • User authentication and authorization
  • Budget creation and management
  • Expense tracking
  • Category management
  • Reporting and analytics

Note

The API adheres to the OpenAPI Specification, automatically generating documentation that is rendered using Scalar for an interactive, user-friendly experience. Go to http://localhost:8010/docs and you will be able to understand all the APIs and how to consume them.

Getting Started

To get started with the Spendaro API, follow these steps:

  1. Clone the repository:

    git clone https://github.com/tannerbarcelos/spendaro-api.git
  2. Navigate to the project directory:

    cd spendaro-api
  3. Install dependencies:

    pnpm install
  4. Set up environment variables: Create a .env file in the root of the project and add the following environment variables:

      NODE_ENV=
      DB_HOST=
      DB_USER=
      DB_PASSWORD=
      DB_NAME=
      JWT_SECRET= <generate using `openssl rand -base64 32`>
      COOKIE_SECRET= <generate using `openssl rand -base64 32`>

    Note: Replace the values with your own database connection details.

    • You can use a local database or a cloud-hosted database like Supabase.
    • If you're using Supabase, you can find your database connection details in the "Settings" tab of your Supabase project.
    • Docker support is coming soon so this can be automated
  5. Setup the database for local development

Note

Make sure you have the following completed:

  • environment variables set up
  • database connection details are correct
  • database is running (locally or cloud-hosted - just make sure the connection details are correct)
  • make utility is installed (if not, you can install it using npm install -g make-cli)
make setup-db

This will generate a migration script in the migrations folder, run the migration against the database, and seed the database with some initial data.

  1. Start the server:
    pnpm dev
  2. Test the API: Import the Postman collection into Postman to test the API endpoints and explore the available features.

Docker support is coming soon!

API Endpoints

You can head to the api documentation to understand all the APIs and how to consume them.

Run the server and navigate to http://localhost:8010/docs to view the API documentation. (Make sure the server is running before you access the documentation.)

You can also import the Postman collection into Postman to test the API endpoints and explore the available features.

WIP: Deployment of API documentation to a public URL.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Official REST API backend for Spendaro written in Typescript using Fastify

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages