Skip to content

dogy-app/backend-api

Repository files navigation

Logo

Dogy Backend API

Backend REST API service for Dogy app written in Rust.

Release Rust version Latest version Code Documentation API Documentation

Features

  • User Authentication with Clerk (JWT)
  • Uploading Assets (eg. pet images)
  • Fetching/Saving User & Pet Data
  • Management of AI Assistant Threads
  • Daily Challenges
  • Robust Error Handling
  • Detailed Logs
  • Type-safe Interaction with Database
  • Database Migration with sqlx
  • Automated CI/CD for Build & Release in Azure
  • OpenAPI Documentation
  • Code documentation with docs.rs

Usage

This is a REST API so it should work for any programming language with an HTTP client. I recommend trying the endpoint first in Postman or Insomnia. All the endpoints are documented using Scalar. You can find the documentation here. Do note that most of the endpoints in this API can only be accessed with JWT token, not just for security, but in order to also retrieve the current user's data. Some endpoints that dont require it are health checks so that Azure can ping it properly.

Due to the robust error handling in this API, all client errors must have a short self-explanatory error codes and a corresponding HTTP error code.

Architecture

The architecture involved in this backend follows the best practices for security, scaling, and performance. Here is the database schema with Postgresql Database with PostGIS and pg_uuidv7 extensions: db schema db schema 2

In addition, all Azure services follow the naming convention from Microsoft themselves. Here is how the cloud services is architectured: image

How to Contribute?

  1. Install rust toolchain (v1.86.0).
  2. Create .env file add the keys from .env.example.
  3. Build the project with cargo build or if you are in release mode, cargo build --release.
  4. Run the API with cargo run to start dev server. Be sure you have a docker image with PostGIS and pg_uuidv7 extension. The auth token will come from the JWT template in clerk dev mode. This is different from the production mode.

Do you have a question?

If you have any question or inquiry, feel free to email me or open an issue here. I'll be sure to respond and provide insights given your question.

About

Backend REST API for Dogy App.

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages