This is a small Elixir proof of concept for building a simple blog that manages articles stored in a Notion database. The app fetches data from a configured Notion database and serves it via a basic web interface.
For further improvements, consider adding authentication, pagination, or an enhanced frontend. Happy coding! 🚀
This project requires the following dependencies:
defp deps do
[
{:httpoison, "~> 2.0"},
{:jason, "~> 1.4"},
{:plug_cowboy, "~> 2.0"}
]
end
Ensure these dependencies are installed before running the application.
Before starting the app, you need to set up the required configuration values. These are managed in config/config.exs
:
import Config
config :notion_blog,
notion_api_url: "NOTION_API_URL",
notion_api_token: "NOTION_API_TOKEN",
notion_api_version: "NOTION_API_VERSION",
notion_articles_database_id: "NOTION_ARTICLES_DATABASE_ID"
To retrieve and manage articles, you need a Notion API integration. Follow the official Notion API documentation to:
- Create a Notion integration and get an API token
- Share the database with your integration
- Obtain the database ID for your articles
Once you have these values, replace the placeholders in config/config.exs
with your actual credentials.
Follow these steps to set up and run the application:
- Clone the repository:
git clone <repository-url>
cd notion_blog
-
Set up the required configuration variables in
config/config.exs
. -
Install dependencies:
mix deps.get
- Start the application:
iex -S mix
- Open your browser and visit:
http://localhost:4040
To run the test suite, execute the following command:
mix test
This project is licensed under the MIT License. See the LICENSE file for more details.