1 | [![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea)
|
2 | [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)
|
3 |
|
4 | # [![Alinea CMS logo](https://github.com/alineacms/alinea/raw/HEAD/apps/web/public/logo.svg)](https://alinea.sh)
|
5 |
|
6 | Alinea is a modern content management system.
|
7 |
|
8 | - Content is stored in flat files and committed to your repository
|
9 | - Content is easily queryable through an in-memory SQLite database
|
10 | - Content is fully typed
|
11 |
|
12 | ## Get started
|
13 |
|
14 | Install alinea in your project directory
|
15 |
|
16 | ```sh
|
17 | npm install alinea
|
18 | ```
|
19 |
|
20 | Initialize alinea's config file
|
21 |
|
22 | ```sh
|
23 | npx alinea init --next
|
24 | ```
|
25 |
|
26 | Open the dashboard to have a look around
|
27 |
|
28 | ```sh
|
29 | npx alinea dev
|
30 | ```
|
31 |
|
32 | [Start configuring types and fields →](https://alinea.sh/docs/configuration)
|
33 |
|
34 | ## Configure
|
35 |
|
36 | Configure alinea in `cms.tsx`
|
37 |
|
38 | ```tsx
|
39 | const BlogPost = alinea.type('Blog post', {
|
40 | title: alinea.text('Blog entry title'),
|
41 | body: alinea.richText('Body text')
|
42 | })
|
43 | ```
|
44 |
|
45 | [Type options and fields →](https://alinea.sh/docs/configuration)
|
46 |
|
47 | ## Query
|
48 |
|
49 | Retrieve content fully-typed and filter, order, limit and join as needed.
|
50 | Select only the fields you need.
|
51 |
|
52 | ```tsx
|
53 | import {cms} from '@/cms'
|
54 |
|
55 | console.log(
|
56 | await cms.find(
|
57 | BlogPost()
|
58 | .where(BlogPost.author.is('Me'))
|
59 | .select({title: BlogPost.title})
|
60 | )
|
61 | )
|
62 | ```
|
63 |
|
64 | [See the full api →](https://alinea.sh/docs/content/query)
|
65 |
|
66 | Content is available during static site generation and when server side querying.
|
67 | Content is bundled with your code and can be queried with zero network overhead.
|
68 |
|
69 | [How alinea bundles content →](https://alinea.sh/docs/content)
|
70 |
|
71 | ## Deploy anywhere
|
72 |
|
73 | Alinea supports custom backends that can be hosted as a simple Node.js process or on serverless runtimes.
|
74 |
|
75 | [Setup your backend →](https://alinea.sh/docs/deploy)
|
76 |
|
77 | ## How to contribute to this project
|
78 |
|
79 | Have a question or an idea? Found a bug? Read how to [contribute](contributing.md).
|