Skip to content

bongofriend/bongo-notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Personal Project for learning

This is a personal project for personal note taking written with a golang backend

Requirements

Run backend

make config_file_path=local.config.yaml run

Default user login

Username: admin

Pasword:: admin

Configuration

The backend requires configuration in a yaml file and its path is to be provided as an argument during start up. The configuration file follows the following structure:

includeSwagger: true #Enable swagger for endpoints
port: 8888 #Port for server
jwtSecret: SomeSecret #Secret for generating JWT
db:
  driver: sqlite3 #Database driver
  path: ./local.db #Location of sqlite3 database

Endpoint Definitions

For better developer experience, documenation is provided by an embedded swagger-ui server. The required swagger.json file is generated by running the make command above. For this, the swag package is required to be installed. The swagger-ui is enabled by default, but can be disabled with the includeSwagger flag in the configuration file.

The swagger-ui is accessable by following http:https://localhost:8888/swagger/index.html

Database Migrations

Database migrations are automaticly run after the server starts up. To create migrations, the goose package is required. To install the package, run:

go install github.com/pressly/goose/v3/cmd/goose@latest

After goose is installed, migrations can be created. To create one, navigate to the backend directory and execute the following command:

goose --dir ./migrations sqlite3 ./local.db create <migrations_name> sql

Migrations can be applied by running:

goose --dir ./migrations sqlite3 ./local.db up

Tearing down database migrations can be done by applying:

goose --dir ./migrations sqlite3 ./local.db down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published