printsmith_api
Version, currently main branch1 version
- main branchlatestMay 10, 2026
github.com/adamlwalker/printsmith_api
3rd party Printsmith API written in crystal.
Installation
# Add this to your shard.yml
dependencies:
printsmith_api:
github: adamlwalker/printsmith_api
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- Author
- Generated
Dependencies
Runtime Dependencies
README
PrintSmith API (Lucky)
This repository contains a Lucky (Crystal) application scaffold and developer tooling to implement the PrintSmith Vision API described in spec.json.
Overview
- Lucky-based HTTP API scaffold (src/)
- PostgreSQL migrations (db/migrations/)
- Generator to create controller skeletons from spec.json (scripts/generate_from_swagger.cr)
- Seed helper for API user (scripts/seed_api_user.cr)
- Dockerfile and docker-compose.yml for a Linux build target and a dev Postgres service
Defaults
- DB: postgres://printsmith:printsmith@db/printsmith (docker-compose)
- App port: 3000
- Seeded API user (dev): username=apiadmin password=printsmith
- Token TTL: 24 hours
Usage (dev)
-
Build and start services docker-compose build docker-compose up -d
-
(If not auto-run) Run migrations inside the app container docker-compose exec app ./bin/migrate
-
Seed API user (if not auto-seeded) docker-compose exec app ./bin/seed_api_user --username apiadmin --password printsmith
-
Example: create token curl -X POST http://localhost:3000/api/v1/token
-H "Content-Type: application/json"
-d '{"apiUserName":"apiadmin","apiUserPassword":"printsmith"}'
Notes
- This is a scaffold and generator output. The Lucky app files are present as skeletons and the prioritized endpoints (token/account/contact/invoice/estimate) include initial implementations. The remainder of the swagger surface is generated as not-implemented skeletons.
Listing endpoints
- The full OpenAPI/Swagger spec is available at spec.json. A helper module at src/actions/api/v1/spec_endpoints.cr can list endpoints programmatically.
- Generated skeleton handlers are available in src/actions/api/v1/generated_skeletons.cr and expose operationId-based stubs that return 501 Not Implemented. These are ready to be wired into real HTTP routes.
Local server
- The project has been converted to a Lucky-compatible app. Lucky routing macros and Action classes are generated under src/actions/api/v1/.
- To build and run you need Crystal and Lucky available in the build environment (the Dockerfile installs Crystal in the builder stage and builds the app binary).
Build steps (dev): docker-compose build docker-compose up -d
Then test endpoints, e.g. POST /api/v1/token as shown above.
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- May 10, 2026
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/adamlwalker/printsmith_api
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 17, 2026
- Synced
- Sep 17, 2026
- Versions
- 1