backend

command module
v0.0.0-...-381a539 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

README

Food-Tinder Backend

This folder contains the backend code for Food-Tinder. API documentation is at ./openapi.

Running

The backend can run without any database server. It does this by using an existing JSON file containing the initial state of the database, and all further writes will be stored in memory until the program exits.

To run the backend, you'll need Go 1.17 or later. Run the command:

go run .

within the ./backend (this) directory. If not, point DB_ADDRESS to the right ./dataset/mockdb.json.

By default, the process listens to http://localhost:3001. To change this, see .env.

If mockdb.json is used, then the example login credentials are fortinayt:password.

Developing

It is recommended to develop the backend inside the supplied shell.nix environment. The environment contains the needed tools to generate the Go code in this repository.

To set this up, first follow the Install Nix instructions, then run nix-shell inside the project root directory.

To regenerate all Go files, use go generate ./....

To generate all Go and JS files, cd back to the project root directory and run ./generate.sh.

To run the backend with a proper PostgreSQL development instance, use sudo nixos-shell on the project root directory.

Resources

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
dataset
internal
api
api/oapi
Package oapi provides primitives to interact with the openapi HTTP API.
Package oapi provides primitives to interact with the openapi HTTP API.
store/inmemory
Package memory implements foodtinder.Server using on-memory maps.
Package memory implements foodtinder.Server using on-memory maps.

Jump to

Keyboard shortcuts

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