Skip to content

octet-stream/eri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eri

Minimalistic open source blog engine.

This project built with React Router, Hono, Mikro ORM, Better Auth, Tailwind CSS and shadcn/ui.

Database schema setup

As the project is currently in prototyping stage, the only way to create database schema is to run pnpm mikro-orm-esm schema:update -r command. This approach will be replaced with migrations.

Environment variables

Eri automatically picks up .env files from one of this souces: .env.<mode>.local, .env.<mode>, .env.local, .env (where mode is the value of the process.env.NODE_ENV). If none of these exists, then Eri will fallback to process.env object.

Development setup

There's two ways to set up the project for local development: You can either install dependencies manually on your machine, or you can use Devcontainers

Devenv (Nix)

Before you begin, you'll need to install Nix and devenv following their instructions. Optionally you can install direnv

  1. Activate shell either via:
    • Direnv: direnv allow
    • Devenv: devenv shell
  2. Start MariaDB server: devenv up - this will start services in the foreground. If you wish run services in the background, use -d flag like this: devenv up -d
  3. To start dev server, run following command: pnpm dev

If you wish to stop services, run devenv processes down

Devcontainers

You can run development environment in devcontainers using following steps:

  1. Install Devcontainers extension to your VSCode
  2. Once you've installed, you'll be prompted to "Reopen the folter in a container" or you can clone the repository in Docker volume for better I/O performance. If you're not prompted, then open command palette and choose "Dev Containers: Open Folder in Container" command.

This will setup Nix and start development shell with devenv.

Note that .devcontainers.json is generated by devenv, so don't update it directly.

Alternatively you can use Devcontainers CLI. For that you'll need:

  1. Install the CLI;
  2. Open the project's root in your terminal;
  3. Run the devcontainer up --workspace-folder . command. This will spin up a docker container for local development. Note that to install dependencies and run npm scripts (via pnpm) you'll need to use Devcontainer CLI.

Check out VSCode documentation to learn more: https://code.visualstudio.com/docs/devcontainers/containers

Manual setup

  1. First of all, you'll need to install MariaDB;
  2. Then clone this repository git clone [email protected]:octet-stream/eri.git;
  3. When it's done, install dependencies using pnpm install command;
  4. Create either .env.development.local or .env.local and add required configuration;
  5. Now you are able to run dev server. To do so, run pnpm dev command;
  6. Open http://localhost:5173/admin and create admin account (if it doesn't exists).

Production preview

  1. Create either .env.production.local or .env.local and add required configuration;
  2. To build the project, run pnpm build
  3. Once production build is finished, run pnpm start
  4. Open http://localhost:3000/admin and create admin account (if it doesn't exists).

Demo

You can run demo application with non-persistent database in just a few steps:

  1. Create .env.demo.local file and fill it with required parameters
  2. Run pnpm demo.start command
  3. Open http://localhost:3000/admin to create admin account

Note that the demo lives in-memory, so when use stop it via pnpm demo.stop command you'll loose the data from this demo.

Commands

List of available commands. These commands are accessible via pnpm.

Name Description
build Builds project for production
start Starts production server
dev Starts Vite in dev mode
dev.open Starts Vite in dev mode and opens app in user's default browser
demo.start Starts docker container with demo application. If you want to rebuild the app's image, run this command with --build flag
demo.stop Stops demo application and removed container
lint.types Runs tsc to validate TypeScript types

About

Minimalistic open source blog engine

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •  

Languages