diff --git a/README.md b/README.md index b1f25a7..1d1792f 100644 --- a/README.md +++ b/README.md @@ -1,261 +1,174 @@ -
+# Taskfy - -
- - -# TASKFY - -Transforming Tasks Into Seamless Success - - -last-commit -repo-top-language -repo-language-count - -Built with the tools and technologies: - -JSON -Markdown -npm -Ruby -PostCSS -Prettier -esbuild -JavaScript -i18next -
-React -Yarn -Docker -GitHub%20Actions -Vite -ESLint -Axios -Sass -Buffer - -
-
- ---- - -## Table of Contents +Taskfy is a full-stack task management application built with **Ruby on Rails 8** and **React**. It provides a JSON API for core resources (tasks, users, sessions, comments) and serves a SPA-style frontend shell from Rails. +## Contents - [Overview](#overview) -- [Getting Started](#getting-started) - - [Prerequisites](#prerequisites) - - [Installation](#installation) - - [Usage](#usage) - - [Testing](#testing) -- [Features](#features) -- [Project Structure](#project-structure) - ---- +- [Architecture](#architecture) +- [Tech Stack](#tech-stack) +- [API](#api) +- [Repository Layout](#repository-layout) +- [Local Development](#local-development) +- [Testing & Code Quality](#testing--code-quality) +- [Deployment](#deployment) +- [Troubleshooting](#troubleshooting) ## Overview -Taskfy is a powerful developer toolkit designed to streamline the development, deployment, and maintenance of modern Rails applications integrated with React. It combines robust dependency management, frontend asset optimization, and containerized workflows to enhance productivity and scalability. - -**Why Taskfy?** - -This project simplifies complex workflows by providing: - -- ๐Ÿงฉ **Dependency & Environment Management:** Ensures a consistent, scalable Rails setup with Gemfile, credentials, and environment configs. -- ๐Ÿš€ **Frontend Asset Optimization:** Uses esbuild, Tailwind CSS, and Vite for fast, modern frontend builds. -- ๐Ÿณ **Containerized Deployment:** Dockerfile and Procfile.dev facilitate reliable, repeatable environments. -- ๐ŸŽฏ **Testing & Quality Assurance:** Factory setups, parallel test execution, and system tests improve code reliability. -- ๐Ÿ”’ **Secure & Maintainable:** Encrypted credentials, security policies, and clear separation of concerns support long-term stability. - ---- - -## Features - -| | Component | Details | -| :--- | :------------------- | :------------------------------------------------------------------------------------------ | -| โš™๏ธ | **Architecture** | | -| ๐Ÿ”ฉ | **Code Quality** | | -| ๐Ÿ“„ | **Documentation** | | -| ๐Ÿ”Œ | **Integrations** | | -| ๐Ÿงฉ | **Modularity** | | -| ๐Ÿงช | **Testing** | | -| โšก๏ธ | **Performance** | | -| ๐Ÿ›ก๏ธ | **Security** | | -| ๐Ÿ“ฆ | **Dependencies** | | - ---- - -## Project Structure - -```sh -โ””โ”€โ”€ taskfy/ - โ”œโ”€โ”€ .github - โ”‚ โ”œโ”€โ”€ dependabot.yml - โ”‚ โ””โ”€โ”€ workflows - โ”œโ”€โ”€ Dockerfile - โ”œโ”€โ”€ Gemfile - โ”œโ”€โ”€ Gemfile.lock - โ”œโ”€โ”€ Procfile.dev - โ”œโ”€โ”€ README.md - โ”œโ”€โ”€ Rakefile - โ”œโ”€โ”€ app - โ”‚ โ”œโ”€โ”€ assets - โ”‚ โ”œโ”€โ”€ controllers - โ”‚ โ”œโ”€โ”€ helpers - โ”‚ โ”œโ”€โ”€ javascript - โ”‚ โ”œโ”€โ”€ jobs - โ”‚ โ”œโ”€โ”€ mailers - โ”‚ โ”œโ”€โ”€ models - โ”‚ โ”œโ”€โ”€ policies - โ”‚ โ””โ”€โ”€ views - โ”œโ”€โ”€ config - โ”‚ โ”œโ”€โ”€ application.rb - โ”‚ โ”œโ”€โ”€ boot.rb - โ”‚ โ”œโ”€โ”€ build - โ”‚ โ”œโ”€โ”€ cable.yml - โ”‚ โ”œโ”€โ”€ cache.yml - โ”‚ โ”œโ”€โ”€ credentials.yml.enc - โ”‚ โ”œโ”€โ”€ database.yml.ci - โ”‚ โ”œโ”€โ”€ deploy.yml - โ”‚ โ”œโ”€โ”€ environment.rb - โ”‚ โ”œโ”€โ”€ environments - โ”‚ โ”œโ”€โ”€ initializers - โ”‚ โ”œโ”€โ”€ locales - โ”‚ โ”œโ”€โ”€ puma.rb - โ”‚ โ”œโ”€โ”€ queue.yml - โ”‚ โ”œโ”€โ”€ recurring.yml - โ”‚ โ”œโ”€โ”€ routes.rb - โ”‚ โ””โ”€โ”€ storage.yml - โ”œโ”€โ”€ config.ru - โ”œโ”€โ”€ db - โ”‚ โ”œโ”€โ”€ cable_schema.rb - โ”‚ โ”œโ”€โ”€ cache_schema.rb - โ”‚ โ”œโ”€โ”€ data - โ”‚ โ”œโ”€โ”€ data_schema.rb - โ”‚ โ”œโ”€โ”€ migrate - โ”‚ โ”œโ”€โ”€ queue_schema.rb - โ”‚ โ”œโ”€โ”€ schema.rb - โ”‚ โ””โ”€โ”€ seeds.rb - โ”œโ”€โ”€ esbuild.config.js - โ”œโ”€โ”€ lib - โ”‚ โ””โ”€โ”€ tasks - โ”œโ”€โ”€ package.json - โ”œโ”€โ”€ postcss.config.js - โ”œโ”€โ”€ script - โ”‚ โ””โ”€โ”€ .keep - โ”œโ”€โ”€ tailwind.config.js - โ”œโ”€โ”€ test - โ”‚ โ”œโ”€โ”€ application_system_test_case.rb - โ”‚ โ”œโ”€โ”€ controllers - โ”‚ โ”œโ”€โ”€ factories - โ”‚ โ”œโ”€โ”€ helpers - โ”‚ โ”œโ”€โ”€ integration - โ”‚ โ”œโ”€โ”€ mailers - โ”‚ โ”œโ”€โ”€ models - โ”‚ โ”œโ”€โ”€ support - โ”‚ โ”œโ”€โ”€ system - โ”‚ โ””โ”€โ”€ test_helper.rb - โ”œโ”€โ”€ vite.config.js - โ”œโ”€โ”€ vite.config.mts - โ””โ”€โ”€ yarn.lock +Taskfy is designed for a Rails-first backend workflow with a modern frontend toolchain. + +- Rails handles domain logic, persistence, and JSON responses. +- React handles interactive UI components in the frontend shell. +- Vite/esbuild provide fast frontend development and bundling. +- SQLite keeps local setup lightweight. + +## Architecture + +- **Backend framework:** Rails 8 (`config.load_defaults 8.0`) +- **API rendering:** Jbuilder templates under `app/views/**/.json.jbuilder` +- **Auth/session flow:** session resource (`POST /session`, `DELETE /session`) +- **Authorization:** Pundit policy layer (e.g., `app/policies/task_policy.rb`) +- **Frontend entrypoint:** `app/javascript/src/App.jsx` served through Rails routing fallback + +## Tech Stack + +### Backend +- Ruby on Rails `~> 8.0.4` +- SQLite3 +- Pundit +- Jbuilder +- Solid Queue / Solid Cache / Solid Cable + +### Frontend +- React 18 +- Vite +- esbuild +- Sass +- Tailwind CSS + +### Tooling +- RuboCop +- ESLint + Prettier +- Brakeman +- Husky + lint-staged + +## API + +JSON routes are defined with a `format: :json` constraint in `config/routes.rb`. + +| Method | Path | Purpose | +|---|---|---| +| GET | `/tasks` | List tasks | +| POST | `/tasks` | Create task | +| GET | `/tasks/:slug` | Get task by slug | +| PATCH / PUT | `/tasks/:slug` | Update task | +| DELETE | `/tasks/:slug` | Delete task | +| GET | `/users` | List users | +| POST | `/users` | Create user | +| POST | `/session` | Sign in / create session | +| DELETE | `/session` | Sign out / destroy session | +| POST | `/comments` | Create comment | + +## Repository Layout + +```text +taskfy/ +โ”œโ”€โ”€ app/ +โ”‚ โ”œโ”€โ”€ controllers/ # Request handling and API actions +โ”‚ โ”œโ”€โ”€ javascript/ # React source, entrypoints, stylesheets +โ”‚ โ”œโ”€โ”€ models/ # ActiveRecord models +โ”‚ โ”œโ”€โ”€ policies/ # Pundit authorization policies +โ”‚ โ””โ”€โ”€ views/ # ERB and Jbuilder templates +โ”œโ”€โ”€ config/ # Rails config, routes, env settings +โ”œโ”€โ”€ db/ # Schema and migration/data files +โ”œโ”€โ”€ bin/ # Dev and maintenance scripts +โ”œโ”€โ”€ Procfile.dev # Foreman process definitions +โ”œโ”€โ”€ Gemfile # Ruby gems +โ””โ”€โ”€ package.json # JavaScript dependencies/scripts ``` ---- - -## Getting Started +## Local Development ### Prerequisites -This project requires the following dependencies: +Install: +- Ruby (version compatible with `.ruby-version`) +- Bundler +- Node.js + Yarn +- SQLite3 -- **Programming Language:** Ruby -- **Package Manager:** Bundler, Rake, Npm, Yarn -- **Container Runtime:** Docker +### Setup -### Installation +```bash +git clone +cd taskfy +bundle install +yarn install +bin/rails db:prepare +``` -Build taskfy from the source and install dependencies: +Alternative bootstrap flow: -1. **Clone the repository:** +```bash +bin/setup +``` - ```sh - โฏ git clone https://github.com/syntaxmage05/taskfy - ``` +### Run -2. **Navigate to the project directory:** +```bash +bin/dev +``` - ```sh - โฏ cd taskfy - ``` +`bin/dev` uses `Procfile.dev` and starts: +- Rails server +- JS build watcher +- Vite dev server -3. **Install the dependencies:** +Default URL: `http://localhost:3000` -**Using [docker](https://www.docker.com/):** +## Testing & Code Quality -```sh -โฏ docker build -t syntaxmage05/taskfy . -``` -**Using [bundler](https://www.ruby-lang.org/):** +### Tests -```sh -โฏ bundle install +```bash +bin/rails test ``` -**Using [npm](https://www.npmjs.com/):** -```sh -โฏ npm install -``` -**Using [yarn](https://yarnpkg.com/):** +### Ruby linting -```sh -โฏ yarn install +```bash +bin/rubocop ``` -### Usage - -Run the project with: - -**Using [docker](https://www.docker.com/):** +### Security scan -```sh -docker run -it {image_name} +```bash +bin/brakeman ``` -**Using [bundler](https://www.ruby-lang.org/):** -```sh -bundle exec ruby {entrypoint} -``` -**Using [npm](https://www.npmjs.com/):** - -```sh -npm start -``` -**Using [yarn](https://yarnpkg.com/):** +### JavaScript lint/format (examples) -```sh -yarn start +```bash +yarn eslint app/javascript --ext .js,.jsx +yarn prettier --check "app/javascript/**/*.{js,jsx}" ``` -### Testing +## Deployment -Taskfy uses the {ruby__test_framework} test framework. Run the test suite with: +The repository includes Docker and Kamal configuration. -```sh -rails test -``` -**Using [npm](https://www.npmjs.com/):** - -```sh -npm test -``` -**Using [yarn](https://yarnpkg.com/):** +Build a local image: -```sh -yarn test +```bash +docker build -t taskfy:latest . ``` ---- +Before deploying, review: +- `config/deploy.yml` +- `.kamal/secrets` -
โฌ† Return
+## Troubleshooting ---- +- **Port conflict:** `PORT=3001 bin/dev` +- **Dependency mismatch:** rerun `bundle install` and `yarn install` +- **Database reset:** `bin/rails db:drop db:create db:migrate`