This is the project template for Hack The Tunnels.
The project template utilizes React, TypeScript, Express, and Prisma.
Before you can set up the project, you will need to install Node.js.
To get the project working, you will need to have both the client and server running.
cd client
npm install
.env.sample
Create a copy of the .env.sample
file and rename the file's name to .env
.
npm run dev
cd service
npm install
.env.sample
Create a copy of the .env.sample
file and rename the file's name to .env
.
npx prisma migrate dev
npx prisma db seed
npm run dev
main.tsx
: Initialises app and describes routing for pagesclient/src/pages
: Where pages are storedclient/src/components
: Where components are storedclient/src/infrastructure/ServiceAPI
: Where Service API functions are storedservice/src/infrastructure/api/router.ts
: Main router locationservice/src/infrastructure/api/routes
: Where all other routers are storedservice/src/services
: Services are where business logic liveservice/src/infrastructure/db/schema.prisma
: This file is utilized by the Prisma ORM to generate migrations and typesid
: An auto-incremented integer serving as the primary key.title
: A string representing the product's title.description
: An optional string for the product's description.price
: A floating-point number representing the product's price.imageUrl
: An optional string for the product's image URL.lineItems
: A relation to the "LineItem" model, indicating that a product can be associated with multiple line items in orders.id
: An auto-incremented integer serving as the primary key.customer
: A relation to the "Customer" model, specifying the customer who placed the order.customerId
: An integer representing the customer's ID.lineItems
: A relation to the "LineItem" model, indicating that an order can have multiple line items.id
: An auto-incremented integer serving as the primary key.quantity
: An integer representing the quantity of the product in the order.cost
: A floating-point number representing the cost of the line item.product
: A relation to the "Product" model, indicating the product associated with the line item.productId
: An integer representing the product's ID.order
: A relation to the "Order" model, specifying the order to which the line item belongs.orderId
: An integer representing the order's ID.id
: An auto-incremented integer serving as the primary key.name
: An optional string representing the customer's name.email
: A string representing the customer's email address.orders
: A relation to the "Order" model, specifying that a customer can have multiple orders.id
: An auto-incremented integer serving as the primary key.email
: A unique string representing the email address associated with the account.password
: A string representing the account password.role
: A string representing the role of the account (e.g., ADMIN, USER). ADMIN users have all permissions.createdAt
: A timestamp representing when the account was created.updatedAt
: A timestamp that is updated whenever the account information is modified.Prisma Studio is the easiest way to explore and manipulate your data in all of your Prisma projects.
npx prisma studio