Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/otumian-empire/sample-practice-project-todo-app-nodejs
https://github.com/otumian-empire/sample-practice-project-todo-app-nodejs
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/otumian-empire/sample-practice-project-todo-app-nodejs
- Owner: Otumian-empire
- Created: 2020-08-03T10:18:19.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T12:51:01.000Z (about 2 years ago)
- Last Synced: 2023-03-11T12:53:05.534Z (almost 2 years ago)
- Language: JavaScript
- Size: 115 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Todo app
This is a simple todo app, from [The Net Ninja](https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp) node js tutorial on youtube, where he'd use mongo but I used postgres instead.
## What's different
Nothing special
* Used postgres
* Change ajax route/url, from `todo` to `/`
* Delete item by `id` instead of the `items` text
* Passed the item `id` as the `id` of the list item## Requirements
* postgres
* nodejs## Depedencies
Dependencies are in the package.json file## How to set up
* open terminal and cd into where you'd like to put this app
* clone repo, `git clone https://github.com/Otumian-empire/sample-practice-project-todo-app-nodejs.git`
* change into the root dir, `cd sample-practice-project-todo-app-nodejs`
* create a `.env` file, `touch .env`
* add the content as follows:```
PGHOST='localhost'
PGUSER='postgres'
PGDATABASE='todo_db'
PGPASSWORD=
PGPORT=5432
```
> Change PGUSER and PGPASSWORD* Now, create database and table
* Still on the terminal, enter, `psql postgres` or `psql `
* Open, copy and paste the sql statement from the `.sql` file from the root dir, a line after the other.which should help create the database and table.
* Or you may open pgAdmin, create a server if you don't have one
* create a database and copy and paste the query to create the table into the query tool and run it.* install dependencies, `npm i`
* open, `localhost:3000/` in browser