Welcome to the MochiDulce Creamery API! This API serves as the backend for an ice cream shop with a loyalty program. It manages user authentication, ice cream flavors, and sales data, providing a seamless experience for both customers and administrators.
Features:
-
User Authentication: Secure authentication mechanism using JSON Web Tokens (JWT) allows users to sign in securely and access protected endpoints.
-
Ice Cream Flavors: Manage a wide variety of ice cream flavors, including their names, carbohydrate content, and types (e.g., vegan, sorbet, dairy).
-
Sales Data: Track sales transactions, including quantity, price, date, and corresponding ice cream IDs, to analyze business performance and customer preferences.
The API utilizes the following database tables with their respective schemas:
Users: Stores user information such as username, password hash, and role.
IceCreams: Contains details about different ice cream flavors, including name, carbohydrate content, and type.
IceCreamSellings: Tracks sales transactions, including quantity, price, and date, along with references to the respective ice cream and user IDs involved.
The API provides endpoints for performing various operations:
Authentication Endpoints: /signup and /signin endpoints for user registration and authentication.
Ice Cream Endpoints: CRUD operations for managing ice cream flavors, including creation, retrieval, update, and deletion.
Sales Endpoints: Create and retrieve sales transactions, allowing administrators to track sales data effectively.
To set up the API locally, follow these steps:
- Clone this repository to your local machine.
- Install dependencies using npm install.
- Set up your environment variables, including database connection details and JWT secret.
- Run the server using npm start.
Node.js, Express.js, Sequelize ORM, PostgreSQL (or SQLite for local development). JSON Web Tokens (JWT) for authentication
Contributions are welcome! If you have any suggestions, bug fixes, or feature requests, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.





