This repository hosts the codebase for the DIMO Developer Console, powering the platform at https://console.dimo.org
. The app facilitates seamless interactions and management of developer licenses within the DIMO ecosystem.
These instructions will guide you on setting up the project locally.
Before you begin, ensure you have the following installed on your machine:
- Node.js (v20.x or later)
- npm or Yarn
- A Google Developer Account and GitHub Account for OAuth integration.
- Create a Google OAuth App:
- Go to the Google Developer Console.
- Create a new project (if you don’t already have one).
- Navigate to OAuth consent screen and configure it.
- Under Credentials, create an OAuth 2.0 Client ID.
- Add a Redirect URI: http://localhost:3000/api/auth/callback/google.
- Ensure the app has access to the People API:
- Go to Library and search for "People API".
- Enable the People API for your project.
- Note down your Client ID and Client Secret. These will be used in your environment variables.
- Create a GitHub OAuth App:
- Go to GitHub Developer Settings.
- Under OAuth Apps, click New OAuth App.
- Set the Authorization callback URL to http://localhost:3000/api/auth/callback/github. Under OAuth scopes, ensure the app requests access to email addresses in read-only mode.
- Note down your Client ID and Client Secret. These will be used in your environment variables.
- Clone the repository:
git clone git@github.com:DIMO-Network/dimo-developer-console.git
cd dimo-developer-console
- Set up environment variables:
- Create a .env.local file in the root directory of the project:
GITHUB_CLIENT_ID=<YOUR_GITHUB_CLIENT_ID>
GITHUB_CLIENT_SECRET=<YOUR_GITHUB_CLIENT_SECRET>
GOOGLE_CLIENT_ID=<YOUR_GOOGLE_CLIENT_ID>
GOOGLE_CLIENT_SECRET=<YOUR_GOOGLE_CLIENT_SECRET>
NEXTAUTH_SECRET=<YOUR_NEXTAUTH_SECRET>
NEXTAUTH_URL=http://localhost:3000/
- Install the dependencies:
npm install
# or
yarn install
Start the development server:
npm run dev
# or
yarn dev
To create an optimized production build:
npm run build
# or
yarn build
To start the production server:
npm run start
# or
yarn start
A brief description of the main folders and files in the project:
./src/app
: Contains all the application pages and API routes using the new App Router in Next.js../src/config
: Configuration filesdefault
is mainly used for the development environment and default values instaging
andprod
preview
is mainly used for changing variable values in the staging environment.production
is mainly used for changing variable values in the production environment.
./src/components
: Reusable React components used across the application./public
: Static files like images, fonts, etc./src/context
: React context providers and hooks for managing global state across the application../src/hoc
: Higher-Order Components (HOCs) that provide additional functionality to wrapped components../src/layouts
: Layout components that define the structure of different pages or sections of the application../src/services
: Contains the business logic of the application, interacting with the database, APIs, and other services../src/types
: TypeScript type definitions and interfaces used throughout the application../src/utils
: Utility functions and helper methods that are used across different parts of the application../src/actions
: Server-side methods that interact with external APIs or perform specific tasks in response to client requests.
- Next.js: A React framework for server-side rendering, static site generation, and more.
- React: A JavaScript library for building user interfaces.
- CSS/PostCSS: For styling components.
- JavaScript/ES6+: Modern JavaScript syntax and features.
We welcome contributions to this project! If you would like to contribute, please follow these steps:
-
Fork the repository on GitHub by clicking the "Fork" button at the top right of the repository page.
-
Clone your forked repository to your local machine:
git clone https://github.com/your-username/your-forked-repository.git
cd your-forked-repository
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
-
Make your changes in the codebase.
-
Commit your changes with a clear and concise commit message:
git commit -m "Add feature/fix: Describe your changes"
- Push your changes to your forked repository on GitHub:
git push origin feature/your-feature-name
- Open a Pull Request:
- Go to the original repository on GitHub.
- Click on the "Pull Requests" tab.
- Click the "New Pull Request" button.
- Select the branch you made your changes on and submit the Pull Request.
-
Describe your changes in the Pull Request. Provide as much detail as possible about what you’ve done and why.
-
Wait for a review from the maintainers. They may ask for changes or provide feedback.
-
Once your Pull Request is approved, it will be merged into the main branch.
Thank you for contributing to the project!