# elfTodos **Repository Path**: elfStack/elfTodos ## Basic Information - **Project Name**: elfTodos - **Description**: A simple to-do list hosted on a web server - **Primary Language**: JavaScript - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2016-07-12 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # elfTodos > A SPA to-do list, use vue.js and codeigniter > Notice that we do not do xss_clean and many controller did not check if user have privilege to some uri, because we only use this project in our dev team and do not want to fix it for the time being. ## Requirements Before running this app, make sure: 1. Your PHP version is bigger than `5.4` due to CodeIgniter 2. If you use apache server to offer api support, we use `[END]` in the `.htaccess` so `v2.4+` is preferred for apache, but 1. You can change `[END]` to `[L]` if your server do not support `[END]` 3. If you use nginx server, add the following rewrite rules in your `server` block: ``` if (!-e $request_filename) { rewrite ^/api/(.*)$ /api/index.php?/$1 last; } ``` ## How to run this app To run this in your computer 1. edit `./app/src/config.js` 1. make sure `apiPath` variable point to the codeigniter entrance ### dev cuz `npm run dev` starts a server on `localhost:8080` and do not support php so my solution is: 1. use `npm run dev` to starts the server 2. set up a server listening on `localhost:80` (mine is `elftodo.localhost`) to offer api support, that's why i use `apiPath` variable. 3. open browser and type `localhost:8080` to run the app. ### production if you use `npm run build` and get your file in `./app/dist/` you can run your app like this: 1. copy `./app/dist/*` to your server root. 2. copy the whole `./api` directory to your server root. 3. set up your server and make sure rewrite rules works 4. enjoy :) ## How to add a user We do not offer ui to add a user now you can add a user simply by sending a POST request. > notice that we do not authorize if user have privilege to create a user. ```bash curl -d "username={username}&password={password}&name={displayName}&group={group}" http://yourdomain/api/user/add/__do_bad_things__ ``` ## If your server do not support rewrite rules Simply edit the `apiPath` to `path-to-codeigniter/index.php?` such as `/api/index.php?` ## Build Setup ``` bash # install dependencies npm install # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build ## though now we do not write any tests # run unit tests npm run unit # run e2e tests npm run e2e # run all tests npm test ``` For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).