https://github.com/lissy93/cso
🍩 Chief Snack Officer - A platform for requesting, voting and managing office snacks
https://github.com/lissy93/cso
Last synced: about 1 year ago
JSON representation
🍩 Chief Snack Officer - A platform for requesting, voting and managing office snacks
- Host: GitHub
- URL: https://github.com/lissy93/cso
- Owner: Lissy93
- License: mit
- Created: 2023-11-29T16:46:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-04T20:52:44.000Z (over 2 years ago)
- Last Synced: 2025-04-07T08:33:14.049Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 1020 KB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Chief Snack Officer
Office snack requests, like never before!
> I built this in order to learn (the basics) of how to use Solid.js
> And because for work, my job is to order in office snacks, and sending out surveys is boring.
Contents
- [About](#about)
- [Deployment](#deployment)
- [Config Options](#config-options)
- [Data Structures](#data-structures)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
## About
A platform for real-time requesting and voting on snacks for the office.
So that the fridge is always well stocked with food people actually love.
### Features
- View current, upcoming and past snack orders
- Request snacks
- Vote (up/down) on snacks
- View stats, like most loved, hated, controversial snacks
- SSO login, with access restricted by email domain
- Admin portal, where snack inventory can be managed
### Screenshots
https://github.com/Lissy93/cso/assets/1862727/a3fd8f11-3156-4c1e-8124-771ce2d872f2
Screenshot
### Info
Tech Stack[[1]](https://www.solidjs.com/) on the frontend (along with TS [[2]](https://www.typescriptlang.org/) and SCSS [[3]](https://sass-lang.com/)), tested with Jest [[4]](https://jestjs.io/), bundled with Vite [[5]](https://vitejs.dev/). The data is stored using a Postgress [[6]](https://www.postgresql.org/) DB via Supabase [[7]](https://supabase.com/), with the frontend deployed to Netlify [[8]](https://www.netlify.com/) and the code hosted on GitHub [[9]](https://github.com) and CI/CD workflows managed with GH Actions[[10]](https://docs.github.com/en/actions).
Standards
Future plans
---
## Deployment
To deploy the app, follow the [development instructions](#development) to get the code + dependencies, then run `yarn build` to build the production app, and use a web server of your choice to serve up the `/dist` directory.
You'll also need to deploy a Postgres DB, it's recommended to use Supabase. For setup instructions, see the [Data](#data-structures) section below.
The frontend can also be deployed to a static hosting provider of your choice. You can use the 1-click deploys below for Netlify or Vercel.
[](https://app.netlify.com/start/deploy?repository=https://github.com/lissy93/cso)
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FLissy93%2Fcso&env=VITE_SUPABASE_URL,VITE_SUPABASE_ANON_KEY&envDescription=Login%20%2F%20create%20a%20Supabase%20account%2C%20then%20navigate%20to%20Settings%20--%3E%20API%20copy%20the%20URL%20and%20Anon%20API%20key%20&project-name=cso&repository-name=cso-fork)
Docker image coming soon...
## Config Options
## Data Structures

#### Snacks
```sql
create table
public."Snacks" (
snack_id uuid not null default gen_random_uuid (),
snack_name character varying not null,
user_id uuid null,
created_at timestamp with time zone not null default now(),
snack_category public.snack_category null,
snack_meta json null,
constraint Snacks2_pkey primary key (snack_id),
constraint Snacks2_snack_name_key unique (snack_name),
constraint Snacks_user_id_fkey foreign key (user_id) references auth.users (id) on update cascade on delete set null
) tablespace pg_default;
```
#### Votes
```sql
create table
public."Votes" (
vote_id bigint generated by default as identity,
created_at timestamp with time zone not null default now(),
snack_id uuid null,
user_id uuid null,
vote public.vote_type not null,
constraint Votes_pkey primary key (vote_id),
constraint Votes_snack_id_fkey foreign key (snack_id) references "Snacks" (snack_id),
constraint Votes_user_id_fkey foreign key (user_id) references auth.users (id)
) tablespace pg_default;
```
#### Enums
```
snack_category: sweet, savory, healthy, drink
vote_type: up, down
```
## Development
- `git clone git@github.com:Lissy93/cso.git && cd cso` - Grab the code
- `yarn install` - Install dependencies
- `cp .env.sample .env` - Then paste your Supabase URL and anon key
- `yarn dev` - Start the dev server. Then pop open [`localhost:5173`](http://localhost:5173)
You'll also need to create a Supabase project, and run the import script listed in [above](#data-structures).
## Contributing
Contributions of any kind are very welcome, and would be much appreciated.
For Code of Conduct, see [Contributor Convent](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
To get started, fork the repo, follow the [development](#development) steps above, add, commit and push the code, then come back here to open a pull request. If you're new to GitHub or open source, I have some guides in [Lissy93/git-into-open-source](https://github.com/Lissy93/git-into-open-source/) which might help - but feel free to ask if you need any help.
## License
> _**[Lissy93/CSO](https://github.com/Lissy93/cso)** is licensed under [MIT](https://github.com/Lissy93/cso/blob/HEAD/LICENSE) © [Alicia Sykes](https://aliciasykes.com) 2023._
> For information, see TLDR Legal > MIT
Expand License
```
The MIT License (MIT)
Copyright (c) Alicia Sykes
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sub-license, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included install
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
© Alicia Sykes 2023
Licensed under MIT

Thanks for visiting :)