Skip to content

Directory Information

Evan H edited this page Apr 22, 2024 · 22 revisions

Show/Hide Project Directory Structure

│toolshed-app
│
├── actions
│   ├── actions.js
│   ├── addNewUser.js
│   ├── adminActions.js
│   ├── customerActions.js
│   ├── squareActions.js
│   └── toolActions.js
├── app
│   ├── account
│   │   ├── giftcard
│   │   │   └── page.js
│   │   ├── membership
│   │   │   └── page.js
│   │   ├── profile
|   |   │   ├── error.js
│   │   │   └── page.js
│   │   ├── saved-cards
|   |   │   ├── error.js
│   │   │   └── page.js
│   │   ├── security
|   |   │   ├── error.js
│   │   │   └── page.js
│   │   ├── transaction-history
│   │   │   └── page.js
│   │   └── layout.js
│   ├── addcard
│   │   ├── layout.js
│   │   └── page.js
│   ├── admin
│   │   ├── customers
|   |   │   ├── createuser
|   |   │   │   ├── error.js
|   |   |   │   └── page.js
|   |   │   ├── edit
|   |   │   |   ├── error.js
|   |   |   │   └── page.js
|   |   │   ├── loan
|   |   │   │   ├── details
|   |   |   |   │   └── page.js
|   |   |   │   └── page.js
|   |   │   ├── search
|   |   |   │   └── page.js
|   |   │   ├── transactions
|   |   |   │   └── page.js
│   │   │   └── page.js
│   │   ├── dashboard
|   |   │   ├── layout.js
│   │   │   └── page.js
|   |   ├── inventory
|   |   │   ├── checkin
|   |   │   |   ├── product
|   |   │   |   |   └── page.js
|   |   |   │   └── page.js
|   |   │   ├── checkout
|   |   │   |   ├── product
|   |   │   |   |   └── page.js
|   |   |   │   └── page.js
|   |   │   ├── edit
|   |   │   |   ├── error.js
|   |   |   │   └── page.js
|   |   │   ├── new_item
|   |   │   |   ├── error.js
|   |   |   │   └── page.js
|   |   │   ├── search
|   |   |   │   └── page.js
│   │   │   └── page.js
│   │   ├── reports
|   |   │   ├── activemembership
|   |   |   │   └── page.js
|   |   │   ├── custom
|   |   |   │   └── page.js
|   |   │   ├── inactivemembership
|   |   |   │   └── page.js
|   |   │   ├── items
|   |   |   │   └── page.js
|   |   │   ├── loans
|   |   |   │   └── page.js
|   |   │   ├── maintenance
|   |   |   │   └── page.js
|   |   │   ├── membership
|   |   |   │   └── page.js
|   |   │   └── revenue
|   |   |       └── page.js
|   |   ├── dashboard.css
│   │   └── layout.js
│   ├── api
|   |   ├── getdata
│   │   │   └── page.js
|   |   ├── me
│   │   │   └── route.js
|   |   └── tools
|   |       ├── tool
|   |       │   └── route.js
│   │       └── route.js
│   ├── config
|   |   ├── db.mjs
|   |   └── nodemailer.js
│   ├── cronjob
|   |   └── page.js
│   ├── css
|   |   ├── components
|   |   |   ├── AdminDashboard.css
|   |   |   ├── AdminNav.css
|   |   |   ├── FeaturedTools.css
|   |   |   ├── Filters.css
|   |   |   ├── footer.css
|   |   |   ├── loans.css
|   |   |   ├── Navbar.css
|   |   |   ├── slideshow.css
│   │   |   └── UserProfile.css
|   |   ├── giftcard.css
|   |   ├── home.css
|   |   ├── inventory.css
|   |   ├── login.css
|   |   ├── product.css
|   |   └── signup.css
│   ├── giftcard
|   |   ├── layout.js
|   |   └── page.js
│   ├── inventory
|   |   ├── product
|   |   |   └── page.js
|   |   ├── layout.js
|   |   └── page.js
│   ├── login
|   |   ├── layout.js
|   |   └── page.js
│   ├── logout
|   |   └── page.js
│   ├── payment
|   |   ├── layout.js
|   |   └── page.js
│   ├── public
|   |   ├── data
|   |   |   └── slidedata.json
|   |   └── images
|   |       ├── loading.gif
|   |       ├── the-tool-shed-logo-transparent-bg.png
|   |       ├── toolshed_logo.png
|   |       └── visa.png
│   ├── sign-up
|   |   ├── error.js
|   |   ├── layout.js
|   |   └── page.js
│   ├── subscription
|   |   ├── layout.js
|   |   ├── page.js
|   |   └── subscription.css
│   ├── globals.css
│   ├── layout.js
│   ├── lib.js
│   ├── not-found.js
│   └── page.js
├── components
│   ├── account
|   |   ├── accountnav.js
|   |   ├── card.js
|   |   ├── cards.js
|   |   ├── ChangePasswordModal.js
|   |   ├── giftcard.js
|   |   ├── giftcards.js
|   |   ├── membership.js
|   |   ├── Profile.js
|   |   ├── security.js
│   │   └── Transactions.js
|   ├── admin
|   |   ├── customers
|   |   |   ├── AddTransaction.js
|   |   |   ├── CreateNewUser.js
|   |   |   ├── EditUser.js
|   |   |   ├── Search.js
|   |   |   ├── ViewAllUsers.js
|   |   |   ├── ViewLoanDetails.js
|   |   |   └── ViewUserLoan.js
|   |   ├── reports
|   |   |   ├── ActiveMembershipReports.js
|   |   |   ├── CustomReports.js
|   |   |   ├── InActiveMembershipReports.js
|   |   |   ├── ItemsReport.js
|   |   |   ├── LoanReport.js
|   |   |   ├── MaintenanceReport.js
|   |   |   ├── MembershipReport.js
|   |   |   └── RevenueReport.js
|   |   ├── tools
|   |   |   ├── AdminInventory.js
|   |   |   ├── CheckInTool.js
|   |   |   ├── CheckOutTool.js
|   |   |   ├── EditItem.js
|   |   |   ├── NewItem.js
|   |   |   └── SearchTools.js
|   |   ├── AdminSideBar.js
|   |   ├── CheckOut.js
│   │   └── dashboard.js
|   ├── Filters
|   |   ├── filters.js
│   │   └── sort.js
|   ├── Footer
│   │   └── Footer.js
|   ├── FormComponents
|   |   ├── newUserSchema.js
|   |   ├── signupform.js
│   │   └── statesSelect.js
|   ├── InventoryItems
|   |   ├── InventoryItems.js
│   │   └── InventoryItems.js
|   ├── Navbar
|   |   ├── AdminNavBar.js
│   │   └── Navbar.js
|   ├── PopularTools
│   │   └── PopularTools.js
|   ├── ProductItem
|   |   ├── CheckInItem.js
|   |   ├── CheckOutItem.js
│   │   └── ProductItem.js
|   ├── Slideshow
│   │   └── Slideshow.js
|   ├── Square
|   |   ├── Client.js
|   |   ├── Customer.js
│   │   └── Forms.js
|   ├── ToolCard
│   │   └── ToolCard.js
|   ├── Tools
|   |   ├── AllTools.js
│   │   └── OneTool.js
|   ├── BreadCrumb.js
|   ├── ErrorToast.js
|   └── Toast.js
├── Database
│   ├── accountmigration.py
│   ├── datamigration.py
│   ├── Needed_Queries.sql
│   ├── SEAC Tool Shed with Customer column.sql
│   ├── SEAC_Tool_Shed_Database_Schema.mwb
│   └── SEAC_Tool_Shed.sql
├── lib
│   └── registry.js
├── node_modules
│   └── ...
├── .eslintrc.json
├── .gitignore
├── Accounts_ToolShed.xls
├── Accounts_ToolShed.xlsx
├── env.download
├── Gate_Review_2_Tools.xlsx
├── jsconfig.json
├── middleware.js
├── next.config.js
├── package.json
├── README.md
├── SEAC_Tool_Shed_Inventory.xls
└── SEAC_Tool_Shed_Inventory.xlsx

Top Level Files

Top-level files are used to configure our application, manage dependencies, run middleware, and define environment variables.

  • next.config.js: Configuration file for Next.js.
  • package.json: Project dependencies and scripts.
  • middleware.js: Next.js request middleware.
  • .env.local: Local environment variables.
  • .gitignore: Git files and folders to ignore.
  • jsconfig.json: Configuration file for JavaScript.
  • Excel files that are used to organize the SEAC Tool Shed's current data for migration:
    • Accounts_ToolShed.xls
    • Accounts_ToolShed.xlsx
    • Gate_Review_2_Tools.xlsx
    • SEAC_Tool_Shed_Inventory.xls
    • SEAC_Tool_Shed_Inventory.xlsx

Top Level Folders

Top-level folders are used to organize our code base and separate the different functionalities necessary for our application.

  • /actions: Server action functions that can be used in Server and Client Components to handle form submissions and data mutations.

    • actions.js : Handles all of the logic that is needed for logging in as a current user, such as performing late tool payments, updating user information ie: changing passwords, or updating memberships and then querying the database as necessary.
    • addNewUser.js : Handles all of the actions necessary for creating a new user, such as adding the user to the database and sending an email for confirmation of account creation.
    • adminActions.js : Handles all of the actions that can be performed by users with access to the admin dashboard, such as processing check-ins, cancelling tool reservations, adding custom transactions, and confirming tool check-outs via email.
    • customerActions.js: Handles all of the actions that can be performed on the product page of each tool, such as creating a reservation of a tool and sending an email of confirmation of the tool being reserved.
    • squareActions.js: Handles all of the actions that are needed when interacting with the Square API, such as performing payments, memberships, and gift cards.
    • toolActions.js: Handles all actions that can be performed on tools, such as adding, deleting, and updating tools, and uploading any necessary files to the Amazon S3 Bucket.
  • /app defines all of the routes within the web application. Each folder is a route, containing either nested routes or the final user display. This excludes the app/css folder, which is used to organize all of the styling of the components within the application.

    • Each folder acts as a route segment. For example, app/giftcard is the /giftcard route.
    • Nested folders act as nested routes. For example, app/account/membership is the /account/membership route.
    • Within each of the route folders, there are specific file conventions that define the user interface:
      • layout.js: Defines the layout of the UI that is shared between routes.
      • page.js: Defines the UI that is unique to that route.
      • not-found: Defines the UI that is displayed when a route is not defined within a segment.
      • error.js: Defines an error UI boundary for a route segment.
      • global.css: Defines styling that is used across the entire application.
  • /components contains user interface components. Each subdirectory or file specifies the component that is being created for the user within the application. BreadCrumb.js, ErrorToast.js, and Toast.js are global components.

  • /Database contains necessary database-specific files. View the Source Code and the Database Schema page for more information.

    • The Python files accountmigration.py and datamigration.py are used to populate the database with the SEAC Tool Shed's current data from the Excel files.
    • The SQL files Needed_Queries.sql, SEAC Tool Shed with Customer column.sql, and SEAC_Tool_Shed.sql are used to create the application database.
    • The MySQL Workbench file SEAC_Tool_Shed_Database_Schema.mwb is used for documentation purposes and displays the application database schema.
  • /lib configures the necessary styling for the React data table third-party component that is used within the application.

Clone this wiki locally