- Node.js
- Express.js
- MongoDB
- Mongoose
- JSON Web Token
- bcrypt
- app
- models
- List.js
- Movie.js
- User.js
- routes
- listRoutes.js
- movieRoutes.js
- userRoutes.js
- auth
- verifyToken.js
- index.js
- db.js
- models
- node_modules
- package.json
- Handles CRUD operations for lists.
- Uses middleware verify for authentication.
- Supports creating and deleting lists.
- Supports fetching lists based on type and genre.
- Manages CRUD operations for movies.
- Also includes a route to get a random movie.
- Utilizes middleware verify for authentication.
- Allows updating, deleting, fetching movies by ID, and fetching all movies.
- Supports fetching a random movie based on type (series or movie).
- Handles user-related operations like updating, deleting, and fetching users.
- routes for user authentication like logout and logout from all devices.
- Provides functionality to get user statistics.
- Uses middleware verify for authentication.
Follow these steps to set up your local environment for the Netflix-API:
-
Clone the Repository: Clone this repository to your local machine:
git clone https://github.com/alin00r/Netflix-API.git cd Netflix-API
-
Install Dependencies: Run the following command to install all the required dependencies:
npm install
-
Configure Environment Variables:
Before you can run the Netflix-API, you need to set up your environment variables. These variables store sensitive information required for the app to function properly. Follow these steps to configure your environment variables:
-
Create a
.env
File: In the root directory of the app, create a file named.env
. -
Add the Following Environment Variables: Replace the placeholders with your actual information. You might need to sign up for accounts and services to obtain the required credentials.
# MongoDB Configuration DATABASE_URI=your-mongodb-database-url # JSON Web Token Configuration SECRET=your-json-web-token-secret
-
During API development, I use Postman
for handling/testing all endpoints.
- Postman collection/documentation is available on this link click here
- Base URL endpoints:
http://127.0.0.1:5000/api/V1/
orhttp://localhost:PORT/api/v1/