first commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# Todo Back
|
||||
|
||||
Todo Back is a deliberately small Rails JSON API packaged as a native StartOS 0.4 service. Its purpose is to validate the complete local-build → `.s9pk` → sideload workflow before investing in a larger application.
|
||||
|
||||
## API
|
||||
|
||||
- `GET /up` — Rails and PostgreSQL health check
|
||||
- `GET /todos` — list todos
|
||||
- `GET /todos/:id` — fetch one todo
|
||||
- `POST /todos` — create with `{ "todo": { "title": "...", "completed": false } }`
|
||||
- `PATCH /todos/:id` — update title and/or completion state
|
||||
- `DELETE /todos/:id` — delete a todo
|
||||
|
||||
## Architecture
|
||||
|
||||
The package builds the Rails application from the root `Dockerfile` and runs PostgreSQL 17 as a second StartOS subcontainer. PostgreSQL data, Rails local storage, and generated secrets are persisted in separate StartOS volumes. On every start, PostgreSQL becomes healthy, `bin/rails db:prepare` runs, and then Puma starts on port 3000. StartOS publishes that port as an API interface and terminates TLS.
|
||||
|
||||
`SECRET_KEY_BASE` and the database password are generated during installation and stored in the backed-up config volume. Backups use the SDK PostgreSQL dump integration and also include config and local storage.
|
||||
|
||||
## Development
|
||||
|
||||
Install application dependencies and run tests:
|
||||
|
||||
```sh
|
||||
bundle install
|
||||
bin/rails db:prepare
|
||||
bin/rails test
|
||||
```
|
||||
|
||||
Build the x86_64 sideload package from inside a StartOS packaging workspace:
|
||||
|
||||
```sh
|
||||
npm install
|
||||
make x86
|
||||
```
|
||||
|
||||
The resulting `todo-back_x86_64.s9pk` can be uploaded from StartOS under **System → Sideload Service**.
|
||||
|
||||
## Status
|
||||
|
||||
This is an unauthenticated MVP intended for sideload testing on a trusted network. Add authentication before exposing its interface beyond trusted gateways.
|
||||
Reference in New Issue
Block a user