Mu2Mi welcomes contributions from the community. There are many ways to get involved!
You might find things that can be improved while you are using Mu2Mi. You can help by submitting an issue when:
- Mu2Mi crashes, or you encounter a bug that can only be resolved by refreshing the browser.
- An error occurs that is unrecoverable, causes data integrity problems or loss, or generally prevents you from using Mu2Mi.
- A new feature or an enhancement to an existing feature will improve the utility or usability of Mu2Mi.
Before creating a new issue, please confirm that an existing issue doesn't already exist.
You can engage with the community by:
- Helping other users on Discord.
- Improving documentation
- Participating in general discussions about open source, music, and AI
- Authoring new Mu2Mi features
You can contribute to Mu2Mi by:
- Enhancing current functionality
- Fixing bugs
- Adding new features and capabilities
Before starting your contribution, especially for core features, I encourage you to reach out to me on Discord. This allows me to ensure that your proposed feature aligns with the project's roadmap and goals. Developers are the key to making Mu2Mi the best tool it can be, and I value input from the community.
I look forward to working with you to improve Mu2Mi.
Follow the following steps to ensure your contribution goes smoothly.
- Fork the repository to your GitHub account.
- Clone the forked repository to your local machine.
- Create a new branch for your feature or bug fix.
- Commit your changes to your branch.
- Push your changes to your fork on GitHub.
- Create a pull request to the main repository.
- Wait for the maintainers to review your pull request.
- Make any necessary changes to your pull request.
- Once your pull request is approved, it will be merged into the main repository.
- Celebrate your contribution to Mu2Mi!
- Node.js v21.6.1
- Docker
- Docker Compose
Mu2Mi is built with Next.js, PostgreSQL, Minio, and Redis. The development environment is orchestrated with Docker Compose. To set up your development environment:
- Have the required dependencies installed on your machine and the repository cloned.
- Create a
.env
file in the root directory of the project. Use the.env.example
file as a template and fill out the values required. The.env.example
file has some default values that you can use. Rate limiting, captcha, email, and analytics are disabled by default in development. You can view the environment variable schema to see which are required for booting up the Next.js server.
cp .env.example .env
- Run
make up
to start the development environment. Quick tip: TheMakefile
andcompose.yaml
files are used to manage the development environment and contain other useful commands. - Run
npm i
to install the project dependencies. - Run
npm run dev
to start the development server. - Visit
http://localhost:3000
in your browser to view the application. - Run
make down
to stop the development environment. - (Optional) Run
make clean
to remove all persistent Docker volumes and images.
To test out track processing functionality that uses Replicate service, you will need to have Replicate API token and webhook secret, which can be generated in your Replicate account settings, configured as environment variables in your .env
file. And you will also need to set up tunnels using either ngrok or localtunnel. The two tunnels needed should be set up for the following ports:
- 3000 (Next.js)
- 9000 (Minio)
Once the tunnels are set up, update these variables in your .env
:
PROTOCOL
tohttps
HOST
to the Next.js tunnel URLAPP_PORT
to443
forhttps
connectionS3_ENDPOINT
to the Minio tunnel URLS3_PORT
to443
forhttps
connectionS3_USE_SSL
totrue
forhttps
connection
You may also need to restart the Next.js server to apply the changes.
Exported functions in the src/models
directory are ready to be consumed in Route Handlers, Server Actions, and Server Components. They act as a data access layer and interact with the database.
Server Components get their data from queries in queries.ts
files, re-export queries from actions.ts
to get them inside the 'use server'
boundary, which enables the use of useQuery
and useMutation
hooks in Client Components. Route Handlers should be wrapped with withErrorHandling
in the error module to handle errors.
Server Actions in actions.ts
files. Server Actions should be wrapped with either action
or authAction
in the safe-action module to handle errors and add the current user and session to the context.