Giter VIP home page Giter VIP logo

todo's Introduction

Todo CI

This is the last straw. You just can't stand it anymore. You're tired of trying to scrawl down your to-do items on a piece of notebook paper with a pen that doesn't work. You've been doing this for such a long time because you really value your privacy. But wouldn't it be great if you could track everything with an app that empowers you to accomplish more?

Todo is the app that's here to save the day. It's free and open source software so you can easily deploy your own instance and have control over your own data. Isn't that awesome?! Todo supports login for multiple users, so you could setup an instance for your family, workplace, etc.

Why a to-do app? The author is working on this application in order to learn Phoenix LiveView and Tailwind CSS for web application development. A multi-user to-do app covers quite a bit of ground in learning a web framework.

How to Build

In order to build the application, you'll need to install the following software (if you haven't already):

Clone the repository and then navigate your terminal to the todo directory.

You'll need to install application dependencies with the following command:

mix deps.get

Then you can setup a development database like this:

mix ecto.setup

Finally, you can fire up the server as such:

mix phx.server

Now you can visit localhost:4000 from your browser!!

Testing

In this project, we utilize test-driven development to ensure that new features correctly handle our expected use cases. Therefore, it's usually a good idea to write a few tests for a new feature before we implement the feature. This also improves developer efficiency; if your test cases are thorough enough and passing, then your implementation is more likely to be correct!

Our test suite consists of unit tests and integration tests. A unit test verifies the correctness of a function (without side effects). This means that, given some input, a function should always produce the same output. In contrast, integration tests allow us to test how our code interacts with its environment. This enables us to verify that our code behaves correctly given, say, the state of the database or the state of the browser.

In order to run the test suite, just run the following command:

mix test

Continuous Delivery

There is a GitHub Actions workflow that builds and tests the code on any pull request to the main branch. This helps us to prevent bugs from reaching main because the code must compile and pass test cases before a merge is allowed. If we ever setup an official instance, we could setup automatic deployment on pushes to main.

Database

Todo utilizes Ecto to interact with PostgreSQL. To learn more about Ecto, please visit the official documentation.

You can configure database connection parameters in the /config directory. Specifically, you can update dev.exs for local development and test.exs for the test environment. For the production environment, it is recommended to set the value DATABASE_URL in runtime.exs as a system environment variable to protect the security of your credentials.

Deployment

To learn how to deploy the app, please visit the official documentation.

Architecture

Todo is built on the standard MVC architecture common to most Phoenix applications. There is a very particular directory structure that indicates precisely where each different piece goes; here is more information if you'd like to learn more. In fact, I'd recommend reading through most of the official Phoenix guides if you haven't already. Todo follows the recommended best practices given by that documentation... and honestly, the documentation is so good that it's going to be the best reference for any questions you have.

todo's People

Contributors

nskins avatar

Stargazers

Roman avatar

Watchers

James Cloos 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.