Skip to content
Public template

About

CST 438 Project 02 starter: proposal template, starter OpenAPI contract, issue/PR templates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CST 438 Project 02: API Template

Project prompt: https://github.com/CST-438-projects/cst438-docs/tree/main/projects/p2

Starter repo for Project 02. One person per team clicks Use this template → Create a new repository, names it after your API, and adds teammates as collaborators.

Replace this README with your own in Sprint 4. The prompt lists what it must contain.

What's in here

Path What it is When
docs/proposal.md Proposal template: pitch, resources, ER sketch, endpoints, choices, risks Thu 10/1
docs/openapi.yaml A complete example contract (workout tracker). Replace it with your API. Sprint 1
redocly.yaml Lint rules for the contract Sprint 1
.github/ISSUE_TEMPLATE/user_story.md Every new issue starts as a user story with acceptance criteria now
.github/pull_request_template.md Every PR starts with Closes # and a test checklist now
.gitignore Gradle, Android, IntelliJ, Node, and secrets (.env, keystores, local.properties) now

Where your code goes is up to you: an api/ and an android/ folder in this repo (monorepo), or a second repo for the Android app. Write it down in an ADR.

First 15 minutes

  • Add teammates: Settings → Collaborators
  • Protect main: Settings → Rules → Rulesets → New branch ruleset. Target the default branch, require a PR with 2 approvals (1 for a team of 3), block force pushes. Enforcement: Active.
  • Create milestones Sprint 1 through Sprint 4: Issues → Milestones
  • Create a Project board (Kanban) and link it: Projects tab → Link a project
  • Start docs/proposal.md on a branch:
git switch -c docs/proposal
# edit docs/proposal.md
git add docs/proposal.md
git commit -m "Draft proposal"
git push -u origin docs/proposal
gh pr create --fill

Working with the contract

No installs needed beyond Node (npx runs the tools).

# Lint: fix every error before you open a PR
npx @redocly/cli lint docs/openapi.yaml

# Mock server: a fake API built from the contract, at http://127.0.0.1:4010
npx @stoplight/prism-cli mock docs/openapi.yaml

curl -H "Authorization: Bearer x" "http://127.0.0.1:4010/api/v1/workouts?page=0&size=20"
curl -i http://127.0.0.1:4010/api/v1/workouts          # 401: no token
curl -H "Authorization: Bearer x" -H "Prefer: code=404" \
     http://127.0.0.1:4010/api/v1/workouts/42          # force an error response

The mock validates your requests and returns the example: values from the contract. Nothing is saved: a POST followed by a GET returns the example, not what you posted. The Android emulator reaches it at http://10.0.2.2:4010.

To see the contract rendered, paste docs/openapi.yaml into https://editor.swagger.io.

Links

About

CST 438 Project 02 starter: proposal template, starter OpenAPI contract, issue/PR templates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors