Skip to content

Commit

Permalink
Merge pull request #112 from pvdthings/dev
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
dillonfagan authored Jan 27, 2025
2 parents eb823e2 + 556b8cb commit 3046c1c
Show file tree
Hide file tree
Showing 72 changed files with 538 additions and 1,640 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Launch
.vscode
17 changes: 0 additions & 17 deletions apps/api/Dockerfile

This file was deleted.

13 changes: 2 additions & 11 deletions apps/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ AIRTABLE_KEY=[value]
AIRTABLE_BASE_ID=[value]

SUPABASE_URL=[value]
SUPABASE_PUB_ANON_KEY=[value]

// Determines which Discord accounts are allowed to authenticate with the API
DISCORD_WHITELIST="alice@email.com bob@email.com"
SUPABASE_PUBLIC_KEY=[value]

// Determines which users can access admin features
ADMIN_WHITELIST="alice@email.com"
Expand All @@ -33,10 +30,4 @@ UPDATE_DUE_DATES_WEBHOOK_URL=[value]
npm run install // on first run
npm run start
```
The server will start on port `8088`.

When running locally, no authentication is needed for the `lending` API. In production environments, these endpoints require tokens provided by Supabase Authentication (via Discord).

### Documentation

**Swagger Docs** are hosted at [http://localhost:8088/docs]().
The server will start on port `8088`.
42 changes: 1 addition & 41 deletions apps/api/apps/catalog/routes/things.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ const router = express.Router();
const { getCatalogData } = require('../services/catalog');
const { getThingDetails } = require('../services/thingDetails');
const { getItemDetails } = require('../services/itemDetails');
const { enroll, getShifts } = require('../services/shifts');
const { findMember } = require('../../../services/borrowers');

router.get('/', async (req, res) => {
router.get('/catalog', async (req, res) => {
try {
res.send(await getCatalogData());
} catch (error) {
Expand Down Expand Up @@ -35,42 +33,4 @@ router.get('/items/:id', async (req, res) => {
}
});

router.get('/volunteer/shifts', async (req, res) => {
const email = req.headers['x-email'];
try {
res.send(await getShifts({ email }));
} catch (error) {
console.error(error);
res.status(error.status || 500).send({ errors: [error] });
}
});

router.post('/volunteer/auth', async (req, res) => {
const { email } = req.body;
try {
const member = await findMember({ email });

if (member) {
res.send(member);
} else {
res.sendStatus(403);
}
} catch (error) {
console.error(error);
res.status(error.status || 500).send({ errors: [error] });
}
});

router.post('/volunteer/shifts/enroll', async (req, res) => {
const email = req.headers['x-email'];
const { shifts } = req.body;
try {
await enroll(email, shifts);
res.sendStatus(204);
} catch (error) {
console.error(error);
res.status(error.status || 500).send({ errors: [error] });
}
});

module.exports = router;
59 changes: 0 additions & 59 deletions apps/api/apps/catalog/services/shifts.js

This file was deleted.

13 changes: 0 additions & 13 deletions apps/api/compose.yml

This file was deleted.

9 changes: 0 additions & 9 deletions apps/api/docs/auth/paths/check.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions apps/api/docs/catalog/paths/things.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions apps/api/docs/catalog/schemas/thing.yaml

This file was deleted.

38 changes: 0 additions & 38 deletions apps/api/docs/librarian/paths/borrowers.yaml

This file was deleted.

57 changes: 0 additions & 57 deletions apps/api/docs/librarian/paths/inventory.yaml

This file was deleted.

Loading

0 comments on commit 3046c1c

Please sign in to comment.