NLW #20 Rocketseat – Agents Edition
LetMeAsk (API) is a modern, scalable backend service built during the NLW #20 Rocketseat event (July 2025), focused on real-time Q&A for live streaming and interactive platforms. This project leverages the latest Node.js ecosystem, TypeScript, and best practices in backend design, providing a robust API for managing rooms and questions, powered by PostgreSQL and Drizzle ORM.
This project was developed as part of the NLW (Next Level Week) #20 event by Rocketseat, themed "Agents". The event brings together thousands of developers to build innovative, production-ready applications using cutting-edge technologies and modern software engineering practices.
- Node.js (v18+)
- TypeScript
- Fastify (high-performance HTTP server)
- PostgreSQL (relational database)
- Drizzle ORM (type-safe SQL ORM)
- Zod (runtime schema validation)
- Docker (for local development and database)
- CORS (secure cross-origin requests)
- Modular Structure: Clear separation of concerns (routes, schema, migrations, seed, env, etc.)
- Type Safety: End-to-end type safety using TypeScript and Zod
- Environment Management: All config via
.envand validated with Zod - Database Migrations & Seeding: Versioned migrations and easy seeding for reproducible environments
- RESTful API: Organized route handlers under
src/http/routes/ - Health Check:
/healthendpoint for monitoring
src/server.ts– Fastify server entry pointsrc/env.ts– Environment variable validationsrc/db/connection.ts– PostgreSQL connection via Drizzlesrc/db/seed.ts– Database seeding scriptsrc/db/migrations/– SQL migration filessrc/db/schema/– Drizzle ORM schema definitionssrc/http/routes/– API route handlers (e.g.,get-rooms.ts)
- Node.js v18 or higher
- npm
- Docker (for local PostgreSQL)
- Clone the repository:
git clone <repository-url> cd <repository-folder>
- Install dependencies:
npm install
- Copy and configure your environment variables:
cp .env.example .env # Edit .env as needed - Start the PostgreSQL database with Docker:
docker-compose up -d
- Run database migrations:
npm run db:migrate
- (Optional) Seed the database:
npm run db:seed
Start the development server:
npm run devThe server will run on the port specified in .env (default: 3333).
Build and start the server for production:
npm run build
npm startCreate a .env file with:
PORT– Server port (default: 3333)DATABASE_URL– PostgreSQL connection string
- Real-time Q&A API for live streaming
- Modular, type-safe backend
- Health check endpoint (
/health) - Database migrations and seeding
- Secure CORS configuration
- Ready for Dockerized environments
GET /health– Health checkGET /rooms– List all rooms- (Extend with more endpoints as needed)
Pull requests and issues are welcome! This project is a learning resource and a foundation for further development.
This project is licensed under the WTFPL (Do What The F*ck You Want To Public License).
Built with ❤️ during NLW #20 by Rocketseat and the open source community.