This is a robust, versatile starter template designed to accelerate the development of scalable Express applications integrated with TypeScript, Prisma ORM, and Redis caching. It focuses on clean architecture and full-stack functionality with essential backend technologies, including user authentication, database schema management, and more.
- TypeScript Configuration ✅
- Authentication Logic
- Prisma ORM ✅
- Database Connection ✅
- Folder Structure ✅
- User Implementation ✅
- Sample Relation Implementation ✅
- ESLint Configuration ✅
- Environment Configuration ✅
- Logging Infrastructure
- Data Validation ✅
- Testing Suite
- CI/CD Integration
- API Documentation
- Security Enhancements
- Error Handling Middleware
-
Clone the Repository:
git clone <repository_url> cd <repository_directory>
-
Install Dependencies:
npm install
-
Set Up Environment Variables: Create a
.env
file in the root directory with the following content:PORT=3000 DATABASE_URL="mysql://root:express_app@localhost:3307/express_app_db"
-
Run MySQL in Docker: Execute the following command to run a MySQL database in a Docker container:
docker run --name my-mysql-express-app -e MYSQL_ROOT_PASSWORD=express_app -e MYSQL_DATABASE=express_app_db -e MYSQL_PASSWORD=express_app -p 3307:3306 -d mysql:8.0
-
Run Database Migrations:
npm run migrate
-
Start the Application:
npm start
The application will run locally on the specified port (default is 3000). You can access the API via http://localhost:3000
. Ensure the Docker container is running before starting the application to allow database connections.