This free to use REST API allows users to interact with the script of NBC's "The Office" by providing access to lines, episodes, and characters. You can search for specific lines, chat with characters, and retrieve random quotes from the series.
Frontend - VueJS
Backend - ExpressJS, PostgreSQL, Heroku, AWS RDS, Segment, Google Analytics
- Gets a random line from the entire series
- Gets a line from a character based on the user's input text
- Gets a random quote from a given season
- Gets every line for a given character, season, and episode
- Ensure you have Node.js and npm installed on your system.
- Navigate to the client folder in the project.
- Run
npm install
to install the necessary dependencies. - Run
npm run serve
to start the development server for the Vue.js app. - Now you can access the frontend at
http://localhost:8080
. Any changes you make in thesrc
folder will be automatically reflected in the development server.
- Navigate to the client folder in the project.
- Run
npm run build
to build the production-ready version of the frontend. - This will create a
dist
folder with the optimized assets for the frontend. You can then deploy this folder to a static hosting service like AWS S3, Netlify, or Vercel.
- Both the backend and frontend can be deployed separately.
- The backend can be deployed to any platform that supports Node.js, such as Heroku.
App.vue
: The main application component, which includes the main layout and imports other components.Sidebar.vue
: The sidebar navigation component, which allows users to navigate between different API endpoints.RequestForm.vue
: The component responsible for handling user input and displaying the API request and response.ExampleRequest.vue
: A component that displays examples of API requests and responses.
The backend is composed of an Express.js server and a PostgreSQL database:
- The Express.js server listens for API requests at theofficescript.com and serves the static files of the frontend.
- The PostgreSQL database contains the entire script of "The Office" organized by season, episode, character, line, etc. It is hosted on AWS RDS.
- Ensure you have Node.js and npm installed on your system.
- Run
npm install
in the root folder of the project to install dependencies. - Set up a PostgreSQL database, either locally or using a cloud provider like AWS RDS.
- Create a
.env
file in the root folder of the project and add the following variables with your database connection details:
DB_HOST=<your_database_host> DB_PORT=<your_database_port> DB_NAME=<your_database_name> DB_USER=<your_database_user> DB_PASSWORD=<your_database_password>
vbnet Copy code
- Run
npm run migrate
to create the necessary tables in your database. - Run
npm run seed
to import the data fromoffice-script.json
into the database. - Run
npm run start
to start the Express.js server.