This toy project was created to display a book catalog. And sets itself the following tasks:
-
Initialize the database;
-
Create server;
-
Create web-client.
In this project, Postgres selected as the DBMS.
Use psql client (manually):
-
Create database 'catalogue';
-
Open terminal window, and type:
sudo -i -u postgres;
psql catalogue;
-
Create tables:
create_tables.sql
-
Load data for tables:
fill_tables.sql
-
Create function and procedures:
f_1.sql, f_2.sql, f_3.sql
-
Create triggers:
t_1.sql, t_2.sql
You can also find examples of sql database queries in database/sql_queries.sql
The server side of the application is written using Node.js, GraphQL and Sequelize.
Other libraries used in the project can be found in server/package.json
.
Use yarn (package manager):
- Clone repository;
yarn
to install all dependencies;- Edit .env and apply your db connectivity settings;
yarn dev
to start the API server;- GraphQL Playground now at
http://localhost:5000/graphql
; (you can change PORT in .env)
The client side of the application is written using TypeScript, React.js, GraphQL, Apollo.
cd client
yarn
to install all dependencies (seepackage.json
);yarn apollo:generate
to create type defs for Apollo;yarn start
to start web-app (PORThttp://localhost:3000/
;