We really thank you for your interest in contributing to Meltcd!
This is a guide for you to get started with contributing to Meltcd. Please read it carefully before you start.
Before we start, here are the important links you should know:
Things you need on your local machine:
You should have
docker swarmup and running To startdocker swarmjust dodocker swarm initAfter this we are all done
Meltcd is a monorepo, which have three things in it:
-
Meltcd API Server in
serverdirectory, build with GoLang using Fiber framework. -
A CLI Client in
cmddirectory, build with GoLang using Cobra framework. -
A Web Client in
uidirectory, build with ReactJS.
The application is build as a CLI, where Server can be started using meltcd server command.
The server will server the API on http://localhost:1771/api and the web client on http://localhost:1771.
We highly recommend to use GNU Make to run the commands from the Makefile.
- Fork the repository
- Clone the repository
git clone https://github.com/your_username/meltcd- Change the directory
cd meltcd- Download frontend dependencies
pnpm --prefix ./ui install
pnpm --prefix ./ui build
# see the commands under `frontend` in `Makefile`, to use it without GNU Make- Download server / cli dependencies
go mod download
pnpm install # some npm packages are used like husky for pre-commit- Start the server
go run main.go server --verbose- Using CLI
go run main.go app ls- Using WEB Client
Open https://localhost:1771 in your browser.
To contribute to the server, work in the server directory. Save the changes and run the server using go run main.go server --verbose.
Server also embeds swagger spec and swagger ui which can be accessed at http://localhost:1771/swagger/index.html.
To update the swagger spec, run
swag init --output ./docs/swaggerSo every-time you need to update swagger spec and run the swerver you need to do
swag init --output ./docs/swagger
go run main.go server --verboseThe server will be running at post 1771 unless changed using environment variable, see the docs for more information.
The api will be served at http://localhost:1771/api.
To contribute to the web client, work in the ui directory. The vite app in the ui directory will be build to the server/static directory so that the API Server can serve it.
Go to ui directory and run:
pnpm run devTo start the development server. This will only start the frontend, so it will not be able to communicate with the server.
To start frontend with server, run:
make run
# or
pnpm --prefix build # you need to build the frontend first
go run main.go server --verboseSo to work on frontend, after changing the code, you need to build the frontend and start the server.
Deploying application: Head over to docs to see how to deploy the application.
To contribute to the CLI, work in the cmd directory. CLI is just cobra app which just do http request to the server.
You can run the CLI using
go run main.go app lsFor other CLI command see docs.
While the server is running, you can update the CLI code and test it.
To run tests, run:
make testMake sure you create a new branch before working on new feature or fixing a bug.
After you are done with the changes, create a pull request
Contributions are always welcome, no matter how large or small. If stuck, feel free to ask for help in the chat.
🚀