UpdateHub is a server application written in Go that manages device updates. It features a web interface for uploading updates, managing devices, and automated responses to device update requests. The project uses PostgreSQL for data storage and supports database migrations, unit testing, and automated CI/CD using GitHub Actions.
- Upload Updates: Seamlessly upload new software updates.
- Manage Devices: Add, remove, and manage devices.
- Automatic Updates: Devices receive the latest software versions automatically.
- Database Management: Track devices and their software versions.
- Go (version 1.22 or higher)
- Docker
- golang-migrate (for database migrations)
- sqlc (for database interaction)
-
Clone the repository:
git clone https://github.com/AmirhoseinMasoumi/UpdateHub.git cd UpdateHub
-
Start the PostgreSQL database using Docker:
make postgres
-
Create the database:
make createdb
-
Run database migrations:
make migrateup
-
Generate SQL code:
make sqlc
-
Run the server:
make server
- postgres: Start PostgreSQL in a Docker container.
- createdb: Create the database.
- dropdb: Drop the database.
- migrateup: Apply all up migrations.
- migrateup1: Apply the next up migration.
- migratedown: Apply all down migrations.
- migratedown1: Apply the next down migration.
- new_migration: Create a new migration file.
- sqlc: Generate Go code from SQL schema.
- mock: Generate mock implementations for tests.
- server: Run the server.
- test: Run unit tests.
This project uses GitHub Actions for continuous integration. The workflow file is located in .github/workflows
.
- Checkout Code: Uses
actions/checkout@v4
to checkout the code. - Set up Go: Uses
actions/setup-go@v4
to set up the Go environment. - Install golang-migrate: Installs the migration tool.
- Run Migrations: Applies database migrations.
- Run Tests: Executes unit tests.
Contributions are welcome! Please fork the repository and create a pull request. For major changes, open an issue to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/YourFeature
) - Open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.