Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backend Practice API

This project is a personal backend refresher build created as I prepare to start my journey as a Junior Software Developer next week. I built it to strengthen my fundamentals in backend development before stepping into real-world work.

The goal was simple: practice the core building blocks of a backend application from scratch using modern tools and clean project structure.

What this project covers

This API demonstrates several backend fundamentals, including:

  • Building a REST API with Express and TypeScript
  • Creating reusable route and controller structure
  • Implementing authentication with JWT and password hashing
  • Validating request data with Zod
  • Working with PostgreSQL through Prisma ORM
  • Designing relational data models for users, movies, and watchlists
  • Handling errors and environment configuration cleanly

Features

  • User signup, login, and logout
  • JWT-based authentication
  • Movie creation and retrieval
  • Movie removal for authorized users
  • Watchlist management for users
  • Prisma-powered database access with relational models

Tech stack

  • TypeScript
  • Node.js
  • Express
  • Prisma ORM
  • PostgreSQL
  • JWT
  • bcryptjs
  • Zod

Project structure

src/
  controllers/     # Request handlers
  routes/          # API routes
  middleware/      # Auth, validation, and error handling
  validators/      # Input validation schemas
  config/          # Database configuration
prisma/
  schema.prisma    # Database schema and models
  seed.ts          # Seed script for initial data

Getting started

1. Install dependencies

npm install

2. Create your environment file

Create a .env file in the project root with the following values:

DATABASE_URL=postgresql://<username>:<password>@<host>:<port>/<database>
JWT_SECRET=your-secret-key
NODE_ENV=development

3. Run Prisma migrations

npx prisma migrate dev

4. Seed the database

npm run seed:movies

5. Start the development server

npm run dev

The server will run on:

http://localhost:5001

API overview

Auth

  • POST /auth/signup
  • POST /auth/login
  • POST /auth/logout

Movies

  • GET /movies
  • POST /movies
  • DELETE /movies/:movieId

Watchlist

  • POST /watchlist
  • GET /watchlist
  • DELETE /watchlist/:movieId

Why I built this

This project is part of my personal preparation before starting work as a junior developer. It helped me refresh my understanding of backend concepts, improve my confidence with full-stack-style API development, and build something practical that I can talk about in interviews and on GitHub.

What I learned

Through this project, I strengthened my understanding of:

  • API design
  • Authentication flow
  • Data modeling
  • Database integration
  • Error handling
  • Clean code structure for backend systems

Next steps

Some ideas for improving this project further:

  • Add unit and integration tests
  • Add API documentation with Swagger
  • Improve input validation and error responses
  • Add role-based access control
  • Deploy the API to a cloud service

License

This project is for learning and personal development purposes.

About

A backend refresher project built with Express, TypeScript, Prisma, and PostgreSQL to strengthen core API and database fundamentals before starting work as a junior developer.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages