Skip to content

AntonStrand/1DV610-L2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1DV610

My solution for 1DV610. It fulfills 100% of the automatic tests.

It is a todo app and you can find it here: 1dv610.antonstrand.se

Use cases

All use cases are implemented.

  1. UC1 Add a todo item
  2. UC2 List todos
  3. UC3 Complete a todo

Test cases

All tests are successful.

  1. Test for Use case 1
  2. Test for Use case 2
  3. Test for Use case 2

How to get started

This guide assumes that you know how to set up a php project and will only get into specifics to this project.

1. Create database

First, create a database and add a table for users, cookies and todos. You can use the SQL snippets below to speed up this process.

SQL for creating users table

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(128) NOT NULL,
  `password` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

SQL for creating cookies table

CREATE TABLE `cookies` (
  `id` int(11) NOT NULL,
  `username` varchar(128) NOT NULL UNIQUE,
  `password` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

SQL for creating todos table

CREATE TABLE `todos` (
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `username` varchar(128) NOT NULL,
  `task` text NOT NULL,
  `isComplete` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

2. Create a Settings.php

Create a Settings.php in the root folder. Use the template below and change the information to fit your setup.

<?php
class Settings
{
    public static $HOST = 'localhost';
    public static $USER = 'user';
    public static $PASSWORD = 'password';
    public static $DB = 'dbName';
}

About

My solution for L2 in LNU course 1dv610

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages