You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/README.md

141 lines
2.4 KiB
Markdown

8 years ago
# asciinema
13 years ago
8 years ago
FIXME: description
8 years ago
## Developing
11 years ago
8 years ago
### Setup
13 years ago
8 years ago
When you first clone this repository, run:
13 years ago
8 years ago
```sh
lein setup
```
9 years ago
8 years ago
This will create files for local configuration, and prep your system
for the project.
8 years ago
### Environment
8 years ago
To begin developing, start with a REPL.
8 years ago
```sh
lein repl
```
8 years ago
Then load the development environment.
8 years ago
```clojure
user=> (dev)
:loaded
```
12 years ago
8 years ago
Run `go` to initiate and start the system.
13 years ago
8 years ago
```clojure
dev=> (go)
:started
```
13 years ago
8 years ago
By default this creates a web server at <http://localhost:3000>.
12 years ago
8 years ago
When you make changes to your source files, use `reset` to reload any
modified files and reset the server.
12 years ago
8 years ago
```clojure
dev=> (reset)
:reloading (...)
:resumed
```
13 years ago
8 years ago
### Testing
13 years ago
8 years ago
Testing is fastest through the REPL, as you avoid environment startup
time.
8 years ago
```clojure
dev=> (test)
...
```
12 years ago
8 years ago
But you can also run tests through Leiningen.
13 years ago
8 years ago
```sh
lein test
```
13 years ago
8 years ago
### Migrations
13 years ago
8 years ago
Migrations are handled by [ragtime][]. Migration files are stored in
the `resources/migrations` directory, and are applied in alphanumeric
order.
12 years ago
8 years ago
To update the database to the latest migration, open the REPL and run:
13 years ago
8 years ago
```clojure
dev=> (migrate)
Applying 20150815144312-create-users
Applying 20150815145033-create-posts
```
13 years ago
8 years ago
To rollback the last migration, run:
13 years ago
8 years ago
```clojure
dev=> (rollback)
Rolling back 20150815145033-create-posts
```
13 years ago
8 years ago
Note that the system needs to be setup with `(init)` or `(go)` before
migrations can be applied.
13 years ago
8 years ago
[ragtime]: https://github.com/weavejester/ragtime
### Generators
This project has several generator functions to help you create files.
To create a new endpoint:
```clojure
dev=> (gen/endpoint "bar")
Creating file src/foo/endpoint/bar.clj
Creating file test/foo/endpoint/bar_test.clj
Creating directory resources/foo/endpoint/bar
nil
```
11 years ago
8 years ago
To create a new component:
11 years ago
8 years ago
```clojure
dev=> (gen/component "baz")
Creating file src/foo/component/baz.clj
Creating file test/foo/component/baz_test.clj
nil
```
To create a new boundary:
11 years ago
8 years ago
```clojure
dev=> (gen/boundary "quz" foo.component.baz.Baz)
Creating file src/foo/boundary/quz.clj
Creating file test/foo/boundary/quz_test.clj
nil
```
13 years ago
8 years ago
To create a new SQL migration:
8 years ago
```clojure
dev=> (gen/sql-migration "create-users")
Creating file resources/foo/migrations/20160519143643-create-users.up.sql
Creating file resources/foo/migrations/20160519143643-create-users.down.sql
nil
```
8 years ago
## Deploying
13 years ago
8 years ago
FIXME: steps to deploy
11 years ago
8 years ago
## Legal
11 years ago
8 years ago
Copyright © 2017 FIXME