A space-themed NodeJS demo application for managing rocket launch countdowns. Built with Fastify and Prisma, featuring a clean and simple interface for creating, viewing, and managing countdown timers for upcoming rocket launches.
It uses Endor to run a Postgres database for development. You do not need to install any additional software, as Endor is like any other Node dependency.
- ✅ Create and manage rocket launch countdowns
- ✅ Live countdown timers with days, hours, minutes, and seconds
- ✅ RESTful API for programmatic access
- ✅ Simple, responsive web interface
- ✅ No authentication required (simplified admin panel)
- ✅ PostgreSQL database support via Prisma ORM
- Backend: Node.js with Fastify
- Database: PostgreSQL with Prisma ORM. Run with Endor
- Frontend: Plain HTML, CSS, and JavaScript (no frameworks)
- Template Engine: EJS
- Testing: Node.js built-in test runner
- Node.js 20+
- npm
- Clone the repository:
git clone https://github.com/endorhq/node-demo.git
cd node-demo- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env- Generate Prisma client:
npm run db:generate- Start the application and the database:
npm run dev- Push database schema:
npm run db:pushnpm run devnpm startThe application will be available at http://localhost:3000
Get all countdowns sorted by launch date.
Response:
[
{
"id": 1,
"mission": "Artemis III",
"rocket": "SLS Block 1B",
"launchDate": "2025-12-01T14:00:00.000Z",
"description": "First crewed lunar landing mission",
"createdAt": "2025-01-11T10:00:00.000Z",
"updatedAt": "2025-01-11T10:00:00.000Z"
}
]Get a specific countdown by ID.
Create a new countdown.
Request body:
{
"mission": "Mission Name",
"rocket": "Rocket Type",
"launchDate": "2025-12-01T14:00:00Z",
"description": "Optional mission description"
}Update an existing countdown.
Delete a countdown.
Run the test suite:
npm test # Run all tests
npm run test:unit # Run unit tests only
npm run test:integration # Run integration tests onlyThis project includes GitHub Actions workflows for automated testing:
- CI Pipeline: Runs on every push and pull request
- Tests on Node.js 20.x and 22.x
- Uses Endor to spin up PostgreSQL for integration tests
- Includes unit tests, integration tests, and code quality checks
- Falls back to containerized PostgreSQL if Endor fails
The CI configuration can be found in .github/workflows/ci.yml.
You can find it on the prisma/schema.prisma file.
MIT