ACM at CSUF club API for managing events, announcements, forms, and other services! Keep reading for information on setting up this project locally, and see the contributor guide and docs/ for more information on using and contributing to this project.
This project requires that you have Go, sqlc, GNU Make, and optionally Air installed. We highly recommend using the provided Nix development environment instead of installing everything manually.
-
Install nix and direnv if you don't already have them
-
Run
direnv allowat the project root
If you don't have direnv, you can also use
nix developto enter the dev shell, but your environment variables won't get sourced automatically.
Using make will compile both the API and CLI binaries, located at
bin/acmcsuf-api and bin/acmcsuf-cli respectively. If you installed direnv, both of these binaries will be automatically added to your path. You can run them directly like:
acmcsuf-api # Run API server
acmcsuf-cli # Start CLI client (start API server before using)We use a program called air, which recompiles the api server on the fly so you don't have to rebuild the server when you make changes.
air
# OR
make runAfter starting the server, you need to apply the database migrations in order to create the database schema.
make migrate-upThe API server is configurable via environment variables. See .env.example for values you can override and configure in your .env file.
The CLI is a simple command-line client for the API server. Make sure the API server is running before using.
Output of acmcsuf-cli --help:
A CLI tool to help manage the API of the CSUF ACM website
Usage:
acmcsuf-cli [command]
Available Commands:
announcements Manage ACM CSUF's Announcements
completion Generate the autocompletion script for the specified shell
events A command to manage events.
help Help about any command
officers A command to manage officers.
Flags:
-h, --help help for acmcsuf-cli
-v, --version version for acmcsuf-cli
Use "acmcsuf-cli [command] --help" for more information about a command.
The CLI's auth-related configuration is currently handled via environemnt variables similarly to the API. Other settings can be configured by modifiying the config file, located at ~/.config/acmcsuf-cli/config.json.
make all # Format and generate code + build both binaries
make generate # Regenerate Swagger docs and sqlc models
make check # Run checks
make fix-sql # Format and fix SQL files
make clean # Removes all build artifacts
make help # Display all targetsDeveloped with 💚 by @acmcsufoss