This is a RESTful API that provides information about movies, genres, and directors. Users can create an account, update their information, and manage a list of favorite movies.
- Users can sign up, log in, and update their profile.
- Retrieve details about movies, genres, and directors.
- Manage a list of favorite movies.
- Secure user authentication with JWT.
- Node.js: Runtime environment
- Express.js: Framework for building the API
- MongoDB: Database for storing movie and user data
- Mongoose: ODM for MongoDB
- JWT: Secure authentication
- bcrypt: Password hashing
-
Clone the repository:
git clone https://github.com/samanthasbytes/movie_api.git
-
Install dependencies:
npm install
-
Set up environment variables:
-
Create a
.env
file in the root directory with the following:PORT=your_port DB_URI=your_mongoDB_uri SECRET_KEY=your_jwt_secret
-
-
Start the server:
npm start
-
Use
nodemon
for automatic server restarts during development:npm run dev
Method | Endpoint | Description |
---|---|---|
GET | /movies |
Get a list of all movies |
GET | /movies/:title |
Get data about a single movie |
GET | /genres/:name |
Get movies by genre |
GET | /directors/:name |
Get movies by director |
POST | /users |
Register a new user |
PUT | /users/:username |
Update user information |
POST | /users/:username/movies/:movieId |
Add movie to favorites |
DELETE | /users/:username/movies/:movieId |
Remove movie from favorites |
DELETE | /users/:username |
Delete user profile |
This project is licensed under the MIT License.
--
This README was generated by ChatGPT-4o using the prompt "Create a README for this project https://github.com/samanthasbytes/movie_api.git"