Giter Club home page Giter Club logo

doocrate's Introduction

CircleCI

Doocrate

You can read more about it in https://website.doocrate.com/

Try the demo at https://staging.doocrate.com A task management system which allows user to self assign themself So normally you don't have permission unless you create a task or assign yourself to a task. This allows organization to manage tasks in a TEAL way

Documentation

https://docs.doocrate.com/

Stack

  • React, Redux, Thunk, React Router, Node
  • Firebase Firestore

Needed

NVM Node v10.19.0

Quick Start

Install

source ./intall.sh

or

git clone https://github.com/metaburn/doocrate.git
cd doocrate
nvm use
yarn
cd functions
npm install
cd ..
yarn run copy-staging
yarn global add firebase-tools

Run Locally

nvm use
yarn run

Deploy command

yarn run deploy:staging OR yarn run deploy:production Will build - use the correct config file and deploy

Staging

You can also set staging env and use: firebase use --add to add your staging site Then run like yarn run build-staging firebase use staging yarn run deploy:staging

Build and deploy the app:

cd functions
npm install
cd ..
yarn
firebase login
firebase use default
yarn run deploy:production
// And if you want only to deploy without building you can run firebase deploy

Deploy only server functions

You can use the following to deploy faster

yarn deploy:staging-only-server

Setting up your own server

Only If you are interested in setting up your own server (That is your own doocrate.com on a different domain)- read Setting Up your own server

Translations

You can find translations under public/locales/

You can open the page with the required language. For example use http://localhost:3000/sign-in/?lng=he to open the hebrew version http://localhost:3000/sign-in/?lng=en to open the english version

Firestore rules

Rules are a way to restrict access to the database and give different users different permissions For example - Anyone can create a task. But only a task creator (And assignee)can edit a task

Whenever you publish the project the firestore.rules page would get updated Then hit Publish to save it

Creating index

After the system is up: Create a new task And also create a new comment. If you open the console you would get a link with something like:

database.js:944 Uncaught Error in onSnapshot: Error: The query requires an index. You can create it here: https://console.firebase.google.com/project/doocrate-2018/database/firestore/indexes?create_index=Eghjb21tZW50cxoKCgZ0YXNrSWQQAhoLCgdjcmVhdGVkEAIaDAoIX19uYW1lX18QAg

Click that link to create the indexing for it

Labels Colors

Create a collection named labels In order to create labels colors you need to create a collection called 'labels' with documents like so: Set for Document Id - The actual tag name - for example - "art" Then inside have a field "name" with value "art" and another field "colorInHex" with color value. For example "EB1478" - This will color all label of type "art" with color "EB1478"

Schema

Schema

To update the schema, you can load the Schema.xml file into draw.io Docs

Labels

Under src/config/app-config you have the popular labels that would appear when someone creates a task

Backup

Downloag gcloud: https://cloud.google.com/sdk/docs/downloads-versioned-archives

To backup you first need to create a new multi regional bucket - for example - doocrate-new-backups

Then, Run the following command to backup - gcloud alpha firestore export gs://doocrate-new-backups

Restore from backup

Import all by calling gcloud alpha firestore import gs://[BUCKET_NAME]/[EXPORT_PREFIX]/ where [BUCKET_NAME] and [EXPORT_PREFIX] point to the location of your export files. For example - gcloud alpha firestore import gs://exports-bucket/2017-05-25T23:54:39_76544/

Import a specific collection by calling: gcloud alpha firestore import --collection-ids='[COLLECTION_ID_1]','[COLLECTION_ID_2]' gs://[BUCKET_NAME]/[EXPORT_PREFIX]/

Stop the system

You can user the /admin/dashboard page if you are an admin to set permissions You can press on the button their - This would go over all the users in the system and would set the "canCreateTask, "canAssignTask" permissions which allows to create new tasks and assign / unassign themself

YARN Commands

Script Description
yarn start Start webpack development server @ localhost:3000
yarn backup Backup to a local database
yarn run deploy:staging Build and deploy to staging
yarn run deploy:production Build and deploy to production
yarn run build Build the application to ./build directory
yarn test Test the application; watch for changes and retest

FAQ

What are projects

User is the root for a task. Each task exists within a project

What are Admins

Admins can edit any task under a project. Once a user creates a new project he is added into the admins admins->user id->projects->project id This helps us know which admin belongs to which projects

What are Super Admins

Super Admins can edit any task under ANY project. These are root level admins. They are defined manually in the collection super_admins -> UID

Why is Mail is not being sent?

Check that you are on the blaze (Pay as you go) plan. Otherwise external services such as mailgun aren't accessible. Don't worry. Firebase won't charge money unless you have > 10000 users from our calculations

Also, Check that all the settings are correct and you have created a mailgun username and set up the domain correctly

Is there a reports page

Yes /:project-id/reports

Is there a super admin page

Yes. /admin-dashboard

I'm getting this error:

                 /databases/(default)' is not a valid HTTP header field value.

1.Make sure you set up Firestore database by activating it in firebase console

2.Make sure that your config doesnt have a wrong char such as \n in the end: `projectId: 'doocrate-production\n',

Where is the backend?

Located under the functions folder (This is firebase standard)

How can I deploy in a fast way

If you haven't modified the functions folder you can run the following to deploy only the app without the functions: yarn run build && firebase deploy --only=hosting

Why am I seeing the loader runs and runs on a new install

Only when there is at least one task it would stop running - Press on add task

Is there a way to close the system on the frontend side

Yes - under src->config->app-config set the parameter isSystemClosed to true

Is there a way to open / close new users from openning / assigning tasks

Yes - Each project now has ability to set it under edit project page

Comments are not working

Check you console. You need to follow the error using the link and create an index for comments

Can I deploy only the hosting without the functions?

Yes run

yarn run build
firebase deploy --hosting

User redirection

Yes done through a cookie is_redirected and a url for example ?project=adacontra-2019

I'm having issue running npm install

Make sure you use the correct node by running: nvm use

Do you have any unit tests?

Yes we do. We also have firestore rules unit tests yarn run test:firestore-rules

doocrate's People

Contributors

0xori avatar carloscuatin avatar dependabot[bot] avatar franciscofsales avatar guyavraham avatar jurij avatar matanzr avatar nimast avatar nirbenita avatar psychuil avatar r-park avatar rootux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

doocrate's Issues

Comments

1.Ability to edit your comment
2.Ability to delete your comment
3.Some UI with ability to Delete Comment - No need to edit a comment right now.
4.Nice to have - When user presses Enter or Bold - Could be nice to allow it - Really a nice to have

Add ablity to set user phone - [8h-14h]

Description

When a user register (signs in) - he can set his phone number - that field should be above bio field.

When a task creator, dreamer, guide, admin is looking at a task - he can see the phone number of that user for example - "0501234566 This info is visible only to you"

Things to notice

Security wise - we must make sure that this info is not visible to anyone else

Add i18n support

Right now we support hebrew - we should localize all the strings - get RTL vs LTR from language and support english.

Comments on new tasks

Open existing task with comments
Create a new task.
When creating a new task user can see comments of the old existing task.

Suggested labels stuff

  • remove existing labels from suggested lables.
  • don't allow duplicated labels in label field

Tasks Pagination

Right now we are loading all tasks - When we'll scale we might need to use pagination

Ability to jump directly to a task using url

Ability to use the url to jump directly to a task
So users can share a url with the actual message.
Could be nice if when user "Selects a task" then the url changes with the task id
(Look at how filtering works)

Label and label search

Make sure that labels are saved without any extra trailing characters (such as spaces).

Also when searching make sure that no trailing characters are in the labels

Edit a task

Please refer to #1 to see relevant fields

  • Only the Creator / Assignee could edit a task

Create a new Task

Create a new task:

Set the creator to the auth user who created the task.
Same page will be used in the edit task
All fields are optional but the Task name and description and label

Task should have:

  • Task name (aka title) - משימה
  • Description - תיאור
  • Label ( could have multiple labels) - תגית
  • Creator (user based on firebase oauth used id) - יוצר המשימה
  • Assigned to (user) (Creator can assign a task to himself) - ממלא המשימה
  • Special comments (From the creator - The creator is the only one that could edit those) - הערות מיוחדות מהיוצר
  • Special comments (From the community - This field is opened for all) - הערות מיוחדות מהקהילה
  • Relevant contacts - Free text - אנשים רלוונטיים
  • Assigned to user phone - The phone number of the user assigned to it
  • Status - Free Text - סטטוס
  • Due date - Date - תאריך יעד
  • Circle (Enum of - Or, Amir, Michael) - מעגל - Can only be edited by admin - מעגל
  • Critical mission (A field that can only be edited only by Admins) - האם המשימה קריטית

My space issues

New design for my space.

Known issues - would love your help @netanelben - under auth.js I've added :

// Update local auth
// TODO - ideally this would fire again an init auth so the local auth object would update
Object.assign(authUser, userSnapshot.data());
authActions.initAuth(newUserData);

I'm trying to get the reducer to have the new data but failed to do so. Would love your advise. I've also tried with adding a dispatch. I'm missing something here.
Attaching a link to the movie of the experience caused by not firing it
https://drive.google.com/file/d/1z9l9spjmoVmp7nP4ycRTi6zBnqBAoPFs/view?usp=sharing

Tasks Filtering on the backend

Right now we are loading all the tasks and filtering on the client.
I believe a better approach would be to filter on the backend.
We can use the query field on the firebase-list to do that in some way

Create a better invite system

Invite improvements

1.Should be simply and should be visible always at the top of the project for the project creator

Something like that (Needs better design) - Hovering over the top - having a big invite button
Screen Shot 2019-12-01 at 12 25 02
Screen Shot 2019-12-01 at 12 25 07
Clicking the invite button should open a popup showing all users and allowing you to invite more users by entering their email (Or a click to enter into the invite users page) - needs design

Popup design
Screen_Shot_2019-11-15_at_22 55 17

  1. An email should be sent upon creating a new project / becoming an admin (There is a serverless function that adds a user to admin list) - this email should include our admin guide - https://docs.doocrate.com/doocrate-admin-guide - Needs design

  2. Update our admin guide so it would includes that new invites system

Add a custom field type - [6h-12h]

Description

As an project admin - we can set custom fields. Currently, they are only free text.
(See image from editing a project to see the current state) - תאריך, שם ההתארגנות
Screen Shot 2020-08-12 at 17 08 02

We want to support adding custom field types - specifically "Multiple choice" (select) with known entries.
Also we want to be able to later on filter by that custom field.

TLDR -

  • Add custom field type
  • We can set it to be “Multiple choice”
  • Default is “Short Text”
  • We can checkbox whether or not to filter by it

Show on front page - should be "Allow filtering" - Seting this to true should show this field under the filter area
Screen Shot 2020-08-12 at 15 36 50

User should open a task only when he really saves it

Right now we are opening a "New task" whenever user presses on "New task" - Which may lead to a clutter when we scale and many users will use it.
Instead perhaps we should only "Create the actual task" when we start filling the task title.

P.S - Task title should be a must field (On the rules and on the client)

Assign myself

Ability to assign myself to a task (Only if no one is assigned to it)

If I already have a task then we should display an error using notification - Cannot assign to more than 1 task at this moment

Add support for anyone to open a project of doocrate [20h]

Add a button "Create event" - upon press an event would be created.
TBD - what files / models are affected.
TBD - what work needs to be done for this feature to happen

  • Create a new model - Project:
    • Id
    • Name
    • Url - my-project-name. for example - www.doocrate.com/my-project-name

  • All collections should now have a root collection - Project - Firebase Collection should now encode the actual project when loading the collection.
    CC: @matanzr

  • All handlers should now be project sensitive - so new task is now -

  • New task - https://doocrate.burnerot.com/task/new-task
    instead it should be https://doocrate.burnerot.com/MY-PROJECT/task/new-task

  • Existing tasks - /task/UID -> /MY-PROJECT/task/UID.

  • Sending emails should have the project encoded and the link to the project from which data was sent.

  • limit task per creator cloud function should be based on project

  • Permissions - firestore rules - for projects who can open them how it became an admin

  • Bonus - we have a bug that creates a lot of updates and reads which now (For production 1000 tasks. 1700 users) creates a 50 nis a month fee. Need to handle it to allow scaling so we won't have hugh server costs in case of an explosion

Time estimation - 20 hours

Add color for label

Each label would have her color.
Need to think about data flattening and how it effect it

Make the grid more responsive

As it stands now, the grid items have a fixed width no matter how much margins are created on the side. I would like to have the grid items expand to fill as much space as they have.

Filter by labels

Ability to filter tasks by single, multiple labels

So for example - Filter all the "Art" tasks

Bonus points - if filtering happens on the db end

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.