{"id":17601557,"url":"https://github.com/kavinvalli/rita","last_synced_at":"2025-09-05T22:30:55.549Z","repository":{"id":54444769,"uuid":"437620173","full_name":"kavinvalli/rita","owner":"kavinvalli","description":"Batteries included starter for Adonis apps - React, Inertia, Typescript, Adonis","archived":false,"fork":false,"pushed_at":"2023-01-15T04:22:35.000Z","size":674,"stargazers_count":37,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T00:35:02.007Z","etag":null,"topics":["adonisjs","fullstack-typescript","inertiajs","reactjs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kavinvalli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-12T18:08:20.000Z","updated_at":"2024-10-02T13:17:00.000Z","dependencies_parsed_at":"2023-02-09T21:15:51.570Z","dependency_job_id":null,"html_url":"https://github.com/kavinvalli/rita","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/kavinvalli/rita","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinvalli%2Frita","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinvalli%2Frita/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinvalli%2Frita/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinvalli%2Frita/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kavinvalli","download_url":"https://codeload.github.com/kavinvalli/rita/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kavinvalli%2Frita/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273832151,"owners_count":25176262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adonisjs","fullstack-typescript","inertiajs","reactjs","typescript"],"created_at":"2024-10-22T12:40:29.764Z","updated_at":"2025-09-05T22:30:55.172Z","avatar_url":"https://github.com/kavinvalli.png","language":"TypeScript","funding_links":[],"categories":["AdonisJS"],"sub_categories":[],"readme":"# RITA\n![image](https://user-images.githubusercontent.com/41034356/204083631-2550626d-a305-4177-a223-bf9e545826ee.png)\n\n*React Inertia Typescript Adonis* with TailwindCSS\n\nA batteries-included starter for Adonis apps.\n\n## Setup\n\u003e You will have to have mysql running on your machine\n```sh\ngit clone https://github.com/kavinvalli/rita new-project\ncd new-project\nrm -rf CNAME\nnpm i\ncp .env.example .env\ndocker-compose up -d # In case you want to use adonis-sail (similar to laravel's sail)\nnode ace migration:run\nnode ace db:seed\nnpm run dev\n```\n\n## Sail\nThe starter also has support for [adonis-sail](https://github.com/Julien-R44/adonis-sail), therefore introducing a Docker development environment.\n\u003e Note that this is completely optional to use, but it does make your development flow much easier.\n\nYou need to have [docker](https://www.docker.com/) installed for this to work.\n\n```sh\ndocker-compose up -d\n```\n\nBy default, this will spin up MySQL, Redis and Mailhog. You can add or remove as you wish in `docker-compose.yml`\n\n## Frontend\n\n### Types\n\nTypes for the app are defined in `resources/js/lib/types.tsx`, this file has the interface `IPageProps`, which is used with the `usePage` hook from Inertia for typing shared data coming from the backend.\n\n```tsx\nconst { props: { user } } = usePage\u003cIPageProps\u003e();\n```\n\nThis file also has `IUser`, the interface for the User model.\n\n### `useTitle`\n\n`resources/js/lib/use-title.tsx` contains the `useTitle` hook, used to set the title from inside a React component. You could also use [Inertia's `Head` component](https://inertiajs.com/title-and-meta) for this.\n\n\n### Ace command to create pages\n\n`node ace make:page \u003cPAGE NAME\u003e` creates a page in `resources/js/pages` using the template in `commands/templates/page.txt`.\nFor example: `node ace make:page auth/login` or `node ace make:page test`\n\n## Authentication\n\nRITA supports authentication with email-password, Github and Google out of the box. Social authentication is implemented with [Ally](https://docs.adonisjs.com/guides/auth/social#document), so it should be easy to add other providers. See `app/Http/Controllers/SocialAuthController.ts` for implementation.\n\n## Ace command to create user\n`node ace create:user` prompts you fields to create a new user directly from the cli.\n\n## Inertia Shared Data\nYou can share data across all inertia pages by editting `start/inertia.ts` and updating `IPageProps` in `resources/js/lib/types.tsx`\n\n## Authorization\n\nAdmin accounts have the `admin` property on the `User` model set to true. By default, all users who register via the `/auth/register` route are not admins.\n\n### Middleware\nYou can use the `auth` and the `admin` middleware which are set in `app/Middleware`\n\n### Seeded admin account\n\nThe database seeder creates an admin account with the following credentials:\n\n```\nEmail: admin@example.com\nPassword: adminadmin\n```\n\n### Frontend Authorization\n\n`resources/js/lib/authorization.tsx` contains the following components - `Admin`, `User`, `Authenticated` and `Guest`. These show/don't show the children passed to them based on the user and authentication state.\n\n```tsx\n\u003cAdmin\u003e\n  Only an admin can see this\n\u003c/Admin\u003e\n\n\u003cUser\u003e\n  Only a user who is not an admin can see this\n\u003c/User\u003e\n\n\u003cAuthenticated\u003e\n  Both users and admins can see this\n\u003c/Authenticated\u003e\n\n\u003cGuest\u003e\n  Logged in users can not see this\n\u003c/Guest\u003e\n```\n\n## Socket.io implemented\n### Backend\n#### Broadcast on start\nYou can setup listeners or emit data on start by editting `start/socket.ts`.\n\n#### Broaadcast from anywhere\nhttps://docs.adonisjs.com/cookbooks/socketio-with-adonisjs#broadcast-from-anywhere\n\n### Frontend\n1. Use the `useContext` api and `SockerContext` in `resources/js/context/socket.tsx`\n```tsx\nimport React, { useContext, useEffect } from 'react'\nimport { SocketContext } from '../context/socket'\n\nconst socket = useContext(SocketContext)\n```\n2. On `useEffect`, you can setup listeners or emit some data\n```tsx\nuseEffect(() =\u003e {\n  socket.on('test', (data: { [key: string]: string }) =\u003e console.log(data))\n  socket.on('sendMessageToClient', (data: string) =\u003e console.log(data))\n\n  return () =\u003e socket.disconnect()\n}, [])\n```\n\n3. You can also emit data from the frontend on certain events. For example:\n```tsx\n\u003cbutton className=\"button\" onClick={() =\u003e socket.emit('sendMessage', 'hello world!')}\u003e\n  Hello\n\u003c/button\u003e\n```\n\n## Linting and Formatting\n\nThis project comes with ESLint and Prettier setup out of the box, configs are in `.eslintrc.js` and `.prettierrc` respectively.\n\n## Example\nA Todo app made with RITA can be found at https://github.com/kavinvalli/rita-todo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinvalli%2Frita","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkavinvalli%2Frita","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkavinvalli%2Frita/lists"}