This is the backend for the DamStudy project. DamStudy is a study room finder for Oregon State University (OSU) students. The backend is written in Go and uses the MongoDB driver for Go, Websockets, and a RESTful API with the go-chi router.
- Air
- Go
- Docker
- Docker Compose
- MongoDB Atlas (if not using Docker)
- Create a free account on MongoDB Atlas
- Join the GDSC organization on MongoDB Atlas
- Add the URI to the
internal/database/database.gofile - Run
make buildto build the application - Run
make runto start the application - Navigate to
http://localhost:8080in your browser
- Clone the repository
- Run
make docker-runto start the MongoDB container - Run
make buildto build the application - Run
make runto start the application - Navigate to
http://localhost:8080in your browser
init.jsis a script that will run when the MongoDB container is started. It will create thedamstudydatabase and theroomscollection.- Additionally, it "seeds" the database with some initial data.
- The
internal/database/database.gofile contains the connection to the MongoDB database. The URI is set as an environment variable. - You can use the
make watchcommand to live reload the application when changes are made.
If you're still stuck, message @nyumat on the GDSC Discord server for help
| Command | Description |
|---|---|
make all build |
Run all make commands with clean tests |
make build |
Build the application |
make run |
Run the application |
make docker-run |
Create DB container |
make docker-down |
Shutdown DB container |
make watch |
Live reload the application |
make test |
Run the test suite |
make clean |
Clean up binary from the last build |
make help |
Show help message |
make docker-clean |
Clean up docker containers |
(Coming soon)
(Coming soon)
This project is licensed under the MIT License - see the LICENSE file for details.