This repository contains the code for the UTD Office of Sustainability Water Bottle Counter EPICS project. The website
folder contains the API, database, and web front end. The microcontroller
folder contains the code used with a microcontroller as the interface between the water fountains and the web server (API).
The Water Bottle Counter works to retrieve data from arduinos retrofitted into water fountains around campus and provides a variety of different functions for interacting with the data that was retrieved.
The UTD Office of Sustainability Water Bottle Counter tracks the number of plastic bottles saved by using campus refill stations. It integrates microcontroller units and a web application to gather, store, and display this data.
This project aims to encourage sustainability efforts by promoting awareness of water conservation through the visual impact of bottle-saving metrics.
- Bottle Refill Tracking: Tracks the number of water bottles saved at each fountain.
- Data Visualization: Displays bottle-saving data for all tracked fountains on an interactive map.
- Fountain Management:
- Create: Add new fountains to the system with a user-defined starting count.
- Read: View bottle-saving statistics.
- Update: Rename fountains and update their configurations.
- Delete: Remove fountains via the admin panel.
- Framework: Next.js
- Styling: TailwindCSS (or other UI libraries if specified)
- Map Integration: MapTiler API for displaying refill stations.
- Framework: Next.js (combined backend and frontend framework)
- Database: SQLite (via Prisma ORM)
- Environment Management:
.env
file for API keys and configuration.
- Postman: API testing.
- Docker: Database containerization (if used).
- GitHub: Source code management and collaboration.
Follow these steps to set up and run the project locally:
- Install Node.js.
- Install Docker (if using Docker for the database).
- Clone the repository:
git clone https://github.com/UTDallasEPICS/utd-oos-bottle-counter.git
- Navigate to the project directory:
cd utd-oos-bottle-counter
- Rename
.env.example
to.env
:mv .env.example .env
- Open
.env
and update theMAPTILER_API_KEY
with your MapTiler API key:This is required for the map to function.MAPTILER_API_KEY=your_maptiler_api_key_here
- Navigate to the
website
folder:cd website
- Install the dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:3000 to view the application.
utd-oos-bottle-counter/
├── microcontroller/ # Arduino code for tracking refill data
├── website/ # Full-stack web application
│ ├── api/ # Backend logic (e.g., API routes)
│ ├── prisma/ # Prisma database schema and migrations
│ ├── public/ # Static assets
│ └── pages/ # Next.js pages (frontend)
├── .env.example # Example environment configuration
├── README.md # Project documentation
.env.example
: Contains placeholder environment variables likeMAPTILER_API_KEY
.schema.prisma
: Defines the database schema.Map/Page.tsx
: Additional resources and updates.
- View bottle-saving statistics on an interactive map.
- Access aggregated data for all tracked fountains.
- Add, rename, or delete fountains.
- Configure dipswitch settings for each fountain's microcontroller.
This project is licensed under the MIT License. See the LICENSE
file for details.
Special thanks to the UTD Office of Sustainability and EPICS team for their collaboration and support.