A simple RESTful API built with TypeScript, Express, Prisma, and MySQL.
DATABASE_URL="mysql://janedoe:mypassword@localhost:3306/mydb"
JWT_SECRET="JWTSecret"
JWT_EXPIRES="2h"
PORT=3000
If you are using Docker for the database, follow these steps:
Example configuration:
version: "3.8"
services:
mysql:
container_name: mysql_server
image: mysql:8.3
restart: on-failure
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: admin123
MYSQL_DATABASE: app_database
volumes:
- mysql_data:/var/lib/mysql
networks:
- app_network
volumes:
mysql_data:
networks:
app_network:docker compose up -dThis command will:
- 🚀 Start a MySQL container named
mysql_server. - 🏗️ Create a default database named
app_database. - 🔒 Set the MySQL root password as
admin123.
npm installnpx prisma migrate dev✍️ give the migration
name
npx prisma generatenpm run buildnpm run startFor detailed API endpoints and specifications, see the API Documentation.