New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

accella

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

accella

A web framework built with Astro and Accel Record

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67
decreased by-17.28%
Maintainers
0
Weekly downloads
 
Created
Source

Language: English | 日本語

Accella

A web framework built with Astro and Accel Record.

Installation

npm create accella@latest my-accella-app

Getting Started

cd my-accella-app
npm run dev
open http://localhost:4321

Structure

Astro

Accella is built on top of the web framework Astro. Astro is a server-first framework that can flexibly integrate with frontend components like React and Vue.js.

Page routing is handled by Astro files located in the src/pages directory. Astro files have the .astro extension and can contain both HTML and JavaScript in a single file.

https://docs.astro.build/en/getting-started/

Accel Record

Accel Record is a type-safe and synchronous ORM for TypeScript. It adopts the Active Record pattern and is heavily influenced by Ruby on Rails' Active Record.

Accel Record is integrated into Accella from the start, allowing you to begin database-driven development immediately. By default, SQLite is used, but you can configure it to use MySQL or PostgreSQL.

Accel Record uses Prisma for migration management, and you can define your database settings and models in db/schema/main.prisma.

https://github.com/koyopro/accella/blob/main/packages/accel-record/README.md

Accel Web

Accel Web is a library that supports web application development with Astro, and it is also integrated into Accella. It provides features such as session management, request parameter parsing, and form creation.

https://github.com/koyopro/accella/blob/main/packages/accel-web/README.md

Request Parameters

Accella provides a Request Parameters object via Astro.locals.params to handle request parameters.

For usage details, refer to the Accel Web README.

Session

Accella provides a session management object via Astro.locals.session.

---
import { User } from '../models';

if (Astro.request.method === 'POST') {
  Astro.locals.session.user = User.findBy({ email: 'test@example.com' });
}
const currentUser: User | undefined = Astro.locals.session.user;
---
{currentUser ? <p>Hello, {currentUser.name}!</p> : <p>Hello, Guest!</p>}

By default, values retrieved from the session are of type any, but you can use type definitions in src/config/session.ts to ensure type safety.

import { type Session as BaseSession } from "accella/session";
import { User } from "../models";

// You can define the type of the session object here
export type SessionData = {
  user: User; // Add here
};

export type Session = BaseSession & Partial<SessionData>;

Keywords

FAQs

Package last updated on 03 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc