Skip to content

Commit

Permalink
Merge pull request #2 from verissimon/prisma
Browse files Browse the repository at this point in the history
Adicionando persistência de dados com prisma
  • Loading branch information
verissimon authored Nov 4, 2023
2 parents ad9264c + 17cb28f commit 79347e0
Show file tree
Hide file tree
Showing 17 changed files with 868 additions and 519 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

#prisma
prisma/migrations/
prisma/dev.db
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# API-atividade1-pw1
Aplicação para gerenciar uma lista de tecnologias de estudos por usuário.

## Study Technologies Management API

This RESTful API is developed using Node.js, TypeScript, Express.js, Prisma, and SQLite. It allows users to manage a list of study technologies. Users can create an account with a name and username, and perform CRUD operations on technologies.

### 1. Prerequisites

Make sure you have Node.js and npm installed on your system. You also need to install the necessary packages using the following command:

```bash
npm install
```

### 2. Create and seed the database

Run the following command to create your SQLite database file. This also creates the `User` and `Technology` tables that are defined in [`prisma/schema.prisma`](./prisma/schema.prisma):

```bash
npx prisma migrate dev --name init
```

When `npx prisma migrate dev` is executed against a newly created database, seeding is also triggered. The seed file in [`prisma/seed.ts`](./prisma/seed.ts) will be executed and your database will be populated with the sample data.

### 3. Start the REST API server

```bash
npm run dev
```

The server is now running on `http://localhost:3001`. You can now run the API requests, e.g. [`http://localhost:3001/users`](http://localhost:3001/users).
Loading

0 comments on commit 79347e0

Please sign in to comment.