Monorepo with a serverless API and a React UI:
api/: AWS SAM + Lambda + DynamoDB backendui/: Vite + React + Tailwind frontenddocs/: API, architecture, deployment, and testing docs
.
├── api/
│ ├── src/
│ ├── tests/
│ ├── template.yaml
│ ├── samconfig.toml
│ └── package.json
├── ui/
│ ├── src/
│ ├── .env.example
│ └── package.json
├── docs/
├── Makefile
└── README.md
- Install dependencies for both projects and create
ui/.env:
make bootstrap- Set backend URL for UI (if needed):
# ui/.env
KRAWLER_API_BASE_URL=http://127.0.0.1:3000- Run both API + UI locally:
make dev- API:
http://127.0.0.1:3000 - UI:
http://127.0.0.1:5173
make dev-api # only SAM local API
make dev-ui # only UI dev server
make test # API unit tests
make test-e2e # API E2E tests (requires E2E_BASE_URL)
make build # API + UI build
make clean # remove local build artifactsE2E example:
E2E_BASE_URL="https://<api-domain>" make test-e2eImplemented backend endpoints:
POST /linksGET /{shortCode}PATCH /links/{shortCode}GET /links/{shortCode}GET /links/{shortCode}/statsGET /links/{shortCode}/stats/dailyDELETE /links/{shortCode}