Contributing Guide
Relevant source files
The following files were used as context for generating this wiki page:This guide provides instructions for developers wishing to contribute to the Analog project. It covers everything from setting up the local development environment to submitting changes for review. The goal is to make the contribution process as simple and straightforward as possible.
All contributions are expected to adhere to the project's Code of Conduct. By contributing, you agree that your work will be licensed under the project's MIT License.
Code of Conduct
All members, contributors, and leaders pledge to maintain a harassment-free community experience for everyone. This applies to all community spaces and when an individual is officially representing the community.
Sources: CODE_OF_CONDUCT.md:3-13, 31-35
Our Standards
Behavior that contributes to a positive environment includes:
- Demonstrating empathy and kindness.
- Being respectful of differing opinions.
- Giving and gracefully accepting constructive feedback.
- Accepting responsibility for mistakes.
Unacceptable behavior includes:
- The use of sexualized language or imagery.
- Trolling, insulting comments, and personal or political attacks.
- Public or private harassment.
- Publishing others' private information without permission.
Sources: CODE_OF_CONDUCT.md:15-23, 25-30
Enforcement
Community leaders are responsible for enforcing these standards and will take appropriate corrective action. Instances of unacceptable behavior can be reported to jean@analoginterface.io. All complaints are reviewed promptly and fairly, and the privacy of the reporter is respected.
Sources: CODE_OF_CONDUCT.md:37-43, 45-48
The enforcement process follows a set of guidelines based on community impact.
This diagram shows the enforcement ladder for Code of Conduct violations.
Sources: CODE_OF_CONDUCT.md:53-91
Getting Started
To begin contributing, you need to set up the Analog project on your local machine.
Prerequisites
Ensure the following software is installed on your system:
- Bun: A fast JavaScript runtime, package manager, bundler, and test runner.
- Docker Desktop: For running the PostgreSQL database container.
Sources: README.md:17-22
Initial Setup and Configuration
This flow chart outlines the complete setup process from cloning the repository to running the application.
Sources: CONTRIBUTING.md, README.md
-
Fork and Clone the Repository
Fork the repository on GitHub, then clone your fork locally and add the original repository as an upstream remote.git clone https://github.com/YOUR-USERNAME/analog.git cd analog git remote add upstream https://github.com/jeanmeijer/analog.gitSources: CONTRIBUTING.md:7-16
-
Install Dependencies
Use Bun to install all project dependencies.bun installSources: CONTRIBUTING.md:19-22, README.md:29-32
-
Configure Environment Variables
Copy the example environment file and generate a secret key.cp .env.example .envOpen the
.envfile and setBETTER_AUTH_SECRETby running:openssl rand -hex 32Sources: CONTRIBUTING.md:25-32, README.md:35-42
The following table lists the key environment variables you need to configure in the
.envfile.
| Variable | Description | Source |
|---|---|---|
DATABASE_URL | The connection string for the PostgreSQL database. A default is provided. | README.md:38 |
BETTER_AUTH_URL | The URL for the authentication service. A default is provided. | README.md:38 |
BETTER_AUTH_SECRET | A secure secret for the authentication service. | README.md:41 |
GOOGLE_CLIENT_ID | Your Google OAuth application client ID. | README.md:46 |
GOOGLE_CLIENT_SECRET | Your Google OAuth application client secret. | README.md:46 |
MICROSOFT_CLIENT_ID | Your Microsoft OAuth application client ID (optional). | README.md:58 |
MICROSOFT_CLIENT_SECRET | Your Microsoft OAuth application client secret (optional). | README.md:58 |
GOOGLE_MAPS_API_KEY | Your Google Maps API key for the Places API. | README.md:70 |
OAuth and API Setup
Google OAuth Setup
- Create a project in the Google Cloud Console.
- Set up OAuth credentials following the Better Auth documentation.
- Enable the Google Calendar API.
- Add your email as a test user in the OAuth consent screen settings.
Sources: CONTRIBUTING.md:35-46, README.md:45-55
Microsoft OAuth Setup (Optional)
- Register a new application in the Microsoft Azure Portal under Microsoft Entra ID.
- Set the redirect URI to
http://localhost:3000/api/auth/callback/microsoft. - Create a new client secret and copy the Application (client) ID.
- Add the following delegated permissions for Microsoft Graph:
Calendars.Read,Calendars.ReadWrite,User.Read,offline_access.
Sources: CONTRIBUTING.md:49-59, README.md:57-67
Google Places API Setup
- In your Google Cloud project, enable the Places API (New).
- Create an API key from the Maps Platform Credentials page.
- Set this key as
GOOGLE_MAPS_API_KEYin your.envfile.
Sources: README.md:69-75
Database and Application Initialization
-
Start the Database
The project uses a PostgreSQL database run via Docker. Start the container using:bun run docker:upSources: README.md:80-84
-
Initialize the Database
Push the schema to the running database instance.bun run db:pushSources: CONTRIBUTING.md:62-64, README.md:88-91
-
Run the Development Server
Start the Next.js development server.bun run devThe application will be available at
http://localhost:3000.Sources: CONTRIBUTING.md:65-68, README.md:95-99
Key Scripts
The package.json file defines several scripts for common development tasks.
| Script | Description |
|---|---|
dev | Starts the Next.js development server with Turbopack on port 3000. |
build | Builds the application for production. |
start | Starts a production server. |
lint | Runs ESLint to check for code quality and style issues. |
type-check | Runs the TypeScript compiler to check for type errors. |
Sources: apps/web/package.json:5-11
Making Changes
Follow this workflow to create and submit your contributions.
This diagram illustrates the branching, committing, and pull request process.
Sources: CONTRIBUTING.md:72-93
Branching and Committing
- Create a new branch for your feature or fix:
git checkout -b feature/your-feature - Make your changes and test them locally.
- Commit your changes using Conventional Commit messages. This is important for versioning and changelogs.
git commit -m "feat: add new feature"
Sources: CONTRIBUTING.md:72-81
Keeping Your Fork Updated
Before submitting a pull request, ensure your branch is up-to-date with the latest changes from the main repository.
git fetch upstream
git merge upstream/main
Sources: CONTRIBUTING.md:83-86
Pull Request Process
- Push your feature branch to your fork on GitHub.
- From your fork's GitHub page, create a new Pull Request against the
mainbranch of the original Analog repository. - Provide a clear title and description of the changes you've made.
- Wait for a project maintainer to review your PR. Address any feedback or requested changes.
Sources: CONTRIBUTING.md:88-93
Licensing
By contributing to Analog, you agree that your contributions will be licensed under its MIT License. The project also utilizes some third-party libraries, such as qs, which are licensed under the BSD 3-Clause License. Your use of the Analog service is also governed by the Privacy Policy, which details data handling, especially for Google User Data, and adheres to the Google API Services User Data Policy.
Sources: CONTRIBUTING.md:99-100, packages/google-tasks/src/internal/qs/LICENSE.md, packages/google-calendar/src/internal/qs/LICENSE.md, apps/web/src/app/(legal)/privacy/page.tsx:103-109, 260-266