Every day we add new Livebook notebooks from Github.
Welcome to Notesclub!
Feel free to:
- Take an issue
- Propose a new issue
- Refactor existent code
- Add documentation Thanks!
To start your Phoenix server:
- Install dependencies with
mix deps.get
- Start the Postgres database with
docker-compose up
- Create and migrate your database with
mix ecto.setup
- Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check our deployment guides.
To use tests with the :github_api
tag, and to interact with the GitHub API the project requires a GitHub API key.
Create a config/test_secrets.exs
template file.
Replace GITHUB_API_KEY with a GitHub API Key.
# Create a secret.exs file with the following content.
# Replace GITHUB_API_KEY with your github api key.
import Config
config :notesclub, :github_api_key, "GITHUB_API_KEY"
To use GitHub API in development, create a similar config/dev_secrets.exs
seeds.exs
already imports some example notebooks so you don't need to download notebooks from GitHub for most things.
Yet, to download new notebooks you can set GITHUB_API_KEY
as explained above and run:
%{page: 1}
|> Notesclub.Workers.RecentNotebooksWorker.new()
|> Oban.insert()
And to reload all notebooks already present in your db:
%{}
|> Notesclub.Workers.AllUserNotebooksSyncWorker.new()
|> Oban.insert()
To set up this functionality during development, follow these steps to create a GitHub OAuth application:
-
Log in to GitHub: Sign in to your GitHub account.
-
Navigate to Settings: Click on your profile picture in the top right corner, then select "Settings."
-
Access Developer Settings: Scroll down to the bottom of the left sidebar and click on "Developer settings."
-
Create an OAuth App: Under "OAuth Apps," click on "New OAuth App."
-
Fill in Details:
- Application Name: Provide a descriptive name for your app.
- Homepage URL: Enter the URL where users can learn more about your app.
- Authorization callback URL: This is the URL where GitHub will redirect users after they authorize your app. For local development, you can use
http://localhost:YOUR_PORT/auth/github/callback
.
-
Generate Client ID and Client Secret:
- Once you've filled in the details, click "Register application."
- You'll receive a Client ID and a Client Secret. These are essential for authenticating with GitHub.
-
Replace Variables in Your Code:
- Create a
config/dev_secrets.exs
file and replaceGITHUB_OAUTH_CLIENT_ID
andGITHUB_OAUTH_CLIENT_SECRET
with the actual values you received from GitHub:
- Create a
# Create a dev_secrets.exs file with the following content.
# Replace GITHUB_API_KEY with your github api key.
import Config
config :ueberauth, Ueberauth.Strategy.Github.OAuth,
client_id: "GITHUB_OAUTH_CLIENT_ID",
client_secret: "GITHUB_OAUTH_CLIENT_SECRET"