backend

command module
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: GPL-2.0 Imports: 7 Imported by: 0

README

Getting started :

Prerequisites
  • Mongo
    • Before running the web server or seeding, make sure to set the MongoDB credentials properly in config.yaml
  • Zitadel
    • Also make sure that a Zitadel instance is up and running, Zitadel is used for auth in the project.

    • Make sure to create a Zitadel api app inside your project and download the zitadel-key.json to a safe location

    • Make sure the domain, port and key path are set properly in config.yaml

      Note that Zitadel needs to be reachable using the same domain from the backend and the frontend, docker produced notable connection issues regarding the hostname, which requires additional settings like adding a reverse proxy to be able to reach it using the same hostname as from the browser.

Running the web server
  • Run go run . in the backend root directory to run the server
DB Seeding
  • Run go run . seed in the backend directory which will prompt for entities to seed.

    Warning quiting the prompt with ctrl+q or esc will run the seeding process, if you want to quit, just deselect all the entities

Documentation

Overview

Package main is the entrypoint for the nutrix application.

It sets up the config, logger, and userio, and then starts the main server.

The main server is a gorilla/mux router that hosts the core, auth, and other modules.

Directories

Path Synopsis
Package cmd handles the command-line interface and operations for the application.
Package cmd handles the command-line interface and operations for the application.
common
config
Package config implements the config interface for the viper config backend.
Package config implements the config interface for the viper config backend.
customerrors
Package customerrors contains custom error types and values.
Package customerrors contains custom error types and values.
logger
Package logger implements a logger that uses the zap library.
Package logger implements a logger that uses the zap library.
userio
Package userio provides an interface for user interaction prompts, and a bubbletea implementation of such an interface.
Package userio provides an interface for user interaction prompts, and a bubbletea implementation of such an interface.
Package modules is the package for managing the modules of the application.
Package modules is the package for managing the modules of the application.
auth
Package auth contains the authentication module which is responsible for authenticating and authorizing users on the endpoints.
Package auth contains the authentication module which is responsible for authenticating and authorizing users on the endpoints.
auth/middlewares
Package middlewares provides a set of middleware functions used to check Zitadel access token for auth and roles.
Package middlewares provides a set of middleware functions used to check Zitadel access token for auth and roles.
core
Package core contains the core module of the nutrix application.
Package core contains the core module of the nutrix application.
core/dto
Package dto contains structs for data transfer objects (DTOs) used in the core module of nutrix.
Package dto contains structs for data transfer objects (DTOs) used in the core module of nutrix.
core/handlers
Package handlers contains HTTP handlers for the core module of nutrix.
Package handlers contains HTTP handlers for the core module of nutrix.
core/middlewares
Package middlewares contains middleware functions for the web server.
Package middlewares contains middleware functions for the web server.
core/models
Package models contains the data models for the application.
Package models contains the data models for the application.
core/services
Package services contains the business logic of the core module of nutrix.
Package services contains the business logic of the core module of nutrix.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL