Serverless APIs for www.analogstudios.net (and friends) using arc.codes.
Assumes valid AWS credentials are either exported as environment variables or you have a relevant configuration setup in ~/aws/credentials.
Additionally, the following credentials files are required to run this project for the various services and APIs exposed.
For running the various APIs using the Architect sandbox.
| Name | Service | Role |
|---|---|---|
AWS_ACCESS_KEY_ID |
AWS | Publish API |
AWS_SECRET_ACCESS_KEY |
AWS | Publish API |
AWS_CLOUDFRONT_ID |
AWS | Publish API |
CONTENTFUL_ACCESS_TOKEN |
Contentful | Events API |
CONTENTFUL_SPACE |
Contentful | Events API |
CONTENTFUL_WEBHOOK_ACCESS_TOKEN |
Contentful | Publish API |
DATABASE_URL |
Turso | All APIs except Events |
DATABASE_TOKEN |
Turso |
For running Prisma Studio.
| Name | Service | Role |
|---|---|---|
DATABASE_URL |
Local SQLite | All APIs except Events |
- Clone the repo
- Run
npm ci - Run
npm run arc env - Run
npm run prisma db push - Run
npm startto use the local Architect sandbox for development - Make a copy of .env.local and rename it to .env
To use Prisma Studio, run npm run studio
Data sourced from Turso for the Album resource type. Available at /api/albums locally and publicly as /api/albums.
Options:
?id=xxx- Filter by theidof the album?artistId=xxx- Filter by theidof an artist
You can only pass one or the other
Data sourced from Turso for the Artist resource type. Available at /api/artists locally and publicly as /api/artists.
Options:
?id=xxx- Filter by theidof the artist
Structured events content sourced from Contentful for the Event resource type. Available at /api/events locally and publicly as /api/events.
Options:
?id=xxx- Filter by theidof the event?tag=xxx- Filter by tags of the event
You can only pass one or the other
Data sourced from Turso for the Post resource type. Available at /api/posts locally and publicly as /api/posts.
Options:
?id=xxx- Filter by theidof a post
With the appropriate AWS environment variables in place (either locally exported, in GitHub Actions, or configured through Arc / AWS), the follow workflows are available and integrated into GitHub Actions
npm run deploy:sandbox- Build the project and test with Arc's local sandboxnpm run deploy:staging- Build and deploy for staging environment (runs on PRs)npm run deploy:production- Build and deploy for production environment (runs on merge into mainline)