This project is a take home assignment for BTST Backend Developer Intern position.
- Node.js
- Express.js
- PostgreSQL
- Prisma ORM
- Node.js
- npm
- PostgreSQL
- Clone the repo
git clone git@github.com:shasherazi/btst-be-backend.git cd btst-be-backend
- Install NPM packages
npm install
- Create a
.env
file in the root directory and add the following environment variablesPORT=3000 DATABASE_URL="postgresql://postgres:password@localhost:5432/btst_be_backend"
- Create a database and run migrations
npx prisma db push
- Seed the database
npx prisma db seed
- Run the server
npm run dev
- GET /users - Get all users
- POST /users - Create a new user
- GET /users/:id - Get a user by id
- PUT /users/:id - Update a user by id
- DELETE /users/:id - Delete a user by id
- GET /users/:id/tasks - Get all tasks of a user
- POST /users/:id/tasks - Create a new task for a user
- GET /users/:id/tasks/:taskId - Get a task by id
- PUT /users/:id/tasks/:taskId - Update a task by id
- DELETE /users/:id/tasks/:taskId - Delete a task by id
Prisma is a modern database toolkit that makes it easier for developers to build applications with databases. It replaces traditional ORMs and makes database access easy with an auto-generated and type-safe query builder that's tailored to your database schema. Prisma is open-source and can be used in any Node.js, Java, or TypeScript application.
Distributed under the MIT License. See LICENSE for more information.