Project Structure
This section provides an overview of Project Structure.
As mentioned before the repository contains a directory called /apps
and inside of it our projects /backend
and /frontend
,
let's go deeper on each of them.
Backend project
Here we have a NodeJS project and it contains the core functionalities for the assistant to work properly.
Folder structure:
- /ai: Contains helper functions responsible for api requests for important A.I. functionalities, like calling the OpenAI endpoints.
- /appointments: Contains helper functions responsible for handling appointments on Google Calendar API.
- /controllers: A few controllers related to company, appointments and client information.
- /db: Contains helper functions for Firestore DB for handling tokens.
- /email: Exports helper functions for email communications.
- /google: Implements functions to handle Google API to manage events on Google Calendar.
- /whatsapp: Contains the WhatsApp API implementation and the algorithm to handle interations with the A.I.
The server.js
file contains all the endpoints used by the frontend.
fbAuth.js
contains firebase authentication middleware.
config.js
is where we export all our environment variables.
Frontend project
Here we have a NextJS project and it contains the UI interfaces to handle the functionalities implemented on the backend. Here's where you'll be able to sign up to create your company account and have a dashboard to track appointments booked by the A.I. and handle the WhatsApp sessions on your phone number.
In terms of folder structure, here are the ones you most need to care about:
- /app: Since its an
app router
project here you'll find all the routes available like the main one represented by the rootpage.tsx
followed by dashboard, google and signup. - /components: Contains all the UI components available on the project, it uses Tailwind and @nextui-org components ready to use.
- /lib: Here's where Redux global state is implemented.
- /app/dashboard: Contains the dashboard UI.
- /app/google: It's a public page used by the backend to redirect the user back to the app with Google information.
- /app/signup: Implements the sign up flow using next actions to redirect the user to the next steps, it was designed to be an easy way for you to set up your user interactively.
The env.local
only need to export NEXT_PUBLIC_BACKEND_URL
variable for now, it must contain your backend local
server that should be http://localhost:8383/
.
Conclusion
Both projects are easy to be customizable so you are free to modify it to meet your business needs.