vectra

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 5 Imported by: 0

README

Banner

GoDoc Go Report Card

🎯 Overview

The main goal of the project is to create a versatile multi-language template and toolkit for website servers and backend systems. It strives to achieve this by integrating the best existing technologies, resulting in an efficient and fast server experience. The goal is to minimize the complexity of development as much as possible. Ultimately, Vectra's goal is to leverage the unique design of each technology to achieve specific goals without investing excessive time and effort.

By combining these technologies (Go, Pug, Sass, Badger, ...), Vectra offers a robust and streamlined development environment. It reduces the need for complex setups and integrations, allowing you to focus on building the core functionality and design of your website.

⚡️ Features

  • Code generation

    • Controllers (view and service routes)
    • Types (storage, ajax, view)
    • Service (defines interface)
  • MVC architecture

  • Pipeline for Sass and Pug: All in one docker with needed tools

  • Web framework integrated: Fiber

    • Separation for static and main app
    • Middlewares configured (log, compression, cache, csrf, ...)
  • Data validation with Validator and Mold

  • KV helper, FluentKV, for BadgerDB

  • Connection system

    • First connection mechanism
    • User and roles
  • JS helpers

    • Ajax
    • Form data scrap
    • Svg sprite loader
    • Components
  • Integrated i18n system

🚀 Getting started

Prerequisite

  • Docker
  • Go SDK (or build and run in Docker)

Install Vectra

If you are Go SDK, install with go command:

go install github.com/Phosmachina/vectra@latest

Deploy

  • This command permits writing a default config:

    vectra -p path/YourProject init
    
  • Edit the configuration, YourProject/.vectra/project.yml, as your convenience.

  • Run vectra for a full generation:

    vectra -p path/YourProject gen
    
  • Launch watcher: the first time it might take some time because of container creation and image download:

    vectra -p path/YourProject watch
    

If you want to re-edit the configuration, maybe after that run a partial generation like this to avoid file overwriting:

vectra -p path/YourProject -s types,controlers,services gen

Run

Now you can open the folder path/YourProject, which Vectra created as a project with your IDE.

You need to make sure that the *.pug files are correctly transpiled to Go (there are transpiled to src/view/go/). Currently, with the file watchers, you need to make a change to the files to trigger it.

After that, you can start your application. This can be done manually by executing the following command (in the root directory of the project):

go run app.go

🤝 Contributing

Your contributions are always valued and appreciated!

Thank you in advance for making this project even better. I'm excited to see your contributions!

🕘 What's next

Improving and expanding this project is my perpetual goal. Here's an insight into what I plan next:

Shortly

  • pack and run vectra command: Provide an easy way to build the application, assemble it in a folder with all into a folder with all the necessary files. Run the pack command and run the executable.
  • Improve Pug Watcher: Currently there are some drawbacks: some files are compiled, but they shouldn't and vice versa (about layout and pug files that don't have a page in the in general).
  • Add dynamic rebuilding for dev: Like air.

Planned

  • Sprite Generator (img): It would be nice if you could just put img in into a folder and have the sprite generated automatically with js helper to use it.
  • Component architecture: Make a system to permit designing atomic component composed by a view, client and server logic and a configuration.

Under consideration

  • RBAC, ACL robust system: Replace the current system with a robust and proven system like Casbin. This integration should help to deal with complex access management. Could be also an update for my project FluentKV.
  • Default components: Incorporate a set of default components into the project. This will help in establishing a consistent UI/UX throughout and will also save time and effort in design and development.

I value your ideas, contributions, and feedback. Stay tuned for the next steps on this exciting journey!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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