You can use this repo to learn about Astro or to setup your website - it's completely free to use. I would also be grateful if you submit issues about bugs or your ideas about how to make it better!
- Styling:
TailwindwithdaisyUIand@iconify/tailwind - Code highlights:
expressive-code - Search:
pagefind - Utility UI-library:
preact - Databaase:
postgreswithsupabasehosting - ORM:
kyselywithPrismafor migrations - Deployment -
Vercel
/src is the main project directory. Everything outside is not related to the project content and what user sees, but rather configurations of database schema, plugins and so on.
-
/contentand/pagesfolders are reserved by Astro for content collections and serving pages./pages/apiis for serverless API routes. Currently used for retrieving and updating post data.
-
/componentsis a folder of folders for types of components divided by frameworks for easy search:/astro,/react. There's also/mdxfolder which I think is okay to use for any shared interactive blocks between the articles. Inside every folder there is flat a division by entity:/posts,/index,/navbar -
/dbis for Database initialization:pgpool,kyselyinstance. In/db/schema.tsis a generated file byprisma-kyselygenerator so there would be no need to map Prisma and kysely types. Also there are files likepost.tswith repositories to manipulate the database, so that API routes would not be as bloated. -
/layoutsis, well, for layouts. Perhaps its place is in components, but I have left it as is. There is abasefolder where I split multiple parts of "Base" layout - scripts, favicons and so on. -
/libis a folder for utilities, zod schemas, API client and so on. -
/stylesis for global styles: there is acomponents.cssfor classes likeboxandindex.cssfor other global styles and reexporting the other two.
/plugins is for any plugins, specifically for rehype, remark and expressive-code.
/prisma is for Prisma configuration.
startup.sh and compose.yml exist for the purpose of using database locally with ease. The script elevates docker-compose with postgres, runs migrations against the db and runs the server. Do not forget to add executable rights to startup.sh.
- Multiple themes support via
daisyUI - Extended
MDXsupport withremarkandrehypeplugins - Cool themed code blocks with
expressive-code - Global search via
pagefind - Global
configurationof text width and size - Grid view to paginate posts
RSS,sitemap,OpenGraphimages,SEO-optimized, adaptive and performant without any unnecessary JS sent to the client- Database integration via
postgres,supabase,Prismaandkysely utterancesfor comments
This project is licensed under the terms of the MIT license.