Auto theater server the GraphQL + Node.js version of the REST API build with Laravel 7.x and specifically done for an auto cinema application.
- Node
- Yarn v.1.22.4+
- PostgreSQL 9.5+
-
fork
the repository to your account. -
clone
yourfork
into your local machine. -
cd autotheater-gql-server
on your terminal. -
Run
yarn install
on your terminal to get all the dependencies used. -
Setup your database environment keep in mind that this server was made using PostgreSQL in mind.
-
Create a
.env
file as the followingDB_CONNECTION=pgsql DB_HOST=127.0.0.1 DB_PORT=5432 DB_NAME="autotheatergql" DB_USERNAME= "<your-username>" DB_PASSWORD= "<password>"
-
Run
yarn watch
to compile all the*.ts
files into*.js
. -
Run
yarn dev
, and you're ready to go server must be online onhttp://localhost:4000/graphql
.
This project uses TypeScript watch to compile the code to JavaScript for a faster load time and better optimazation for production
The npm scripts:
"scripts": {
"test": "npm run db:test && jest",
"watch": "tsc -w",
"dev": "nodemon dist/src/index.js",
"dev:ts": "nodemon --exec src/index.ts",
"start": "node dist/src/index.js",
"start:ts": "ts-node src/index.ts",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"db:populate": "ts-node src/seed.ts",
"db:test": "ts-node src/testUtils/setup.ts"
},
Keep in mind that using dev:ts will be slower because of the re-compiling step
The current data model is composed by:
- Roles
- Users
- Genres
- Classifications (Movies)
- Movies
- Likes (Movies)
- Locations
- Billboards
- Product_Types
- Classification_Products (Products)
- Products
- Rating (Products)
- Tickets
- Reservations
🔵 Primary Keys 🟠 Foreign keys 🟢 Dynamic API types for the frontend ⚪ Basic fields.
AutoTheater is licensed under the MIT license, developed and manatined by @rodzy