Giter Site home page Giter Site logo

task-and-purpose's Introduction

Overview

Task and Purpose is a minimal task management application.

It consists of 3 modules: Api, Web, and Native.

Ruby

You will need to have ruby version 2.7.4 installed. I recommomend using rbenv or some other ruby version manager.

Node

I've tested this application with node version v16.17.0. Other versions may work, but YMMV. I recommend using nvm or some other node version manager.

image image

Api

The api is a Rails application that exposes a GraphQL endpoint at http://localhost:3001/graphql

Installing Dependencies

You can install the ruby dependencies via bundler with

cd api
bundle install

Creating and Seeding the Database

The database we're using is Sqlite. You can create and seed the database with

cd api
bundle exec rails db:setup

Models

Task is the only Active Record model in the project. It only has 2 notable fields name and complete. You can see the database schema at api/db/schema.rb.

GraphQL

GraphQL is implemented with the graphql gem. It is the only notable gem in the project, and you can find the documentation here.

Task is the only type on the graph, and you can find the definition at api/app/graphql/types/task_type.rb.

You can see the queries defined on the graph at api/app/graphql/types/query_type.rb. The only query implemented is tasks which just returns as list of all the tasks in the database.

There are three mutations implemented that you can find in api/app/graphql/mutations/. These are create, update, and delete actions for the Task model.

There is a Graphiql instance installed at http://localhost:3001/graphiql.

Action Mailer

Action Mailer is the Rails module that allows you to send emails from the backend. If you've used Rails before, you are likely familiar with Action Mailer. If you have not, fear not. You can get up to speed using this guide.

You will find an example of a mailer implementation at api/app/mailers/task_mailer.rb and its corresponding view at api/app/view/task_mailer/example_email.html.erb. Feel free to extend this mailer or create your own.

The development environment is configured to use Letter Opener and Letter Opener Web to simulate sending emails without connecting a real SMTP server. These libraries will allow you to see all the emails you've sent on a virtual inbox by visiting http://localhost:3001/letter_opener.

If you'd like to test that out, open a Rails console with the following:

cd api
bundle exec rails c

Then fire off an email with:

TaskMailer.with(task_id: 1).example_email.deliver_now

You should be able to see your email at http://localhost:3001/letter_opener.

Starting the server

You can start the application with

cd api
bundle exec rails server -p 3001

Web

The web client is a standard React application created with Create React App.

There are a 2 notable libraries:

Installing Dependencies

You can install the javascript dependencies via npm with

cd web
npm install

Starting the Web Client

You can start the application with

cd web
npm start

The web client should be available at http://localhost:3000

Native

The native client is a standard React Native application created with Create React Native App.

There are a 2 notable libraries:

Installing Dependencies

You can install the javascript dependencies via npm with

cd web
npm install

Starting the Native Client

You can start the application with

cd native
npm start

Follow the instructions on the screen to run the application in your prefered environment (iOS simulator, Android simulator, etc.).

task-and-purpose's People

Contributors

mattwalters avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.