Scaffolding
scaffolding in Nova automates project bootstrapping. It provides:
- Multiple Layouts: Choose between Minimal or Structured template.
- Name-Aware Paths: Template filenames and directories can include
{{.Name}}to personalize paths. - Content Templating: File contents are processed as Go
text/template, with access to project metadata. - Database Adapter Injection: Select between
sqlite,postgres, ormysql; the correct Go import path is injected. - Verbose Mode: See directory- and file-creation logs for debugging.
Table of Contents
Getting Started
Have the Nova binary installed and in your $PATH, and then run:
nova new project-name
Follow the prompts to customize your project. This will create a project-name directory populated by your chosen template, with Go import paths and filenames adjusted to your project name.
Core Concepts
When you run nova new, Nova creates a new project directory based on a template. The options are:
- Minimal: A bare-bones project with a single
main.gofile. - Structured: A more complete project with a
main.gofile, acmddirectory, and adbdirectory.
When you select a template, you get the following options:
- Add a database, with the following options:
- sqlite: Use the
modernc.org/sqlitepackage. - postgres: Use the
github.com/lib/pqpackage. - mysql: Use the
github.com/go-sql-driver/mysqlpackage. - Add a
.envfile with the following environment variables when you select a database: DATABASE_URL: The database connection string.- Initialize a git repository.
- Add a
.gitignoreif you said yes to git - Add a Make file for making it easier to develop.