Skip to content
Back to search

spartan

Cutting-edge tools powering Angular full-stack development.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/spartan-ng-spartan/badge.svg)](/listings/spartan-ng-spartan)

HTML

<a href="/listings/spartan-ng-spartan"><img src="/api/listings/spartan-ng-spartan/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Run `pnpm install` to install the dependencies of this project.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 379 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # spartan
  2. <a href="https://www.spartan.ng" target="_blank">
  3. <img alt="A spartan shield" width="100px" src="./spartan.svg" title="Spartan logo"/>
  4. </a>
  5. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![Discord server](https://dcbadge.limes.pink/api/server/EqHnxQ4uQr?style=flat-square)](https://discord.gg/EqHnxQ4uQr)
  6. [Website](https://www.spartan.ng) • [Documentation](https://www.spartan.ng/documentation/introduction) • [Components](https://www.spartan.ng/components) • [Blocks](https://www.spartan.ng/blocks) • [GitHub](https://github.com/spartan-ng/spartan)
  7. > Cutting-edge tools that power Angular full-stack development - accessible, un-styled UI primitives with copy-paste, shadcn-style styles, plus an opinionated full-stack setup. Build like a spartan.
  8. Welcome to the spartan mono-repo. This Nx repository is home to **spartan/ui** - accessible,
  9. un-styled UI primitives for Angular with copy-paste, shadcn-style helm styles - and the **spartan/stack**,
  10. an opinionated full-stack setup built on AnalogJs.
  11. spartan/ui is **stable** on the **1.x** line: production-ready, [semantically versioned](https://semver.org), and shipping more than 55 components. Install with [`@spartan-ng/brain`](https://www.npmjs.com/package/@spartan-ng/brain) and the [`@spartan-ng/cli`](https://www.npmjs.com/package/@spartan-ng/cli), or explore everything at [spartan.ng](https://www.spartan.ng).
  12. ## Packages
  13. | Package | Description | |
  14. | ----------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------ |
  15. | [`@spartan-ng/brain`](./libs/brain) | Headless, accessible UI primitives for Angular - the behavior half of spartan. | [npm](https://www.npmjs.com/package/@spartan-ng/brain) |
  16. | [`@spartan-ng/cli`](./libs/cli) | Nx plugin & Angular schematics that add spartan/ui to any workspace in one go. | [npm](https://www.npmjs.com/package/@spartan-ng/cli) |
  17. | [`@spartan-ng/mcp`](./libs/mcp) | Model Context Protocol server giving AI assistants up-to-date spartan docs. | [npm](https://www.npmjs.com/package/@spartan-ng/mcp) |
  18. The styled **helm** components aren't published as a package on purpose - the [CLI](./libs/cli) copies them straight into your project so you own and customize every line.
  19. ## The 300 spartans
  20. All of spartan is an MIT-licensed open source project with its ongoing development made possible by contributors and sponsors.
  21. Our initial 300 contributors and sponsors are featured here and on the front page of [spartan.ng](https://www.spartan.ng)
  22. 1. [goetzrobin](https://github.com/goetzrobin)
  23. 2. [thatsamsonkid](https://github.com/thatsamsonkid)
  24. 3. [elite-benni](https://github.com/elite-benni)
  25. 4. [ashley-hunter](https://github.com/ashley-hunter)
  26. 5. [marcjulian](https://github.com/marcjulian)
  27. 6. [MerlinMoos](https://github.com/MerlinMoos)
  28. 7. [zeropsio](https://github.com/zeropsio)
  29. 8. [snyder-tech](https://github.com/snyder-tech)
  30. 9. [mihajm](https://github.com/mihajm)
  31. 10. [ajitzero](https://github.com/ajitzero)
  32. 11. [arturgawlik](https://github.com/arturgawlik)
  33. 12. [deepakrudrapaul](https://github.com/deepakrudrapaul)
  34. 13. [evanfuture](https://github.com/evanfuture)
  35. 14. [AdditionAddict](https://github.com/AdditionAddict)
  36. 15. [Altamimi-Dev](https://github.com/Altamimi-Dev)
  37. 16. [ferat](https://github.com/ferat)
  38. 17. [jeremy-js-devweb](https://github.com/jeremy-js-devweb)
  39. 18. [heddendorp](https://github.com/heddendorp)
  40. 19. [tutkli](https://github.com/tutkli)
  41. 20. [Pascalmh](https://github.com/Pascalmh)
  42. 21. [okkindel](https://github.com/okkindel)
  43. 22. [oidre](https://github.com/oidre)
  44. 23. [nartc](https://github.com/nartc)
  45. 24. [santoshyadavdev](https://github.com/santoshyadavdev)
  46. 25. [markostanimirovic](https://github.com/markostanimirovic)
  47. 26. [theo-matzavinos](https://github.com/theo-matzavinos)
  48. 27. [jkuri](https://github.com/jkuri)
  49. 28. [dongphuong0905](https://github.com/dongphuong0905)
  50. 29. [DominikPieper](https://github.com/DominikPieper)
  51. 30. [brandonroberts](https://github.com/brandonroberts)
  52. 31. [izikd](https://github.com/izikd)
  53. 32. [ryancraigmartin](https://github.com/ryancraigmartin)
  54. 33. [gaetanBloch](https://github.com/gaetanBloch)
  55. 34. [gergobergo](https://github.com/gergobergo)
  56. 35. [rpacheco124](https://github.com/rpacheco124)
  57. 36. [benjaminforras](https://github.com/benjaminforras)
  58. 37. [jstnjs](https://github.com/jstnjs)
  59. 38. [r3ps4J](https://github.com/r3ps4J)
  60. 39. [Celtian](https://github.com/Celtian)
  61. 40. [miljan-code](https://github.com/miljan-code)
  62. 41. [alexciesielski](https://github.com/alexciesielski)
  63. 42. [ty-ler](https://github.com/ty-ler)
  64. 43. [m-risto](https://github.com/m-risto)
  65. 44. [badsgahhl](https://github.com/badsgahhl)
  66. 45. [monacodelisa](https://github.com/monacodelisa)
  67. 46. [tomdev9](https://github.com/tomdev9)
  68. 47. [ragul1697](https://github.com/ragul1697)
  69. 48. [kkamman](https://github.com/kkamman)
  70. 49. [i-am-the-slime](https://github.com/i-am-the-slime)
  71. 50. [DevWedeloper](https://github.com/DevWedeloper)
  72. 51. [mrsofiane](https://github.com/mrsofiane)
  73. 52. [mateoetchepare](https://github.com/mateoetchepare)
  74. 53. [DonaldMurillo](https://github.com/DonaldMurillo)
  75. 54. [toniskobic](https://github.com/toniskobic)
  76. 55. [eneajaho](https://github.com/eneajaho)
  77. 56. [Den-dp](https://github.com/Den-dp)
  78. 57. [0xfraso](https://github.com/0xfraso)
  79. 58. [Muneersahel](https://github.com/Muneersahel)
  80. 59. [danilolmc](https://github.com/danilolmc)
  81. 60. [tomalaforge](https://github.com/tomalaforge)
  82. 61. [canserkanuren](https://github.com/canserkanuren)
  83. 62. [cjosue15](https://github.com/cjosue15)
  84. 63. [hirenchauhan2](https://github.com/hirenchauhan2)
  85. 64. [Roguyt](https://github.com/Roguyt)
  86. 65. [tsironis13](https://github.com/tsironis13)
  87. 66. [guillermoecharri](https://github.com/guillermoecharri)
  88. 67. [ValentinFunk](https://github.com/ValentinFunk)
  89. 68. [Femi236](https://github.com/Femi236)
  90. 69. [dineshkp](https://github.com/dineshkp)
  91. 70. [robingenz](https://github.com/robingenz)
  92. 71. [Balastrong](https://github.com/Balastrong)
  93. 72. [OlegSuncrown](https://github.com/OlegSuncrown)
  94. 73. [stewones](https://github.com/stewones)
  95. 74. [shinkhouse](https://github.com/shinkhouse)
  96. 75. [donaldxdonald](https://github.com/donaldxdonald)
  97. 76. [BenoitPE](https://github.com/BenoitPE)
  98. 77. [Georg632](https://github.com/Georg632)
  99. 78. [hillin](https://github.com/hillin)
  100. 79. [Besbash](https://github.com/Besbash)
  101. 80. [davidedammino](https://github.com/davidedammino)
  102. 81. [marcindz88](https://github.com/marcindz88)
  103. 82. [thyco](https://github.com/thyco)
  104. 83. [hitro11](https://github.com/hitro11)
  105. 84. [GODrums](https://github.com/GODrums)
  106. 85. [samsonkumawong](https://github.com/samsonkumawong)
  107. 86. [suprasannaojha](https://github.com/suprasannaojha)
  108. 87. [JeevanMahesha](https://github.com/JeevanMahesha)
  109. 88. [dlhck](https://github.com/dlhck)
  110. 89. [tomer953](https://github.com/tomer953)
  111. 90. [drdreo](https://github.com/drdreo)
  112. 91. [tlandenberger](https://github.com/tlandenberger)
  113. 92. [yackinn](https://github.com/yackinn)
  114. 93. [OmerGronich](https://github.com/OmerGronich)
  115. 94. [kubalinio](https://github.com/kubalinio)
  116. 95. [AlexHladin](https://github.com/AlexHladin)
  117. 96. [CO97](https://github.com/CO97)
  118. 97. [MatanShushan](https://github.com/MatanShushan)
  119. 98. [maxhov](https://github.com/maxhov)
  120. 99. [josueggh](https://github.com/josueggh)
  121. 100. [namdien177](https://github.com/namdien177)
  122. 101. [zelenchuk](https://github.com/zelenchuk)
  123. 102. [a-malacarne](https://github.com/a-malacarne)
  124. 103. [YasinKuralay](https://github.com/YasinKuralay)
  125. 104. [nico13051995](https://github.com/nico13051995)
  126. 105. [francotalarico](https://github.com/francotalarico)
  127. 106. [koenigderluegner](https://github.com/koenigderluegner)
  128. 107. [Turtl3e](https://github.com/Turtl3e)
  129. 108. [minhnguyen120898](https://github.com/minhnguyen120898)
  130. 109. [liam-langstaff](https://github.com/liam-langstaff)
  131. 110. [dw-0](https://github.com/dw-0)
  132. 111. [Khumozin](https://github.com/Khumozin)
  133. 112. [abiramcodes](https://github.com/abiramcodes)
  134. 113. [garygrossgarten](https://github.com/garygrossgarten)
  135. 114. [Oussemasahbeni](https://github.com/Oussemasahbeni)
  136. 115. [benpsnyder](https://github.com/benpsnyder)
  137. 116. [dhwani1806](https://github.com/dhwani1806)
  138. 117. [elite-lucas](https://github.com/elite-lucas)
  139. 118. [esteecodes](https://github.com/esteecodes)
  140. 119. [felhag](https://github.com/felhag)
  141. 120. [notsufferbutbutter](https://github.com/notsufferbutbutter)
  142. 121. [vlrjuan](https://github.com/vlrjuan)
  143. 122. [Dafnik](https://github.com/Dafnik)
  144. 123. [hassantayyab](https://github.com/hassantayyab)
  145. 124. [mathwizard](https://github.com/mathwizard)
  146. 125. [RaminGe](https://github.com/RaminGe)
  147. 126. [abos-gergo](https://github.com/abos-gergo)
  148. 127. [jpsullivan](https://github.com/jpsullivan)
  149. 128. [ayangabryl](https://github.com/ayangabryl)
  150. 129. [s-froghyar](https://github.com/s-froghyar)
  151. 130. [aziz-zina](https://github.com/aziz-zina)
  152. 131. [avihayAsus](https://github.com/avihayAsus)
  153. 132. [multignite](https://github.com/multignite)
  154. 133. [sefatanam](https://github.com/sefatanam)
  155. 134. [LinboLen](https://github.com/LinboLen)
  156. 135. [Oneill19](https://github.com/Oneill19)
  157. 136. [homj](https://github.com/homj)
  158. 137. [Musta-Pollo](https://github.com/Musta-Pollo)
  159. 138. [mitja-kurath](https://github.com/mitja-kurath)
  160. 139. [alisterpineda](https://github.com/alisterpineda)
  161. 140. [amitshalev2](https://github.com/amitshalev2)
  162. 141. [SOG-web](https://github.com/SOG-web)
  163. 142. [Joebeurg](https://github.com/Joebeurg)
  164. 143. [mehrabix](https://github.com/mehrabix)
  165. 144. [PatrickLarocque](https://github.com/PatrickLarocque)
  166. 145. [Ban117](https://github.com/Ban117)
  167. 146. [gerasidev](https://github.com/gerasidev)
  168. 147. [Nicoss54](https://github.com/Nicoss54)
  169. 148. [xonaib](https://github.com/xonaib)
  170. 149. [SocDario](https://github.com/SocDario)
  171. 150. [bcl-dev](https://github.com/bcl-dev)
  172. 151. [skolldev](https://github.com/skolldev)
  173. 152. [DanGM96](https://github.com/DanGM96)
  174. 153. [possibleo](https://github.com/possibleo)
  175. 154. [dolanmiu](https://github.com/dolanmiu)
  176. 155. [khocef](https://github.com/khocef)
  177. 156. [robmanganelly](https://github.com/robmanganelly)
  178. 157. [PopePAF](https://github.com/PopePAF)
  179. 158. [gerardp](https://github.com/gerardp)
  180. 159. [Gilbert-S](https://github.com/Gilbert-S)
  181. 160. [bsarnii](https://github.com/bsarnii)
  182. 161. [michelAlexis](https://github.com/michelAlexis)
  183. 162. [stanislavnastasiu-dev](https://github.com/stanislavnastasiu-dev)
  184. 163. [hemanth004](https://github.com/hemanth004)
  185. 164. [GabeSilvaDev](https://github.com/GabeSilvaDev)
  186. 165. [Sepandard](https://github.com/Sepandard)
  187. 166. [carlospalacin](https://github.com/carlospalacin)
  188. 167. [bence444](https://github.com/bence444)
  189. 168. [pjalinski](https://github.com/pjalinski)
  190. 169. [mdezey](https://github.com/mdezey)
  191. 170. [ant1quar](https://github.com/ant1quar)
  192. 171. [erkamyaman](https://github.com/erkamyaman)
  193. 172. [nilsfunke](https://github.com/nilsfunke)
  194. 173. [wajrock](https://github.com/wajrock)
  195. 174. [tobiaslandenberger](https://github.com/tobiaslandenberger)
  196. ### Sponsor spartan
  197. spartan is MIT-licensed and free, forever. But free to use isn't free to build - countless hours of late-night, hard-fought work hold this phalanx together, and they keep the components shipping and the docs current.
  198. If spartan saves your company or team time, consider returning the favor. Sponsoring keeps spartan actively maintained, the roadmap moving, and the open-source work of the 300 sustainable. No spartan holds the line alone - every shield in the wall counts.
  199. **[Become a spartan today! →](https://github.com/sponsors/goetzrobin)**
  200. ## Zerops: The Strategic Alliance
  201. <div align="center">
  202. <a href="https://zerops.io" target="_blank">
  203. <img src="https://avatars.githubusercontent.com/u/65757521?s=200&v=4" alt="Zerops" width="250">
  204. </a>
  205. </div>
  206. spartan.ng has formed a powerful alliance with Zerops, a developer-first cloud platform that shares our commitment to advancing the Angular ecosystem.
  207. Through their strategic support, Zerops has enabled:
  208. - Dedicated resources for our core development team
  209. - Accelerated component development on our path to v1 and beyond
  210. - Creation of production-ready templates and starter kits
  211. - Long-term sustainability for the entire project
  212. Zerops eliminates deployment complexity so developers can focus on building great software—a philosophy that perfectly aligns with our mission to create powerful yet easy-to-implement components.
  213. **[Experience the cloud platform that's powering Spartan.ng's future →](https://zerops.io)**
  214. ## spartan/ui
  215. spartan/ui brings the [shadcn/ui](https://ui.shadcn.com) philosophy to Angular: accessible, un-styled primitives - inspired by [Radix](https://www.radix-ui.com) and built on the Angular CDK and other proven community solutions - paired with beautiful, copy-paste shadcn-style styles that you own.
  216. Each primitive is made up of two halves:
  217. - a headless **`brain`** library in [`libs/brain`](./libs/brain) that provides the behavior, accessibility, and state - published to npm as [`@spartan-ng/brain`](https://www.npmjs.com/package/@spartan-ng/brain).
  218. - a **`helm`** library in [`libs/helm`](./libs/helm) that adds the styles, copied straight into your project by the CLI so you can edit them freely.
  219. [`libs/cli`](./libs/cli) holds the Nx plugin & Angular CLI code that adds spartan/ui to any Nx or Angular workspace in a single command - published as [`@spartan-ng/cli`](https://www.npmjs.com/package/@spartan-ng/cli).
  220. [`libs/mcp`](./libs/mcp) is a [Model Context Protocol](https://modelcontextprotocol.io) server - published as [`@spartan-ng/mcp`](https://www.npmjs.com/package/@spartan-ng/mcp) - that gives AI assistants up-to-date spartan docs, components, and blocks.
  221. The `skills/spartan` folder contains the spartan agent skill - procedural knowledge that teaches AI coding assistants how to build spartan/ui correctly. Users install it with `npx skills add spartan-ng/spartan`. See [the Skills docs](https://www.spartan.ng/documentation/skills).
  222. ### Install Dependencies
  223. Run `pnpm install` to install the dependencies of this project.
  224. ### Development with storybook
  225. A storybook project is set up and is the primary way to develop UI components. You can run it with:
  226. ```
  227. pnpm run storybook
  228. ```
  229. Story files live in `apps/ui-storybook/stories`, one per primitive, e.g. `apps/ui-storybook/stories/accordion.stories.ts`.
  230. Use these files to add stories and drive development of the primitives.
  231. ### Testing
  232. spartan uses [Jest](https://jestjs.io) for tests. To test all projects locally, run the following command from the root
  233. folder:
  234. ```shell
  235. pnpm run test
  236. ```
  237. ### e2e testing
  238. Cypress e2e testing is set up to run on the storybook. You can run it with:
  239. ```
  240. pnpm run e2e
  241. ```
  242. To add your own `e2e` tests add them to the `apps/ui-storybook-e2e` application.
  243. ## spartan/stack
  244. An example application running
  245. on [Supabase](https://supabase.com/), [Drizzle](https://orm.drizzle.team/), [Analog](https://analogjs.org/),
  246. [tRPC](https://trpc.io/), [Tailwind](https://tailwindcss.com/), [Angular](https://angular.io/),
  247. and [Nx](https://nx.dev/). It also serves as the documentation page introducing the stack and UI library.
  248. Follow the directions in the official documentation to set up your own project:
  249. https://www.spartan.ng/stack/overview
  250. ### Example App
  251. In the `apps` folder of this repository, you can also find an example application of the spartan stack.
  252. It also serves as the documentation page for this project.
  253. Follow the directions below to get it up and running:
  254. #### Prerequisites
  255. - You will need `pnpm` as your package manager.
  256. - You will need to set up a [Supabase](https://supabase.com/) account (it's free)
  257. - You will need [NodeJs](https://nodejs.org/en) installed. The version I have working is `20.17.0`.
  258. #### Development server
  259. Then you can run the following command:
  260. ```shell
  261. pnpm nx serve app
  262. ```
  263. or
  264. ```shell
  265. pnpm run dev
  266. ```
  267. for a dev server. Navigate to http://localhost:4200/. The app will automatically reload
  268. if you change any of the source files.
  269. #### Database
  270. We use Drizzle to connect to a Supabase instance for the example app.
  271. Add an `.env` file to your repo with the following contents:
  272. Add a `.env` file at the root of your Nx workspace and add the connection string like so:
  273. ```
  274. DATABASE_URL="postgresql://postgres:[YOUR-PASSWORD]@db.[YOUR-SUPABASE-REFERENCE-ID].supabase.co:5432/postgres?schema=public"
  275. ```
  276. And make sure to run the following script in your Supabase editor to set up the necessary tables:
  277. ```sql
  278. create table
  279. public.note (
  280. id bigserial,
  281. title text not null,
  282. content text null,
  283. created_at timestamp with time zone null default current_timestamp,
  284. constraint notes_pkey primary key (id)
  285. ) tablespace pg_default;
  286. ```
  287. > [!NOTE] > `.env` should be added to `.gitignore`
  288. ## Understand this workspace
  289. Run `pnpm nx graph` to see a diagram of the dependencies of the projects.
  290. ## Documentation
  291. - [Introduction](https://www.spartan.ng/documentation/introduction)
  292. - [Installation](https://www.spartan.ng/documentation/installation)
  293. - [CLI](https://www.spartan.ng/documentation/cli)
  294. - [Theming](https://www.spartan.ng/documentation/theming)
  295. - [Components](https://www.spartan.ng/components)
  296. - [Blocks](https://www.spartan.ng/blocks)
  297. ## Community
  298. - [Discord](https://discord.gg/EqHnxQ4uQr)
  299. - [GitHub](https://github.com/spartan-ng/spartan)
  300. - [Sponsor the project](https://github.com/sponsors/goetzrobin)
  301. Run into an issue or have a question? Open an issue on [GitHub](https://github.com/spartan-ng/spartan/issues) or say hi in [Discord](https://discord.gg/EqHnxQ4uQr).
  302. ## License
  303. MIT © [goetzrobin](https://github.com/goetzrobin) and the [spartan contributors](https://github.com/spartan-ng/spartan/graphs/contributors)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.