Giter VIP home page Giter VIP logo

asana-clone's Introduction

Introduction

CARL is a work-flow application to help users organize their tasks. Tasks can be assigned to specific projects where they can be organized into categories.

  • User must belong to a Team in order to be able to create projects and assign tasks

Live Link

C.A.R.L Work-flow Manager

Technologies

  • Database management
    • Sequelize ORM
    • PostgreSQL
  • Front-end development
    • React
    • AJAX
    • DOM manipulation
    • CSS
    • Bootstrap
  • Back-end development
    • Express.js
    • Express-session
    • Connect PG Simple
    • Csurf
    • Dotenv
    • Sequelize
    • Bcrypt
    • Unit tests written using:
      • Mocha
      • Chai
      • Cheerio
      • Moment
      • Sqlite3
      • Supertest
      • Umzug

Features

  • Professional landing page home-page

  • Drag-n-drop using React

  • Create and manage projects proj-CRUD-gif

  • Create and manage tasks tasks-CRUD-gif columns-CRUD-gif

  • Unit tests

    • Models exists and creates good instances
    • Cannot create instance with null values
    • Able to query the data using sequelize
    • Can successfully eager load data from associated table
    • Correctly set:
      • environment variables
      • sequelizerc configs
    • Correctly renders:
      • homepage
      • form elements with correct fields

unit-tests unit-tests unit-tests unit-tests

Technical Challenges

Front-end

  • Using custom CSS
  • Implementing modals into pages
  • Using autoplaying vidoe
  • Implementing JS to pug files
  • React Components
    • utilized React Beautiful DnD to create fluid, intuitive interactions with task cards in the browser
    • used node-fetch to persist data and positioning of tasks/columns to the database on dragEnd events
    • created several custom class-based React components for adding tasks/columns
class Column extends React.Component {
  render() {
    return (
      <Draggable draggableId={this.props.column.id} index={this.props.index}>
        {(provided) => (

          <ColumnContainer {...provided.draggableProps} ref={provided.innerRef}>


            <ColHeader>
              <Title {...provided.dragHandleProps}>{this.props.column.title}</Title>
                <ColumnOperation>
                  <form method='post' action={`${window.location.pathname}/${parseInt(this.props.column.id.match(/\d+/)[0], 10)}/delete`}>
                      <TaskDeleteBtn type='submit'><TaskOperation className='fa fa-trash'></TaskOperation></TaskDeleteBtn>
                  </form>
                  <a href={`${window.location.pathname}/${parseInt(this.props.column.id.match(/\d+/)[0], 10)}/edit`}>
                      <TaskOperation className="fa fa-pencil-square-o"></TaskOperation>
                  </a>
                </ColumnOperation>
            </ColHeader>


            <TaskAdd className="fa fa-plus" href={`${window.location.pathname}/${parseInt(this.props.column.id.match(/\d+/)[0], 10)}/tasks/create`}></TaskAdd>

            <Droppable type='task' droppableId={this.props.column.id}>
              {(provided, snapshot) => (

                <TaskList ref={provided.innerRef} {...provided.droppableProps} isDraggingOver={snapshot.isDraggingOver}>

                  {this.props.tasks.map((task, index) => (
                    <Task key={task.id} columnId={parseInt(this.props.column.id.match(/\d+/)[0], 10)} task={task} index={index} />
                  ))}


                  {provided.placeholder}
                </TaskList>
              )}
            </Droppable>

          </ColumnContainer>

        )}
      </Draggable>
    )
  }
}

Back-end

  • Sequelize
    • implemented custom models for users, teams, projects, and tasks
    • utilized Sequelize hooks to encrpyt and hash registration passwords using the bcryptjs package
    • used custom data validation to confirm data input
  • Authorization/Authentication
    • implemented express-session to track and persist end-user login state
  • Express
    • used Express to handle Restful API endpoints
    • created custom middleware to manage security on website
    • added routes to handle CRUD operations for users, tasks, teams, projects, and columns
  • Unit Tests
    • decided to use customized functions to create model instances instead of using separate seed file for test environment
async  function  testCreate(callback)  {
	let succeeded =  true;
	try  {
		await  callback();
	}  catch (e) {
		succeeded =  false;
	}
	return succeeded;
}

async  function  createModel(Model,  object)  {
	let instance =  null;
	await  testCreate(async  ()  =>  {
		instance =  await Model.create(object);
	});
	return instance;
}

const  passwordSample  =  'Abc1!'
function  userValues(o)  {
	return  {
		firstName:  str(20),
		lastName:  str(20),
		hashedPassword: passwordSample,
		email:  email(200),
		teamId:  Math.floor(Math.random() *  2),
		...o
	};
}
it('exists and creates a good instance',  async  ()  =>  {
	const  {  models,  error  }  =  loadModel('User');
	if (stopTest(errorMessage || userError || error)) return;
	const  {  User  }  = models;
	const  values  =  userValues({ teamId });
	succeeded =  await  createModel(User, values);
	if (!succeeded) return expect.fail(`Could not create an User with ${j(values)}`);
});

Future Implementation

  • Delete user
  • Allow users to have many teams
  • Allow a user to remove team members
  • Update unit tests so that it can log in to pass the test statements
  • Add Modals to edit tasks and create tasks
  • Allow users to create teams
  • Allow users to delete teams
  • Allow users to invite other users to team

asana-clone's People

Contributors

arol15 avatar aromjhee avatar colerutledge avatar rockyboyyang avatar

Watchers

 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.