A RESTful API for managing a movie database with user authentication and authorization.
- User athentication and authorization using JWT
- Movie information management (CRUD operations)
- User profile management
- Favorite movies list per user
- Cross-Origin Resourse Sharing (CORS) enabled
- API documentation using JSDoc
- Node.js
- Express.js
- MongoDB & Mongoose
- Passport.js (JWT & Local Strategy)
- JSDoc for documentation
- Clone the repository:
git clone <repository-usl>- Install dependencies:
npm install- Create a .env file with:
CONNECTION_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret4.Start the server:
npm startGET /movies- Get all movies (requires authentication)GET /movies/:id- Get movie by IDPOST /movies- Add new movie (admin only)PUT /movies/:id- Update movie (admin only)DELETE /movies/:id- Delete movie (admin only)
POST /user- Register new userPOST /login- User loginPUT /users/:Username- Update user infoPOST /users/:Username/movies/:MovieID- Add favorite movieDELETE /users/:Username/movies/:MovieID- Remove favorite movie
npm start- Start the servernpm run dev- Start with nodemonnpm run docs- Generate documentation
- express - Web framework
- mongoose - MongoDB ODM
- passport - Authentication
- jsonwebtoken - JWT implementation
- bcrypt - Password hashing
- nodemon - Development server
- jsdoc - Documentation generator
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License