A RESTful backend service for a movie theater application. This API supports retrieving movie information, theater showings, and user reviews.
- Node.js
- Express.js
- Knex.js
- PostgreSQL
- Render (for deployment)
-
Clone the repository:
git clone https://github.com/jkfaris94/WeLoveMovies-back-end.git cd WeLoveMovies-backend -
Install dependencies:
npm install
-
Set Up Environment Variables
env DATABASE_URL=postgresql://username:password@localhost:5432/we_love_movies Run database migrations and seeds:
-
Run Migrations and Seeds
npx knex migrate:latest npx knex seed:run
-
Start the server:
npm start The app will default to http://localhost:5001
GET /movies – List all movies
GET /movies?is_showing=true – List currently showing movies
GET /movies/:movieId – Read movie by ID
GET /movies/:movieId/theaters – Theaters showing a movie
GET /movies/:movieId/reviews – Reviews for a movie
GET /theaters – List all theaters and their movies
PUT /reviews/:reviewId – Update a review
DELETE /reviews/:reviewId – Delete a review
npm start – Start the server
npm run dev – Run with nodemon
npx knex migrate:latest – Apply latest migrations
npx knex migrate:rollback – Roll back last migration
npx knex seed:run – Seed the database
DATABASE_URL = PostgreSQL connection string
PORT = Port the server listens on (optional)
Built by @jkfaris94
Feel free to open an issue or PR if you'd like to contribute or report a bug.