This is the backend for the Teatro Musicado SP project, a Node.js application for managing the related data.
- Node.js (version 18 or higher)
- npm or yarn
- MySql 8.1
-
Clone the repository:
git clone <repository-url> cd teatro-backend -
Install dependencies:
npm install
Create a .env file in the root directory with the following variables to configure the database connection (refer to env_example.txt for a template):
TYPEORM_HOST: Database host (e.g., localhost)TYPEORM_USERNAME: Database usernameTYPEORM_PASSWORD: Database passwordTYPEORM_DATABASE: Database nameTYPEORM_PORT: Database port (e.g., 3306 for MySQL)NODE_ENV: Environment (e.g., development, production)
Example .env file:
TYPEORM_HOST=localhost
TYPEORM_USERNAME=root
TYPEORM_PASSWORD=password
TYPEORM_DATABASE=teatro
TYPEORM_PORT=3306
NODE_ENV=development
- Ensure the database is set up and running.
- Start the server:
Or for development:
npm startnpm run dev
The server will run on the port specified in the configuration (default is 8089).
Run tests with:
npm test
Refer to the API files in the api/ directory for endpoint details.
Please follow standard Git practices and ensure all tests pass before submitting changes.