festivals-server

command module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: LGPL-3.0 Imports: 8 Imported by: 0

README

Festivals App Server

DevelopmentDeploymentFestivalsAPIArchitectureEngageLicensing

A live and lightweight go server app providing a simple RESTful API called FestivalsAPI using go-chi/chi and go-sql-driver/mysql.

Development

The developement of the FestivalsAPI and the festivals-server is heavily dependend on the festivals-api-ios as in my regular development workflow i first mock the needed behaviour in the API client library. After the behaviour works the way i need it to, i start implementing the changes in the festivals-server and after that in the festivals-database.

To test whether the festivals-server is working correctly i'm currently relying on downstream tests of the API framework.

Requirements

Structure

├── server
│   │
│   ├── server.go               // Server logic
│   │
│   ├── config
│   │   └── config.go           // Server configuration
│   │
│   ├── database               
│   │   ├── mysql.go            // Basic mysql queries (SELECT, INSERT, etc.)
│   │   └── querytools.go       // Some tools to create mysql query statements
│   │
│   ├── handler                
│   │   ├── artist.go           // APIs for the Artist model
│   │   ├── common.go           // Common handler functions
│   │   ├── event.go            // APIs for the Event model
│   │   ├── festival.go         // APIs for the Festival model
│   │   ├── location.go         // APIs for the Location model
│   │   ├── image.go            // APIs for the Image model
│   │   ├── link.go             // APIs for the Link model
│   │   ├── place.go            // APIs for the Place model
│   │   ├── response.go         // Send a response
│   │   ├── status.go           // Handling status server status requests
│   │   └── tag.go              // APIs for the Tag model
│   │
│   ├── model
│   │   └── model.go            // The object models for the handler
│   │
│   └── status
│       └── status.go           // API for the status of the application
│
└── main.go        

Deployment

Running the festivals-server is pretty easy because Go binaries are able to run without system dependencies on the target for which they are compiled. The only dependency is that the festivals-server expects either a config file at /etc/festivals-server.conf, the environment variables set or the template config file present in the directory it runs from.

Build and Run manually

cd /path/to/repository/festivals-server
make build
(make install)
make run

# Default API Endpoint : http://localhost:10439

VM deployment

The install, update and uninstall scripts should work with any system that uses systemd and firewalld. Additionally the scripts will somewhat work under macOS but won't configure the firewall or launch service.

Installing

curl -o install.sh https://raw.githubusercontent.com/Festivals-App/festivals-server/main/operation/install.sh
chmod +x install.sh
sudo ./install.sh

Updating

curl -o update.sh https://raw.githubusercontent.com/Festivals-App/festivals-server/main/operation/update.sh
chmod +x update.sh
sudo ./update.sh

Uninstalling

curl -o uninstall.sh https://raw.githubusercontent.com/Festivals-App/festivals-server/main/operation/uninstall.sh
chmod +x uninstall.sh
sudo ./uninstall.sh

To see if the server is running use:

sudo systemctl status festivals-server

Container deployment

TBA

FestivalsAPI

The FestivalsAPI is documented in detail here.

Architecture

The festivals-server is tightly coupled with the festivals-database which provides the persistent storage to the FestivalsAPI. To find out more about architecture and technical information see the ARCHITECTURE document.

The general documentation for the Festivals App is in the festivals-documentation repository. The documentation repository contains architecture information, general deployment documentation, templates and other helpful documents.

Engage

I welcome every contribution, whether it is a pull request or a fixed typo. The best place to discuss questions and suggestions regarding the festivals-server is the issues section. More general information and a good starting point if you want to get involved is the festival-documentation repository.

The following channels are available for discussions, feedback, and support requests:

Type Channel
General Discussion
Other Requests

Licensing

Copyright (c) 2017-2022 Simon Gaus.

Licensed under the GNU Lesser General Public License v3.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.html.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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