Welcome to the Travelbase Backend training project.
This repository is designed to help you get familiar with:
- Fastify (backend framework)
- API design
- Request/response lifecycle
- Writing clean, structured backend code
- Understanding how production APIs are built
This is not a full production system, but a simplified environment to help you ramp up.
npm installnpm run devThe server will start at:
http://localhost:3000
npm run testOver the next few weeks, focus on understanding:
- What is Fastify?
- How routes are defined
- How requests are handled
- How responses are returned
- Routes vs Services
- Separation of concerns
- Clean code organization
- Incoming request
- Validation
- Processing logic
- Response
- Reading logs
- Fixing errors
- Understanding stack traces
src/
├── routes/ # Defines API endpoints
├── services/ # Business logic (what the app actually does)
├── plugins/ # Fastify plugins
├── utils/ # Helper functions
└── server.ts # Entry point
Start with these:
- Install dependencies
- Start the server
- Confirm it works in the browser
- Open
routes/ - Pick any route
- Trace:
- What URL it listens to
- What it returns
- Change a response message
- Restart the server
- Verify the change
Example:
fastify.get('/hello', async (request, reply) => {
return { message: 'Hello World' }
})- Do NOT copy code blindly — understand it
- Ask questions early
- Break things and fix them (this is how you learn)
- Keep your code clean and readable
- Fastify Docs: https://fastify.dev/docs/latest/
- Node.js Docs: https://nodejs.org/en/docs
By the end of this training, you should be able to:
- Build simple APIs
- Understand backend flow
- Read and modify real-world backend code
Michael Awoniran
Backend & Distributed Systems Engineer