Nekometrics is an OpenSource project that allows you to centralize all your metrics and KPIs in one place, with pretty but powerful dashboards.
- Node.js (<= 16.20.2)
- Yarn (used for dependency management)
- MongoDB: A MongoDB instance must be running and accessible. Set the connection string in the
DATABASE_URL
environment variable. - SMTP Email Service: An SMTP email service such as Mailgun is required for sending emails. Configure the email server settings in your env (e.g.
.env.local
) file:EMAIL_SERVER_HOST
EMAIL_SERVER_PORT
EMAIL_SERVER_USER
EMAIL_SERVER_PASSWORD
EMAIL_FROM
git clone https://github.com/your-repo/nekometrics.git
cd nekometrics
Since yarn.lock
is present, use yarn
to install all necessary dependencies.
yarn install
Create a env (here, .env.local
) file in the root directory by copying .env
and configuring the required values.
cp .env .env.local
Edit the env file with your environment configurations (e.g., MongoDB connection details, API keys).
To run the application in development mode on port 4002:
yarn dev
This section outlines the necessary steps to register and configure various services. Each service requires specific settings and credentials, which may vary based on your development or production environment.
The following instructions are tailored for development mode with the .env.local
file. Please ensure to adjust any values (e.g., localhost) as necessary.
If you have already an app, skip to 2.
- Go to the Developer Portal.
- Create a new app from the "+Add App."
- Set the "App name" you would like.
- Copy "API Key" and "API Key Secret". Use these keys after.
- Go to "App Settings"
- Click "Set up" in your App Settings's "User authentication settings" section. If you have already set up, click "Edit."
- Configure with the following settings:
- App permission: Read
- Type of App: Web App, Automated App or Bot
- App info
- Callback URI / Redirect URL:
http://localhost:4002/oauth/twitter
- Website URL: any
- Callback URI / Redirect URL:
Set the Consumer Keys, "API Key" and "API Key Secret" obtained in step 1, to "TWITTER_CLIENT_ID" and "TWITTER_CLIENT_SECRET" respectively in the .env.local
file.
TWITTER_CLIENT_ID={API Key}
TWITTER_CLIENT_SECRET={API Key Secret}
- Go to the Google Cloud Console.
- Navigate to the "Library" section.
- Search for "Google Analytics Admin API".
- Click on the API and enable it for your project.
- In the Google Cloud Console, go to the "Credentials" section.
- Click on "+ Create Credentials" and select "OAuth 2.0 Client ID".
- Configure the OAuth client with the following settings:
- Application type: Web application
- Name: Input any name you prefer
- Authorized JavaScript origins:
http://localhost:4002
- Authorized redirect URIs:
http://localhost:4002/oauth/google
- Click "Create" to generate the credentials.
After creating the credentials, you'll see the "Client ID" and "Client Secret". Set these values to "GOOGLE_CLIENT_ID" and "GOOGLE_CLIENT_SECRET" respectively in the .env.local
file.
GOOGLE_CLIENT_ID={Client ID}
GOOGLE_CLIENT_SECRET={Client Secret}
- Go to the Apps page.
- Create a new app from the "Create App" button.
- In a creating flow, select the below:
- Use cases: Other
- App Types: Business
Once you create the app, you'll see the "App ID" and "App secret" on the basic page of the app settings. Set these values to "FACEBOOK_CLIENT_ID" and "FACEBOOK_CLIENT_SECRET" respectively in the .env.local
file.
FACEBOOK_CLIENT_ID={App ID}
FACEBOOK_CLIENT_SECRET={App secret}
If your pages and your Instagram account didn't show in the data source (like Facebook (0 page, 0 instagram profile)
), you might need Business verification. Check the Verifications section in your App settings' basic page and follow the steps on that page.