This project was developed during Rocketseat's Next Level Week (NLW) event, focusing on building a modern, robust, and efficient API using cutting-edge technologies.
- Node.js with native TypeScript (
--experimental-strip-types) - Fastify – High-performance web framework
- PostgreSQL with pgvector extension for vector support
- Drizzle ORM – Type-safe ORM for database operations
- Zod – Schema validation with static typing
- Docker – Containerized database
- Biome – Code linting and formatting
The project follows a clean and modular architecture:
- Clear separation between routes, schemas, and database logic
- Schema validation with Zod for type safety
- Type-safe database operations with Drizzle
- Centralized environment variable validation
- Node.js (with support for
--experimental-strip-types) - Docker and Docker Compose
- Clone the repository:
git clone <repo-url>
cd server- Start the database with Docker:
docker-compose up -d- Create a
.envfile in the root folder with the following content:
PORT=3333
DATABASE_URL=postgresql://docker:docker@localhost:5432/agents
- Install the dependencies:
npm install- Run the database migrations:
npx drizzle-kit migrate- (Optional) Seed the database with sample data:
npm run db:seed- Start the project:
Development mode:
npm run devProduction mode:
npm startnpm run dev– Runs the server in development mode with hot reloadnpm start– Runs the server in production modenpm run db:seed– Seeds the database with sample data
The API will be running at: http://localhost:3333