$ freted
uses Docker and Git to manage environments for local development of distributed systems. It works like a dependency manager (like Composer and npm) to resolve dependencies and start all on your local machine.
- Docker
- Node
- Oclif
- TypeScript
- Traefik
To use freted
you need the following dependencies installed in your machine:
- Docker
- Git
- Node >= 10
To start using freted
, follow those steps:
$ npm install -g freted
$ freted login
Enter the service name as an argument to the start
command. The service name is the URL of the repository without the protocol.
For example, for the repository https://github.com/myorg/myproject
the name is github.com/myorg/myproject
.
If the repository don't exists locally, freted
will clone in your workspace if you granted your credentials using $ freted login
.
If you are working on a new project and it doesn't have a repository yet, freted
will try to resolve the local directory within your workspace.
$ freted start github.com/myorg/myproject
This command will resolve and start the project and all it's dependencies and print a resume of all services.
To allow a project to be run with freted
, create a file on the root of your project named freted.yml
with the following content:
name: github.com/myorg/myproject
description: My awesome project
You can find a full example of a config file on the repository at here.
You can define the commands to setup, start and stop your services.
- setup: will be run when you start the service for the first time.
- start: will be run when you start the service.
- stop: will be run when you stop the service.
setup:
- docker-compose build
start:
- docker-compose up -d
stop:
- docker-compose down
freted
is also a dependency manager. If you have a service (like a SPA) that depends on another (like an API), you can declare this dependency on freted.yml
:
dependencies:
- github.com/myorg/myproject2
optionalDependencies:
- github.com/myorg/myproject3
You can use the freted.yml
to put default credentials and quick notes for the developers. Those instructions will be shown on the terminal after the application starts.
instructions:
- Sign-in using one of the credentials provided.
credentials:
- name: Active user
description: User active on the app
email: [email protected]
password: mysecretpass
freted
uses Traefik to facilitate the organization and communication between all services. The Traefik container is automatically managed by freted
.
If your service can be accessed through HTTP, edit the freted.yml
and add the following config:
routes:
- host: myproject.myorg.local
backend: docker
destination: mycontainer_app
port: 80
The field destination
must be the name of the running container. With docker compose, set the field container_name
on the service and use the same name here.
$ npm install -g freted
$ freted COMMAND
running command...
$ freted (-v|--version|version)
freted/0.2.4 darwin-x64 node-v12.17.0
$ freted --help [COMMAND]
USAGE
$ freted COMMAND
...
freted configure
freted help [COMMAND]
freted inspect SERVICE
freted login
freted logs
freted restart SERVICE
freted start SERVICE
freted stop SERVICE
configure freted
USAGE
$ freted configure
EXAMPLE
$ freted configure
See code: src/commands/configure.ts
display help for freted
USAGE
$ freted help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
inspect a service
USAGE
$ freted inspect SERVICE
ARGUMENTS
SERVICE name of the service
EXAMPLE
$ freted inspect github.com/myorg/myproject
See code: src/commands/inspect.ts
authenticate to supported providers
USAGE
$ freted login
EXAMPLE
$ freted login
See code: src/commands/login.ts
show services logs
USAGE
$ freted logs
EXAMPLE
$ freted logs
See code: src/commands/logs.ts
restart a service
USAGE
$ freted restart SERVICE
ARGUMENTS
SERVICE name of the service to restart
EXAMPLE
$ freted restart github.com/myorg/myproject
See code: src/commands/restart.ts
start a service
USAGE
$ freted start SERVICE
ARGUMENTS
SERVICE name of the service to start
OPTIONS
--no-dependencies don't start service dependencies
--no-optional-dependencies don't start service optional dependencies
EXAMPLE
$ freted start github.com/myorg/myproject
See code: src/commands/start.ts
stop a service
USAGE
$ freted stop SERVICE
ARGUMENTS
SERVICE name of the service to stop
OPTIONS
--no-dependencies don't start service dependencies
--no-optional-dependencies don't start service optional dependencies
EXAMPLE
$ freted stop github.com/myorg/myproject
See code: src/commands/stop.ts