- Full Stack Blog application where the user can create a post, read and delete, also add and delete comments.
- React-Hooks (no classes) and Hook-forms
- Express.JS
- PostgreSQL
- Material UI
The frontend environment of this project was bootstrapped with Create React App.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
$ psql -h localhost -U postgres -d postgres
postgres=# CREATE ROLE blog_user WITH LOGIN PASSWORD 'password';
postgres=# ALTER ROLE blog_user CREATEDB;
$ psql -h localhost -d postgres -U blog_user
or
$ psql postgresql://blog_user:password@localhost:5432/blogs_api
postgres=# CREATE DATABASE books_api;
postgres=# \c blogs_api
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
body VARCHAR(400) NOT NULL,
date_created TIMESTAMP
);
CREATE TABLE comments (
id SERIAL PRIMARY KEY,
post_id INT,
comment VARCHAR(255) NOT NULL,
date_created TIMESTAMP,
CONSTRAINT fk_blog
FOREIGN KEY(post_id)
REFERENCES posts(id)
);