Skip to content

I developed the backend for the NLW Connect project using Node.js, Fastify, and the Drizzle ORM, creating a referral system for online events.

License

Notifications You must be signed in to change notification settings

VagnerNerves/nlw-connect-nodejs-022025

Repository files navigation

Project NLW Connect - Referral system for online events

I developed the backend for the NLW Connect project using Node.js, Fastify, and the Drizzle ORM, creating a referral system for online events. The following routes were implemented: event registration, invitation lookup and redirection to the new user registration based on the referral, counting clicks on the invitation, querying the number of referrals that signed up, checking the current ranking position, and displaying the top 3 users who made the most referrals. The system uses PostgreSQL as the database and Redis.

🧭 Table of contents

🎥 Implementation Video

Project.NLW.Connect.-.Referral.system.for.online.events.mp4

👏 Learning and more Implementations

The main takeaway was using Redis as a database to store ranking positions, as well as creating Swagger documentation for the routes, using Zod for validation.

💡 Technologies Used

🚀 Running the Project

Back-end

Clone the project

  git clone https://github.com/VagnerNerves/nlw-connect-nodejs-022025.git

Enter the project directory

  cd nlw-connect-nodejs-022025

Install with dependencies

  npm install

You will need to run Docker and then execute the command to create the PostgreSQL and Redis databases

  docker compose up -d

Execute the Drizzle ORM migrate and generate command to create the database and tables

  npx drizzle-kit migrate
  npx drizzle-kit generate

Create the .env file according to the .env.example file.

Start the server

  npm run dev

Now your backend will be running at http://localhost:33333, and you can view and interact with the routes through the Swagger documentation at http://localhost:33333/docs.

📝 Routes

Access http://localhost:33333/docs for the route documentation with Swagger.

🌎 License

This project is under the MIT license. See the LICENSE file for more details.

✒ Author

Author Vagner Nerves

Vagner Nerves

Made with love and hate 😅, get in touch!

Linkedin Badge Gmail Badge GitHub Badge

About

I developed the backend for the NLW Connect project using Node.js, Fastify, and the Drizzle ORM, creating a referral system for online events.

Topics

Resources

License

Stars

Watchers

Forks